Setting Up Your First Puppet Master Server

If you’re managing servers and aren’t using an infrastructure-as-code solution such as Puppet, Ansible or Chef, be warned: you should be.

Other viable solutions are in the past, infrastructure-as-code tools allow businesses and IT to become much more agile, bringing entire environments up and down quickly with ease.


Puppet is one of the first of these solutions and is arguably still the most popular. Its architecture consists of a having one or more Puppet “masters” and nodes that are managed by the master. The master allows you to create the configurations as code, which are then grabbed by nodes and applied. One important note: although Windows support is available with Puppet, the master can only run on Linux.

In this article, I’ll walk you through the process of setting up your very first Puppet master as well as Puppet agent on a client machine. Keep in mind, this will not be a production-ready setup, it will be a no-nonsense guide to getting Puppet up and running so that you can test out the solution.


For our example setup, I’ll be installing the Puppet master on a CentOS 7 VM and Puppet agent on another CentOS VM. Before we install Puppet, we need to ensure proper networking is in place. You’ll need name resolution working, either by DNS or via the host’s file. By default, the Puppet will assume that the hostname of your Puppet master is “puppet” and nodes will look for the master by this name. I’ll leave this configuration as is for this example.

First, let’s get some prerequisites in order. I want to set NTP and set my firewall to allow port 8140 inbound, which is required for communication with the Puppet master.

Here, I ensure firewalld is started and enabled. I then allow port 8140:

[dan@puppet ~]$ sudo systemctl start firewalld

[dan@puppet ~]$ sudo systemctl enable firewalld

[dan@puppet ~]$ sudo firewall-cmd --permanent --zone=public --add-port=8140/tcp

Now I’ll install NTP, which is necessary since the puppet master acts as a certificate authority. To do this I will use the package manager Yum.

[dan@puppet ~]$ sudo yum install ntp

Next, let’s set our time zone and start the NTP service:

[dan@puppet ~]$ sudo timedatectl set-timezone America/New_York

[dan@puppet ~]$ sudo systemctl start ntpd

Finally, I’ll enable NTP through the firewall:

[dan@puppet ~]$ sudo firewall-cmd --add-service=ntp --permanent
Learn how to automate IT tasks with PowerShell. Download this eBook. 

Installing the Puppet Server

Now it’s time to install the actual Puppet software. Once again, we can do this with Yum. Before we do this though, lets enable the puppet repository with the “rpm” command.

[dan@puppet ~]$ sudo rpm -ivh

[dan@puppet ~]$ sudo yum -y install puppetserver


Comments are closed.