From June 2015

Install foreman on Ubuntu 14.04

I found some patchy information and I had a lot of failed installs before I could get it up and running on Ubuntu 14.04 – this is the guide I made while I was doing it and includes all the errors I was making:

How to install Foreman on Ubuntu 14.04

How to install Foreman on Ubuntu 14.04 – Follow this guide, the internet is full of lies and deceit!

Create a linux 14.04 virtual machine – DON’T create a user called foreman, call it user, sysadmin, anything like that but not foreman – if you create a user “foreman” then the foreman install will fail and it won’t tell you why. Call the hostname foreman, or something similar. Once the server is created and up and running, stick an address reservation in DHCP and add a static record to DNS (as it’s a linux box it won’t register on the AD DNS)

1 – Change the hostname and the FQDN to match the DNS record

# sudo -s(if you don't like toggling your root access, just sudo each of these commands)
# vi /etc/hosts

Once your host file opens make changes so it looks like this:

root@foreman:~# vi /etc/hosts  localhost foreman

to save and quit vi – ESC, :x, enter

IMPORTANT – don’t put any capital letters in any of the host names. Even though in DNS the host name is sometimes rendered as example.HOST.LOCAL. if you put it in the hosts file like that then the installation will fail, and it won’t tell you why.

Check the hostname of your host now

# hostname -f

hopefully it will echo back
Reboot your host (not essential I don’t think, worth it though)

# reboot

2 – Add puppet repos, install the puppet agent and puppetmaster. Enable the puppetmaster and then restart it

# sudo -s (if you don't like toggling your root access, just sudo each of these commands)
# wget
# dpkg -i puppetlabs-release-trusty.deb
# apt-get update
# apt-get install -y puppetmaster puppet
# sed -i s/START=no/START=yes/g /etc/default/puppetmaster
# service puppetmaster restart

3 – Add foreman repos. Install Apache2 and Foreman-installer, then install Foreman

# echo "deb trusty stable" > /etc/apt/sources.list.d/foreman.list
# echo "deb plugins stable" >> /etc/apt/sources.list.d/foreman.list
# wget -q -O- | apt-key add -
# apt-get update
# apt-get install -y apache2 foreman-installer
# foreman-installer --enable-foreman-proxy > ./foreman.log

Hopefully you will not have any errors
4 – If you have no errors, continue to configure the puppet agent on the puppetmaster server (inception much?)

# sed -i '/\/var\/log\/puppet/a \' /etc/puppet/puppet.conf
# service puppet restart

5 – now you can check out your foreman install – the default install credentials etc can be found in the log you made on installation

# cat foreman.log
* Foreman is running at
Initial credentials are admin / SOMEPASSWORD
* Foreman Proxy is running at
* Puppetmaster is running at port 8140
The full log is at /var/log/foreman-installer/foreman-installer.log

6 – Open your browser and go to – login with the credentials provided by the install log file

Foreman + Puppet

Foreman + puppet is a pretty awesome combination for automating your IT infrastructure.

I followed a great guide here for setting up a puppet master with foreman web gui.


Don’t have capital letters in your hostname – host.example.local not host.EXAMPLE.LOCAL – else it will have problems setting up the proxy.

Don’t name the user on your server “foreman” – it will make the installation fail, and you won’t know why. The installer creates a user foreman and does some stuff in the home directory.

Also for my setup to install correctly (foreman + ubuntu 14.04) I had to change this command:

foreman-installer > ./foreman.log


Foreman-installer --enable-foreman-proxy > ./foreman.log

else I had errors like:

/Stage[main]/Foreman_proxy::Register/Foreman_smartproxy  Could not evaluate: Could not load data from