Puppet is a configuration management tool that uses a declarative language to describe system state. It uses an agent–master (server) model: a Puppet server compiles catalogs and serves them to Puppet agents on your nodes. In this guide you install Puppet 7 open-source server on Rocky Linux 8 or AlmaLinux 8 (and CentOS 8), configure the server and an agent, then deploy Nginx using a simple manifest.
Puppet is shipped as several packages: puppetserver (runs on the JVM and compiles catalogs), puppet-agent (runs on each node), and puppetdb (optional, for storing Puppet data). Here we use puppetserver and puppet-agent only.
In this guide you’ll:
- Update the system, set hostname, and (optionally) set SELinux to permissive
- Enable the Puppet 7 repo and install
puppetserverandpuppet-agent - Configure
puppet.confand memory for Puppet server, then start and enable services - Open port 8140, add Puppet binaries to
PATH, and run the agent to get a signed certificate - Create a simple manifest to install and enable Nginx and verify it with
puppet agent -t
Related: Puppet 7 on Ubuntu 22.04 · Puppet 7 on Rocky/AlmaLinux 9 · Puppet 7 on Ubuntu 20.04 · Ansible on Rocky Linux/CentOS 8
Prerequisites
- One or two machines running Rocky Linux 8, AlmaLinux 8, or CentOS 8 (one for server, optionally one for agent).
- Root or sudo access.
- Internet access to install packages and the Puppet repo.
- Basic familiarity with the Linux terminal and
vim(or another editor).
Table of contents
- Prerequisites
- Table of contents
- 1. Ensure the servers are up to date
- 2. Set the hostname
- 3. Set SELinux to permissive (optional)
- 4. Install Puppet Server
- 5. Configure Puppet master and agent
- 6. Start and enable Puppet server
- 7. Open port 8140 on the firewall
- 8. Add Puppet binaries to PATH
- 9. Start the Puppet agent
- 10. Verify the Puppet agent
- 11. Create a simple manifest to deploy Nginx
- Frequently Asked Questions (FAQ)
- Conclusion
1. Ensure the servers are up to date
Update packages on the server (and agent, if separate):
| |
2. Set the hostname
Puppet uses the server hostname for certificates and agent communication. On the Puppet server, set the hostname to a FQDN (replace with your own):
| |
Ensure the hostname resolves (DNS or /etc/hosts). Edit /etc/hosts:
| |
Add a line like (use your server’s IP and hostname):
| |
Confirm:
| |
You should see Static hostname: puppetmaster.citizix.com (or your FQDN).
3. Set SELinux to permissive (optional)
Puppet can run with SELinux enabled, but for a first-time setup many guides use permissive mode to avoid permission issues. To set it temporarily without rebooting:
| |
To make it persistent, edit /etc/sysconfig/selinux and set:
| |
Then reboot, or keep using setenforce 0 until you reboot. Use disabled only if you understand the implications.
4. Install Puppet Server
Enable the Puppet 7 platform repository, then install the puppetserver package (Puppet Server runs on the JVM and compiles catalogs for agents):
| |
5. Configure Puppet master and agent
Memory for Puppet Server: Edit /etc/sysconfig/puppetserver and set the JVM heap (e.g. 1 GB):
| |
Set:
| |
Server and agent config: Edit puppet.conf:
| |
Add a [server] section with dns_alt_names (use your FQDN and short name), and a [main] section for the agent:
| |
6. Start and enable Puppet server
Start the service and enable it on boot:
| |
Check status: sudo systemctl status puppetserver (should show active (running)). Verify the version:
| |
Example output: puppetserver version: 7.4.1.
7. Open port 8140 on the firewall
Agents connect to the server on TCP 8140. If you use firewalld, open the port:
| |
8. Add Puppet binaries to PATH
Puppet CLI tools live in /opt/puppetlabs/bin. Add it to your PATH so you can run puppet and facter without the full path:
| |
9. Start the Puppet agent
On the same machine (or another node that will be an agent), start the Puppet agent so it contacts the server and requests a certificate:
| |
Check status with sudo systemctl status puppet. The agent will run and try to get a cert from the server.
Sign the certificate on the server: On the Puppet server, list pending certs: puppet cert list. Then sign the agent’s cert: puppet cert sign <agent-fqdn> (or puppet cert sign --all to sign all pending).
10. Verify the Puppet agent
After the server has signed the agent’s certificate, run a test run on the agent:
| |
You should see output like:
| |
That means the agent successfully pulled the catalog from the server and applied it.
11. Create a simple manifest to deploy Nginx
Manifests live under /etc/puppetlabs/code/environments/<environment>/manifests. We use the production environment. Create the site manifest:
| |
Add the following (replace puppetmaster.citizix.com with your node’s FQDN if different):
| |
Save and exit. Then on the agent (same machine or another node that has this hostname in its cert), run:
| |
Puppet will fetch the catalog and apply it: Nginx is installed and the service is started and enabled. Example output:
| |
Check Nginx:
| |
You should see active (running). The Nginx web server was installed and configured by Puppet.
Frequently Asked Questions (FAQ)
What is Puppet Server?
Puppet Server is the central component that runs on the JVM. It compiles catalogs from Puppet code and data, serves them to agents, and hosts the certificate authority for agent certificates. Agents request catalogs and apply them on their nodes.
What port does Puppet use?
Agents connect to the server on TCP 8140. Ensure this port is open on the firewall and that the hostname used in puppet.conf resolves to the server.
How do I sign a Puppet agent certificate?
On the Puppet server, run puppet cert list to see pending requests, then puppet cert sign <agent-fqdn> to sign one agent, or puppet cert sign --all to sign all. The agent must have run at least once (e.g. sudo systemctl start puppet) so it has requested a cert.
Where are Puppet manifests stored?
Manifests live under /etc/puppetlabs/code/environments/<environment>/manifests/. The default environment is production. The main manifest is typically site.pp.
Conclusion
You installed Puppet 7 server and agent on Rocky Linux 8 (or AlmaLinux / CentOS 8): enabled the Puppet repo, configured hostname and puppet.conf, started and enabled puppetserver, opened port 8140, added Puppet to PATH, signed the agent certificate, and deployed Nginx with a simple manifest. For Puppet 7 on Rocky/AlmaLinux 9, see How to Install Puppet 7 Server on Rocky Linux/Alma Linux 9. For Ubuntu, see Puppet 7 on Ubuntu 22.04 or Ubuntu 20.04.