Puppet is a configuration management tool that uses a declarative language to describe system state. It uses an agent–server (master) 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 Ubuntu 22.04 LTS (Jammy), 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 and set hostname (and
/etc/hosts) - Add the Puppet 7 APT repo for Ubuntu 22.04 and install
puppetserverandpuppet-agent - Configure
puppet.confand memory for Puppet server, then start and enable services - Open port 8140 (ufw or firewalld), add Puppet binaries to
PATH, and run the agent (including signing the certificate) - Create a simple manifest to install and enable Nginx and verify with
puppet agent -t
Related: Puppet 8 on Rocky Linux/AlmaLinux 9 · Puppet 7 on Ubuntu 20.04 · Puppet 7 on Rocky Linux/CentOS 8 · Ansible on Rocky Linux/CentOS 8
Prerequisites
- One or two machines running Ubuntu 22.04 LTS (one for server, optionally one for agent).
- Root or sudo access.
- Internet access to install packages and the Puppet APT 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. Install Puppet Server
- 4. Configure Puppet master and agent
- 5. Start and enable Puppet server
- 6. Open port 8140 on the firewall
- 7. Add Puppet binaries to PATH
- 8. Start the Puppet agent
- 9. Verify the Puppet agent
- 10. 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:
| |
Optional: verify resolution with ping puppetmaster (or your short name).
3. Install Puppet Server
Add the Puppet 7 APT repository for Ubuntu 22.04 (Jammy), then install the puppetserver package:
| |
4. Configure Puppet master and agent
Memory for Puppet Server: On Ubuntu, the config file is /etc/default/puppetserver. Edit it 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:
| |
5. 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: puppetserver -v (e.g. puppetserver version: 7.9.0).
6. Open port 8140 on the firewall
Agents connect to the server on TCP 8140. On Ubuntu, ufw is the default firewall. Open the port and reload:
| |
If you use firewalld instead: sudo firewall-cmd --add-port=8140/tcp --permanent and sudo firewall-cmd --reload.
7. 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:
| |
8. 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 the status using this command:
| |
9. 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.
10. 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, run:
| |
Puppet will fetch the catalog and apply it: Nginx is installed and the service is started and enabled. You can also validate and apply locally with puppet parser validate site.pp and puppet apply site.pp if you’re on the same host. 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.
What port does Puppet use?
Agents connect to the server on TCP 8140. Ensure this port is open (e.g. with ufw allow 8140/tcp on Ubuntu) and that the hostname 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 so it has requested a cert.
Where are Puppet manifests stored on Ubuntu?
Manifests live under /etc/puppetlabs/code/environments/<environment>/manifests/. The default environment is production; the main manifest is typically site.pp. On Ubuntu, Puppet Server uses the same paths as on other platforms.
Which Puppet repo do I use for Ubuntu 22.04?
Use the Jammy (22.04) package: puppet7-release-jammy.deb. For Ubuntu 20.04 (Focal), use puppet7-release-focal.deb.
Conclusion
You installed Puppet 7 server and agent on Ubuntu 22.04 LTS: added the Puppet 7 APT repo (Jammy), configured hostname and puppet.conf, started and enabled puppetserver, opened port 8140 (ufw), added Puppet to PATH, signed the agent certificate, and deployed Nginx with a simple manifest. For Puppet 7 on Ubuntu 20.04, see How to Install and Configure Puppet 7 Server on Ubuntu 20.04. For Rocky Linux / AlmaLinux, see Puppet 7 on Rocky/CentOS 8 or Puppet 8 on Rocky/AlmaLinux 9.