11.6 C
Amsterdam

How to install Foreman on Debian 10?

angeloma
angeloma
Senior Writer and partner

Managing servers on many occasions can become a difficult task for engineers. Especially because it doesn’t necessarily have to be one but several. With this, multiple circumstances increase significantly. So, today, I will teach you how to install Foreman on Debian 10. This is an extraordinary application to help you with this task.

Foreman is a complete lifecycle management tool for physical and virtual servers. One of its most powerful features is to provide the opportunity to manage multiple servers from a single web interface. In addition, you can perform multiple tasks on several occasions. That is, task automation

Moreover, it is configurable through plugins and an extensive API development. So, let’s install Foreman.

Preparing the System for the installation

Before you start, there are a few things you should do to ensure that the installation runs as smoothly as possible.

So, first, update the system to get all the security patches and to prepare the system.

sudo apt update
sudo apt upgrade

After this, you need to configure your hostname properly. To do this, use the hostnamectl command.

sudo hostnamectl set-hostname foreman.osradar.test

Replace the hostname value with your hostname. This will depend on whether or not to use a subdomain. Anyway, it depends on your needs.

The changes will be applied after you close the SSH session and reconnect.

Then, you have to enter these changes in the /etc/hosts file.

So, open it:

sudo nano /etc/hosts

And comment out all the IPv4 content and add the following:

x.x.x.x.x foreman.osradar.test foreman

Replace x.x.x.x.x for the IP address of your server and the hostname for yours. Save the changes and close the file.

Once this is done, you have to install some packages needed to perform the installation.

sudo apt install gpg ca-certificates wget

Now we are ready to install.

Install Foreman on Debian 10

Now we can start the installation of Foreman. First, add the Puppet repository which is a dependency of the program.

wget https://apt.puppet.com/puppet6-release-buster.deb
--2021-01-22 21:44:08--  https://apt.puppet.com/puppet6-release-buster.deb
 Resolving apt.puppet.com (apt.puppet.com)… 2600:9000:2104:c400:1d:fc37:1cc0:93a1, 2600:9000:2104:f600:1d:fc37:1cc0:93a1, 2600:9000:2104:200:1d:fc37:1cc0:93a1, …
 Connecting to apt.puppet.com (apt.puppet.com)|2600:9000:2104:c400:1d:fc37:1cc0:93a1|:443… connected.
 HTTP request sent, awaiting response… 200 OK
 Length: 11736 (11K) [application/x-debian-package]
 Saving to: ‘puppet6-release-buster.deb’
 puppet6-release-buster.deb                 100%[=====================================================================================>]  11.46K  --.-KB/s    in 0s      
 2021-01-22 21:44:08 (120 MB/s) - ‘puppet6-release-buster.deb’ saved [11736/11736]

Next, install the downloaded package to add the repository to the system source list.

sudo apt install ./puppet6-release-buster.deb

This is enough. Now, it’s time to add the Foreman repository. To do this, run these two commands:

echo "deb http://deb.theforeman.org/ buster 2.0" | sudo tee /etc/apt/sources.list.d/foreman.list

echo "deb http://deb.theforeman.org/ plugins 2.0" | sudo tee -a /etc/apt/sources.list.d/foreman.list

For the system to recognize them, the GPG key of the plugins must be added.

wget -q https://deb.theforeman.org/pubkey.gpg -O- | sudo apt-key add -
OK

Next, refresh APT

sudo apt update

And finally, install the Foreman installer package:

sudo apt install foreman-installer
Reading package lists… Done
 Building dependency tree       
 Reading state information… Done
 The following additional packages will be installed:
   libgdbm-compat4 libruby2.5 puppet-agent rake ruby ruby-ansi ruby-clamp ruby-did-you-mean 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-power-assert ruby-powerbar ruby-test-unit ruby-xmlrpc ruby2.5
   rubygems-integration
 Suggested packages:
   ri ruby-dev bundler
 Recommended packages:
   zip ruby-oj fonts-lato libjs-jquery
 The following NEW packages will be installed:
   foreman-installer libgdbm-compat4 libruby2.5 puppet-agent rake ruby ruby-ansi ruby-clamp ruby-did-you-mean 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-power-assert ruby-powerbar ruby-test-unit ruby-xmlrpc ruby2.5
   rubygems-integration
 0 upgraded, 25 newly installed, 0 to remove and 0 not upgraded.
 Need to get 27.5 MB of archives.
 After this operation, 159 MB of additional disk space will be used.
 Do you want to continue? [Y/n]

Once the package is installed, you need to perform the installation itself:

sudo foreman-installer

There are many installation options that you can consult on this link. It all depends on your needs.

If all goes well, you will see an output screen like this:

Preparing installation Done

  Success!
  * Foreman is running at https://foreman.osradar.test
      Initial credentials are admin / hbGJfgqEG96CXKKe
  * Foreman Proxy is running at https://foreman.osradar.test:8443
  The full log is at /var/log/foreman-installer/foreman.log

And you will be able to use it.

Testing Foreman on Debian 10

Now we can open a web browser from a client computer and access https://domain which in this example is https://foreman.osradar.test and you will see the Login screen.

1.- Foreman login screen
1.- Foreman login screen

Now log in with your user name and password and you will be able to enjoy Foreman.

2.- Foreman on Debian 10
2.- Foreman on Debian 10

So, that is it.

Conclusion

Foreman is an application that assists in the administration of servers by facilitating complex processes from a graphical interface. In this post, you have noticed how it can be done without major problems in Debian 10.

- Advertisement -

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Donate to Osradar

Latest article

x