How to Install Foreman on CentOS 7

Using a Different System?

  • How to Install Foreman on Ubuntu 16.04 LTS

Are we missing a guide for your target system? Request one, or submit your own!

Foreman is a free and open source tool which helps you with configuration and management of physical and virtual servers. Foreman also helps you to provision and monitor your server.


  • CentOS 7 server.
  • Root user access.

Update System

Update your system before installing Foreman.

yum -y update

Setup a Hostname

You’ll have to edit the /etc/hosts file using any text editor.

nano /etc/hosts

Add your server. server.vultr.local server

Next, you’ll need to setup a hostname.

nano /etc/hostname

Enter your hostname, be sure to change it to your own hostname.


Save the file and exit from the text editor.

Note: The above commands are examples. You should change them to your own.

Install Foreman

The Foreman installer is a collection of Puppet modules that installs everything required for a full working Foreman setup.

Now let’s configure the EPEL, Puppet and Foreman repositories.

rpm -ivh -ivh -ivh

Install the Foreman installer so that it can install Foreman and all of its required packages.

yum -y install foreman-installer

Execute the Foreman installer. It’ll take some.


You’ll see Success as output on completion of installation.

Firewall Configuration

Execute following commands one by one.

firewall-cmd --permanent --add-port=53/tcpfirewall-cmd --permanent --add-port=67-69/udpfirewall-cmd --permanent --add-port=80/tcpfirewall-cmd --permanent --add-port=443/tcpfirewall-cmd --permanent --add-port=3000/tcpfirewall-cmd --permanent --add-port=3306/tcpfirewall-cmd --permanent --add-port=5910-5930/tcpfirewall-cmd --permanent --add-port=5432/tcpfirewall-cmd --permanent --add-port=8140/tcpfirewall-cmd --permanent --add-port=8443/tcp

Reload firewall services.

firewall-cmd --reload

Web Interface

Open up your web browser and visit http://YourServerIP or http://FQDN to access Foreman web interface. You’ll see a login webpage, so enter your Foreman username and password and then click the Login button.

Install NTP Module

NTP module is one of the most important requirements of Puppet for managing the NTP services.

puppet module install -i /etc/puppet/environments/production/modules saz/ntp

In the Foreman web console, go to Configure > Puppet Classes and click on Import from hostname (server.vultr.local) to read the available Puppet classes from the puppet master and populate Foreman’s database.

Select the NTP module and click on the Update button.

Now you can manage NTP module and Foreman from its dashboard.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article

No comments

Powered by Blogger.