Install Foreman on Ubuntu 20.04

Updated on March 1, 2022
Install Foreman on Ubuntu 20.04 header image


Foreman is free and open-source software that offers complete lifecycle management for physical and virtual servers. System administrators can manage servers by provisioning server instances, configuring, automating repetitive tasks, deploying applications, and monitoring server performances. Interactions with Foreman are achievable via a web console, CLI tool, and a RESTful API. This article explains how to install Foreman on Ubuntu 20.04.


1. Configure Hostname

Update system package list.

$ sudo apt update

Configure FQDN (Fully Qualified Domain Name) of the Foreman server. Change the hostname.

$ sudo hostnamectl set-hostname

Edit the /etc/hosts file.

$ sudo nano /etc/hosts

Add the following line to the file. Change the IP Address and the domain name with your server details. Save and close the file.

2. Install Packages

Install required packages.

$ sudo apt install -y apt-transport-https wget gpg gnupg ca-certificates

Download Puppet repository.

$ wget

Add Puppet repository.

$ sudo dpkg -i ./puppet6-release-focal.deb

Add Foreman repository to system.

$ echo "deb focal 3.0" | sudo tee /etc/apt/sources.list.d/foreman.list

$ echo "deb plugins 3.0" | sudo tee -a /etc/apt/sources.list.d/foreman.list

Download Foreman GPG keys.

$ wget -q -O- | sudo apt-key add -

Update system package list.

$ sudo apt update

3. Install Foreman

Download the installer.

$ sudo apt -y install foreman-installer

Run Foreman installation.

$ sudo foreman-installer

Allow ports 80.

$ sudo ufw allow 80

4. Access Foreman Web UI

Open your web browser and access the Foreman web UI using the URL


You have installed Foreman on your Ubuntu 20.04 server. After installation is complete, you will get your login credentials on the CLI console.

More Information

For more information on Foreman, please visit the official documentation.