Install and Configure Foreman 3.x on Debian 11/ Debian 10

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 3.x on Debian 11/ Debian 10 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:

  • 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.

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.

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

sudo apt update

sudo apt get -y upgrade

[ -f /var/run/reboot-required ] && sudo reboot -f

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

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

Install dependency packages:

sudo apt update

sudo apt -y install curl wget ca-certificates wget lsb-release gpg ca-certificates

Add Puppet repositories:


sudo dpkg -i puppet6-release-bullseye.deb

Add Foreman repositories:

echo "deb bullseye nightly" | sudo tee /etc/apt/sources.list.d/foreman.list

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

sudo dpkg -i ./puppet6-release-buster.deb

Add Foreman repositories.

echo "deb buster nightly" | sudo tee /etc/apt/sources.list.d/foreman.list

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

Then import repository GPG key

### Debin 11 (Bullseye) ###

curl -fsSL | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/foreman.gpg

### Debian 10 (Buster)

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

Downloading the installer with the command below.

sudo apt update

sudo apt install foreman-installer

Hit the y key to proceed with the installation:

Reading package lists... Done

Building dependency tree... Done

Reading state information... Done

The following additional packages will be installed:

fonts-lato libjs-jquery libruby2.7 puppet-agent rake ruby ruby-ansi ruby-clamp ruby-hashie ruby-highline ruby-kafo ruby-kafo-parsers ruby-kafo-wizards ruby-little-plugger ruby-logging

ruby-minitest ruby-multi-json ruby-net-telnet ruby-oj ruby-power-assert ruby-powerbar ruby-rubygems ruby-test-unit ruby-xmlrpc ruby2.7 rubygems-integration zip

Suggested packages:

ri ruby-dev ruby-activesupport bundler

The following NEW packages will be installed:

fonts-lato foreman-installer libjs-jquery libruby2.7 puppet-agent rake ruby ruby-ansi ruby-clamp ruby-hashie ruby-highline ruby-kafo ruby-kafo-parsers ruby-kafo-wizards ruby-little-plugger

ruby-logging ruby-minitest ruby-multi-json ruby-net-telnet ruby-oj ruby-power-assert ruby-powerbar ruby-rubygems ruby-test-unit ruby-xmlrpc ruby2.7 rubygems-integration zip

0 upgraded, 28 newly installed, 0 to remove and 55 not upgraded.

Need to get 32.6 MB of archives.

After this operation, 186 MB of additional disk space will be used.

Do you want to continue? [Y/n] y

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

$ ip ad

1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

inet scope host lo

valid_lft forever preferred_lft forever

inet6 ::1/128 scope host

valid_lft forever preferred_lft forever

2: ens3: mtu 1450 qdisc pfifo_fast state UP group default qlen 1000

link/ether fa:16:3e:a8:47:e1 brd ff:ff:ff:ff:ff:ff

altname enp0s3

inet brd scope global dynamic ens3

valid_lft 78629sec preferred_lft 78629sec

inet6 fe80::f816:3eff:fea8:47e1/64 scope link

valid_lft forever preferred_lft forever

$ sudo vim /etc/hosts foreman

Set hostname using hostnamectl command:

sudo hostnamectl set-hostname --static

Edit /etc/hosts and add IP and hostname

$ sudo vim /etc/hosts

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

$ ping $(hostname -f)

PING ( 56(84) bytes of data.

64 bytes from ( icmp_seq=1 ttl=64 time=0.015 ms

64 bytes from ( icmp_seq=2 ttl=64 time=0.033 ms

64 bytes from ( icmp_seq=3 ttl=64 time=0.031 ms

--- ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2036ms

rtt min/avg/max/mdev = 0.015/0.026/0.033/0.008 ms

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

sudo foreman-installer --help

For interactive mode, run:

sudo foreman-installer -i

The wizard will gather all required information, when ready to start press y.

Welcome to the Foreman installer!


This wizard will gather all required information. You can change any parameter

to your needs.

Ready to start? (y/n)


Enable all the modules you want installed.


Main Config Menu

1. [✓] Configure foreman

2. [✓] Configure foreman_cli

3. [✗] Configure foreman_cli_ansible

4. [✗] Configure foreman_cli_azure

5. [✗] Configure foreman_cli_discovery

6. [✗] Configure foreman_cli_kubevirt

7. [✗] Configure foreman_cli_openscap

8. [✓] Configure foreman_cli_puppet

9. [✗] Configure foreman_cli_remote_execution

10. [✗] Configure foreman_cli_tasks

11. [✗] Configure foreman_cli_templates

12. [✗] Configure foreman_cli_webhooks

13. [✓] Configure foreman_proxy

14. [✓] Configure puppet

15. [✗] Configure foreman_plugin_acd

16. [✗] Configure foreman_plugin_ansible

17. [✗] Configure foreman_plugin_azure

18. [✗] Configure foreman_plugin_bootdisk

19. [✗] Configure foreman_plugin_chef

20. [✗] Configure foreman_plugin_column_view

21. [✗] Configure foreman_plugin_default_hostgroup

22. [✗] Configure foreman_plugin_dhcp_browser

23. [✗] Configure foreman_plugin_discovery

24. [✗] Configure foreman_plugin_expire_hosts

25. [✗] Configure foreman_plugin_hooks

26. [✗] Configure foreman_plugin_host_extra_validator

27. [✗] Configure foreman_plugin_host_reports

28. [✗] Configure foreman_plugin_kubevirt

29. [✗] Configure foreman_plugin_leapp

30. [✗] Configure foreman_plugin_memcache

31. [✗] Configure foreman_plugin_monitoring

32. [✗] Configure foreman_plugin_omaha

33. [✗] Configure foreman_plugin_openscap

34. [✗] Configure foreman_plugin_ovirt_provision

35. [✓] Configure foreman_plugin_puppet

36. [✗] Configure foreman_plugin_puppetdb

37. [✗] Configure foreman_plugin_remote_execution

38. [✗] Configure foreman_plugin_remote_execution_cockpit

39. [✗] Configure foreman_plugin_salt

40. [✗] Configure foreman_plugin_setup

41. [✗] Configure foreman_plugin_snapshot_management

42. [✗] Configure foreman_plugin_statistics

43. [✗] Configure foreman_plugin_tasks

44. [✗] Configure foreman_plugin_templates

45. [✗] Configure foreman_plugin_webhooks

46. [✗] Configure foreman_compute_ec2

47. [✗] Configure foreman_compute_gce

48. [✗] Configure foreman_compute_libvirt

49. [✗] Configure foreman_compute_openstack

50. [✗] Configure foreman_compute_ovirt

51. [✗] Configure foreman_compute_vmware

52. [✗] Configure foreman_proxy_plugin_acd

53. [✗] Configure foreman_proxy_plugin_ansible

54. [✗] Configure foreman_proxy_plugin_chef

55. [✗] Configure foreman_proxy_plugin_dhcp_infoblox

56. [✗] Configure foreman_proxy_plugin_dhcp_remote_isc

57. [✗] Configure foreman_proxy_plugin_discovery

58. [✗] Configure foreman_proxy_plugin_dns_infoblox

59. [✗] Configure foreman_proxy_plugin_dns_powerdns

60. [✗] Configure foreman_proxy_plugin_dynflow

-- press enter/return to continue or q to stop --

61. [✗] Configure foreman_proxy_plugin_monitoring

62. [✗] Configure foreman_proxy_plugin_omaha

63. [✗] Configure foreman_proxy_plugin_openscap

64. [✗] Configure foreman_proxy_plugin_remote_execution_ssh

65. [✗] Configure foreman_proxy_plugin_reports

66. [✗] Configure foreman_proxy_plugin_salt

67. [✗] Configure foreman_proxy_plugin_shellhooks

68. Display current config

69. Save and run

70. Cancel run without Saving

Example to enable libvirt module:

?  48

Module foreman_compute_libvirt configuration

1. Enable/disable foreman_compute_libvirt module, current value: false

2. Back to main menu

Choose an option from the menu... 1

Enable foreman_compute_libvirt module? (y/n) y

Module foreman_compute_libvirt configuration

1. Enable/disable foreman_compute_libvirt module, current value: true

2. Configure Advanced parameters

3. Reset a parameter to its default value

4. Back to main menu

Choose an option from the menu... 4

Once done use 69. Save and run

Choose an option from the menu... 69

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

You can also start the Foreman installer without interactive mode:

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.


You should see a dashboard which looks similar to below.


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


Reference and more reading:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store

ComputingPost — Linux Howtos, Tutorials, Guides, News, Tips and Tricks.