Manual Infrastructure management is now a thing of the past. It is hard to scale, troubleshoot and perform deep integration with existing enterprise Infrastructure. Foreman is an open source tool created to help System Administrators automate provisioning, configuration of IT systems. With Foreman you can actually automate complete System’s Lifecycle. This guide will walk you through the steps to install and configure Foreman 2.x on Debian 10 (Buster) Linux.

With Chef, Puppet, Salt, Ansible and Foreman’s smart proxy architecture, Foreman can easily automate repetitive tasks, quickly deploy applications, and proactively manage change, both on-premise with VMs and bare-metal or in the cloud.

For Ubuntu: Install Foreman on Ubuntu Linux

Foreman Architecture:

foreman architecture

With Foreman you can:

  • Discover, provision and upgrade your entire bare-metal infrastructure
  • Create and manage instances in virtualization environment and across private and public clouds
  • Install operating systems via PXE, local media or from templates or images
  • Control and gather reports from your configuration management software
  • Group your hosts and manage them in bulk, regardless of location
  • Review historical changes for auditing or troubleshooting
  • Web user interface, JSON REST API and CLI for Linux
  • Extend as needed via a robust plugin architecture

Foreman, provides comprehensive, interaction facilities including a web frontend, CLI and RESTful API which enables you to build higher level business logic on top of a solid foundation. It is deployed in many organizations, managing from 10s to 10,000s of servers. Several commercial products are based on Foreman.

Install Foreman on Debian 10 (Buster)

We’ll use Foreman installer which is a collection of Puppet modules that installs everything required for a full working Foreman setup. This installer uses native OS packaging, both for Debian based and Red Hat based systems.

Step 1: Update System

We always start our installation by ensuring the system is updated.

sudo apt update
sudo apt get -y upgrade
sudo reboot

After the system is rebooted, you can continue to step 2.

Step 2: Add Puppet and Foreman Repositories

Next we need to add all the repositories that will be required for both dependencies and actual Foreman package installation.

Add Puppet repository:

sudo apt update
sudo apt -y install ca-certificates wget
sudo apt install ./puppet6-release-buster.deb

Add Foreman repository to Debian 10 (Buster) system.

sudo apt -y install gpg ca-certificates
echo "deb buster 2.0" | sudo tee /etc/apt/sources.list.d/foreman.list
echo "deb plugins 2.0" | sudo tee -a /etc/apt/sources.list.d/foreman.list
wget -q -O- | sudo apt-key add -

Step 3: Download Foreman Installer

Downloading the installer with the command below.

sudo apt update
sudo apt -y install foreman-installer

Before using the installer to get the latest release of Foreman running on Debian 10 (Buster) machine, remove the entry on /etc/hosts for localhost.

$ sudo vim /etc/hosts deb10.novalocal deb10

Test to confirm hostname doesn’t return the localhost address.

$ ping $(hostname -f)
PING deb10.novalocal ( 56(84) bytes of data.
64 bytes from deb10.novalocal ( icmp_seq=1 ttl=64 time=0.024 ms
64 bytes from deb10.novalocal ( icmp_seq=2 ttl=64 time=0.019 ms
--- deb10.novalocal ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 4ms
rtt min/avg/max/mdev = 0.019/0.021/0.024/0.005 ms

Step 4: Install Foreman on Debian 10 (Buster)

By default the installation will run is non-interactive mode, but the configuration can be customized by supplying any of the options listed in:

$ foreman-installer --help

For interactive mode, run:

$ foreman-installer -i

More examples are given in the Installation Options section. Adding -v will disable the progress bar and display all changes.

I’ll start the Foreman installer by executing the command:

$ sudo foreman-installer

If Smart Proxy, Puppet master are installed along Foreman, the installer will output details about them after the installation.

Preparing installation Done                                              
  * Foreman is running at https://deb10.novalocal
      Initial credentials are admin / yafNTaFNNJRUGP84
  * Foreman Proxy is running at https://deb10.novalocal:8443
  The full log is at /var/log/foreman-installer/foreman.log

Use the details given in the output to login to Foreman Dashboard.

Install foreman debian 10 linux 01

You should see a dashboard which looks similar to below.

Install foreman debian 10 linux 02

You’re now on the right path to defining Infrastructure automation with Foreman.

install foreman ubuntu 18.04 02 min

Reference and more reading:

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here