Debug School

Cover image for Install Foreman Server
Suyash Sambhare
Suyash Sambhare

Posted on

Install Foreman Server

A Foreman system contains a central Foreman instance that is in charge of providing the Web-based GUI, node configurations, initial host configuration files, etc. However, other operations need to be performed to fully automate this process. The Smart Proxy manages remote services and is generally installed with all Foreman installations to manage TFTP, DHCP, DNS, Puppet, Puppet CA, Ansible, and Salt. The Puppet modules can be read or run in “no-op” mode to see what changes it will make.


  • Ubuntu Server 22.04
  • RAM Memory 4GB


Setup FQDN

Set the hostname
hostnamectl set-hostname

Now edit the '/etc/hosts' file using vim editor.
vi /etc/hosts foreman

Fetch the IP address of the server FQDN.
ping $(hostname -f) -c 3

Add Puppet Repository

Add the Puppet source to install the Puppet package to the Ubuntu system. This is needed to install the Foreman unattended using the puppet module installer script that's given by the Foreman. Install the ca-certificate package and get the Puppet repository package.
sudo apt install ca-certificates -y

Now add the puppet repository.
sudo dpkg -i /tmp/puppet5-release-bionic.deb

Install Foreman

Add the foreman repository.
echo "deb focal 3.7" | sudo tee /etc/apt/sources.list.d/foreman.list
echo "deb plugins 3.7" | sudo tee -a /etc/apt/sources.list.d/foreman.list

Add the Foreman key.
wget -O /etc/apt/trusted.gpg.d/foreman.asc

The key fingerprint is:
5B7C 3E5A 735B CB4D 6158 29DC 0BDD A991 FD7A AC8A
Foreman Automatic Signing Key (2021) <>

Update Ubuntu repositories and install the 'foreman-installer' package
sudo apt update
sudo apt install foreman-installer -y

Run the installer.

sudo foreman-installer
 * Foreman is running at
 Initial credentials are admin / ************
 * Foreman Proxy is running at
 The full log is at /var/log/foreman-installer/foreman-installer.log
Enter fullscreen mode Exit fullscreen mode

Configure UFW Firewall

Open some ports that are necessary for Foreman.

ufw allow http
ufw allow https
ufw allow ssh
ufw allow 69/udp
ufw allow 8140/tcp
Enter fullscreen mode Exit fullscreen mode

Start and enable the ufw firewall service.
ufw enable

Open the Foreman Dashboard
Now open your Firefox browser and type the foreman server IP or domain name in the Omnibox

Run the Puppet Agent
Log in to the Foreman server and run the following puppet command.
sudo /opt/puppetlabs/bin/puppet agent --test

The server will automatically install and configure the NTP service using custom configuration.
After it's complete, check the '/etc/ntp.conf' configuration file.
cat /etc/ntp.conf


Top comments (0)