Salt gives you one control node, the master, and a small agent, the minion, on every machine you manage. We rebuilt this walkthrough from scratch in November 2026 because the old instructions pointed at a package repository that no longer exists. The lab ran a master on Ubuntu 26.04 and a minion on Ubuntu 24.04 LTS with Salt 3008.5 (the current LTS release), and every command and output below comes from that run. The same steps work in either direction across the two supported Ubuntu LTS lines.
Two things changed since most Salt tutorials were written, and both affect the commands that follow:
- One repository instead of many: the per release repositories were retired in favor of a single Broadcom hosted repository, so old repo URLs now fail.
- Onedir packaging: Salt 3006 onward ships as a package that carries its own Python, which is why the daemons run from
/opt/saltstack/and why some older commands behave differently.
If the bigger picture matters more than the install right now, our Ansible vs Chef vs Puppet vs Salt comparison covers where each tool wins. This guide stays on getting a master and a minion talking.
How a Salt master and minion work together
The master is the brain. It holds the configuration states, sends commands over a message queue, and collects the results. Minions connect out to the master, which means you never need to open inbound ports on the machines being managed. Two TCP ports carry all of it, and the split matters when you write firewall rules:
- Publish port 4505: the master pushes commands out to every connected minion over ZeroMQ.
- Return port 4506: minions send their results, file transfers and authentication requests back to the master here.
Trust is established in both directions with RSA keys. The minion must be able to verify the master before it sends its own key, and the master operator must verify the key the minion presents before accepting it. Both checks matter, and one of them, the master fingerprint, has a genuine trap on Salt 3008 that we document in step 7.
What you need
We tested on two servers, one for each role, but one machine can run both daemons if you are just experimenting. Splitting them later is easy, since every setting lives in a drop in file that copies over unchanged. Before you start:
- Two Ubuntu machines: 26.04 or 24.04 LTS in any mix, with sudo access. Our master had 2 vCPU and 4 GB RAM, a minion comfortably runs on less.
- Network reachability: the minions must reach the master on TCP 4505 and 4506. On the same private network this works out of the box.
- Root package access: the Salt repository is added with apt, so no extra tools are required.
The examples use 10.0.1.50 as the address of the master and 10.0.1.51 for the minion. Replace both with addresses from your own network, and keep them consistent in every file the walkthrough edits, since a single wrong line here produces the resolution failure covered at the end.
Step 1: Add the Salt Project repository
Both servers need the repository, master and minions alike. The current method from the official Salt install guide downloads the signing key into the apt keyrings directory and drops a signed sources file, so run this on every machine that will run Salt:
sudo mkdir -m 755 -p /etc/apt/keyrings
curl -fsSL https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public | sudo gpg --dearmor | sudo tee /etc/apt/keyrings/salt-archive-keyring.pgp > /dev/null
curl -fsSL https://github.com/saltstack/salt-install-guide/releases/latest/download/salt.sources | sudo tee /etc/apt/sources.list.d/salt.sources
Refresh the package lists, then confirm apt can see the packages. The candidate version tells you which Salt release the repository currently serves, and that number is worth writing down because it decides which major release every machine in the fleet converges on:
sudo apt update
apt-cache policy salt-master
Our lab master resolved to 3008.5 from the stable suite, and the same repository serves the minion package, so versions cannot drift between the two roles:

The salt.sources file tracks the stable suite, which serves the latest LTS and STS releases. If your organization prefers to freeze on an LTS, the install guide documents an apt pin file that holds upgrades to a chosen major version, worth adding before the first install so a later apt upgrade never jumps you across a major release.
Step 2: Install the Salt master
On the machine that will control the fleet, install the master package. It pulls in the same onedir runtime the minion uses, so the disk footprint ends up similar on both roles:
sudo apt-get install -y salt-master
The package service starts the daemon immediately. Confirm the version and check that both ZeroMQ listeners came up, because a master that installs cleanly but never binds its ports is usually sitting on a config error that only shows on restart:
salt-master --version
systemctl is-active salt-master
sudo ss -tlnp | grep -E ":(4505|4506)"
Two listeners on 4505 and 4506 mean the master is up. Note the binary path in the output, /opt/saltstack/, which is the onedir layout at work:

Because onedir bundles its own Python, third party modules for Salt no longer install into the system Python. Use salt-pip when a state or returner needs an extra library. For the base install nothing extra is required.
Step 3: Install the Salt minions
On every machine you want to manage, install the minion package. The lab minion ran Ubuntu 24.04 LTS, and the same command applies on 26.04:
sudo apt-get install -y salt-minion
The minion service starts on its own and begins retrying against a default master address that is not set yet, so the connection errors in its log at this stage are expected. Those retries keep going every few seconds, and they start succeeding as soon as step 6 points the minion at the real master. Check the version:
salt-minion --version
systemctl is-active salt-minion
Both binaries report the same 3008.5 build, which is the pairing we kept throughout the lab:

Keep the master and minion versions in step with each other. Mixed versions usually work, but the install guide asks for masters to be upgraded first and warns that minions newer than their masters are not guaranteed to function as expected. Pin both to the same release when installs get automated, because an unattended upgrade on one side and not the other is how fleets end up mixed in the first place.
Step 4: Set the master’s address and ports
Newer Salt releases prefer drop in configuration under /etc/salt/master.d/ over editing the shipped /etc/salt/master file, and it is a habit worth keeping because package upgrades never touch your drop ins. Create the directory and add a network file:
sudo mkdir -p /etc/salt/master.d
sudo vim /etc/salt/master.d/network.conf
Add the following three lines. Explicit beats implicit here, because these are the same port numbers the firewall step opens next, and a master silently moved off a documented port is a debugging session waiting to happen:
interface: 0.0.0.0
publish_port: 4505
ret_port: 4506
The interface line binds the master to all addresses, which is what you want when minions arrive from several networks. While you are here, make the safe default explicit. Salt ships with auto_accept off, and writing the line down keeps a future config cleanup from silently turning key acceptance automatic:
sudo vim /etc/salt/master.d/security.conf
Add the following configuration. This single line turns every new minion key into a decision a human makes on the master, which is the right posture before the fleet grows past a test machine:
auto_accept: False
Restart the master and recheck the listeners. A config typo in these files is the most common reason a master comes back without its ports, and when that happens the journal names the offending file and line:
sudo systemctl restart salt-master
sudo ss -tlnp | grep -E ":(4505|4506)"
With both ports listening again, the master side of the setup is complete. The firewall comes next, because these listeners mean nothing to a minion that cannot route to them.
Step 5: Open the firewall on the master
If the master runs ufw, minions outside its local network cannot connect until you allow the two Salt ports. Allow SSH first so the enable step cannot cut your own session, then the Salt ports:
sudo ufw allow OpenSSH
sudo ufw allow 4505/tcp
sudo ufw allow 4506/tcp
sudo ufw --force enable
The status listing should show both ports allowed in, which it did in our lab. This is also the moment to check that OpenSSH stayed in the list, since a firewall that locks the admin out of the master is the classic self inflicted outage:

Cloud hosts add a second layer. On AWS, GCP or Azure the security group or firewall at the platform level must also pass TCP 4505 and 4506 from your minions, otherwise ufw status looks perfect and the minions still time out. Our full UFW firewall commands with examples reference covers the rule syntax in depth.
Step 6: Point each minion at the master
On the minion, add a drop in that names the master. Use an address the minion can route, an internal IP on a private network or a hostname. A hostname survives the master moving to new hardware, but only if DNS actually resolves from the minion, so test that with a plain ping before committing to it:
sudo mkdir -p /etc/salt/minion.d
sudo vim /etc/salt/minion.d/master.conf
Add the following configuration. An IP works everywhere, a DNS name reads better as the fleet grows, and both end up in the same one line file:
master: 10.0.1.50
Give the minion a name that reads clearly in the key list. It defaults to the hostname, which is often fine, but a role based name scales better and makes target patterns such as "web*" meaningful later:
sudo vim /etc/salt/minion.d/id.conf
Add the following configuration. The id gets baked into the minion’s key and its cached state, so pick a name worth keeping, because renaming later means removing and reaccepting the key:
id: web01
Restart the minion. Within a few seconds it generates its key pair and starts polling the master, and the key shows up in the pending list on the master even though nothing has been accepted yet. That polling state is harmless and self healing, the minion keeps retrying until the master side is ready:
sudo systemctl restart salt-minion
Leave the minion running in that polling state. The next step verifies the master’s identity before we let the pair fully trust each other, and nothing breaks if the minion polls for an hour in the meantime.
Step 7: Pin the master’s fingerprint on the minion
This is the check most tutorials skip, and on Salt 3008 the salt-key routes for it mislead. Salt’s minion configuration reference points at salt-key -F master as the way to read the master’s fingerprint. We ran the salt-key routes on 3008.5 and none of them produce a value the minion accepts: salt-key -f master.pub returns an empty result, and the fingerprint printed by salt-key -L or salt-key --finger-all does not match what the minion verifies against, because the two code paths hash the key file differently. That mismatch cost us a long debugging loop in the lab. It is the reason this step exists at all.
A value that actually works comes from the minion side, after its first contact. Once the minion has reached the master, it has cached the public key of the master, and its fingerprint reads straight out of that cache:
sudo salt-call --local key.finger_master
This is the exact output from our lab, and it is the string the minion compares its master_finger setting against. Anything else on this line, including the values salt-key prints on the master, produces a rejection:
local:
2c:79:ef:48:2c:a0:62:29:10:a6:b4:c4:31:f0:42:4b:02:45:68:96:fb:c1:b2:10:2c:ff:b5:c6:f7:8d:25:c8
Compare this fingerprint with what you expect. If you have out of band access to the master, for example through the same SSH session you are already using, spot check that the value did not change after a master reinstall, since a changed fingerprint is the classic man in the middle signal. Then pin it in the minion’s master drop in. Pinning upgrades this from a one time check into a standing guard, because the minion refuses any later connection whose master key no longer matches:
sudo vim /etc/salt/minion.d/master.conf
Add the following configuration. The fingerprint line is what turns the earlier verification into a permanent check on every future connection:
master: 10.0.1.50
master_finger: 2c:79:ef:48:2c:a0:62:29:10:a6:b4:c4:31:f0:42:4b:02:45:68:96:fb:c1:b2:10:2c:ff:b5:c6:f7:8d:25:c8
Restart the minion again. From now on it refuses any master whose key does not match the pinned fingerprint. When we deliberately pinned the wrong value in the lab, the minion log rejected the connection in plain words, which is exactly the behavior you want from this setting.
Step 8: Accept the minion key on the master
Back on the master, the polling minion should now appear as unaccepted. Listing the keys shows four buckets, and only the unaccepted bucket matters right now. The other three exist for keys the master refused or an operator rejected, and they stay empty in a healthy first install:
sudo salt-key -L
Our lab master showed web01 waiting under Unaccepted Keys. Accept it by name rather than sweeping everything in with a blanket accept, since that keeps a typo or an impostor key from slipping through on a busy day:
sudo salt-key -a web01 -y
The confirmation line moves the key into the accepted bucket, and a repeat listing shows web01 sitting under Accepted Keys with nothing left pending:
Key for minion web01 accepted.
The same accept flow is shown here from the master side, listing before and after:

Accepting a key is an identity decision, not a formality. Anyone who can reach the master on 4506 can generate a pending key, which is why auto_accept: False from step 4 and a quick look at the name before accepting are worth the five seconds.
Step 9: Run your first commands
The canonical first test asks the minion to answer on the command bus. The target "web01" matches the id you set in step 6, and a glob pattern such as "*" would address every accepted minion at once:
sudo salt "web01" test.ping --timeout=20
A True response means the whole chain works, key exchange, master fingerprint, firewall and the command bus. If it times out instead, the three troubleshooting entries at the end cover the causes in the order we hit them in the lab:
web01:
True
Remote execution then works like a shell with receipts. The cmd.run function returns the output of any command the minion runs as root, and every call is matched to the minion that answered it, so results never get mixed up across the fleet:
sudo salt "web01" cmd.run "uptime"
Our minion had been up for eleven minutes at that point, and the load average in the response doubles as a free health check on every machine this command reaches:

Beyond cmd.run, the execution modules cover packages, services, users and files, and disk.usage is a handy read only one to try next. Anything scripted over SSH today has a Salt module that returns structured data instead of text left to parse.
Step 10: Install nginx with a state file
Commands are how you fix a machine today. States are how you define what the machine should look like every day. The master reads state files from /srv/salt/ by default, so create the directory and a first state:
sudo mkdir -p /srv/salt
sudo vim /srv/salt/nginx.sls
Add the following state, which installs the package and keeps the service running. The two declarations are independent, so the service check can pass on its own even when the package is already installed:
install_nginx:
pkg.installed:
- name: nginx
nginx_running:
service.running:
- name: nginx
- enable: True
Apply the state to the minion by matching the file name without its extension, which is the same convention the state system uses for includes and orchestration later:
sudo salt "web01" state.apply nginx
On our lab the first run installed nginx 1.24 and brought the service up, and the summary line reports one change. The duration column is worth a glance too, since a package state that suddenly takes minutes on every run usually means an apt lock contention problem upstream:

Run the same apply a second time and the summary reports Succeeded: 2 with no changes and a run time under a tenth of a second, because both states are already satisfied. That idempotence is the property that makes states safe to re apply on a schedule or from a pipeline, and it is the habit to carry into every state you write. For a deeper example of the same pattern with a full PHP stack, see how to install nginx with PHP FPM on Ubuntu.
Alternative: Install Salt with the bootstrap script
The repository method is the one to standardize on, but the bootstrap script earns its place in two situations, machines with no package repository access and quick throwaway environments. We tested the current script on a fresh Ubuntu 24.04 machine. Download it and record its checksum so the hash in your shell history matches what actually ran:
curl -fsSL -o /tmp/bootstrap-salt.sh https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
sha256sum /tmp/bootstrap-salt.sh
On the machine that will be a master, run it with flags that install the master and skip the minion. The -P flag allows the pip based packages some distributions need:
sudo sh /tmp/bootstrap-salt.sh -M -N -P
A script run this way detects the distribution, wires up the same Broadcom repository the manual method uses, installs the onedir packages and restarts the daemons:

On a minion only machine, run the same script with just -P, which installs the minion and not the master. We verified that variant in the same session, and the resulting minion answered a local test.ping immediately. Nothing about the flow changes. From there the configuration steps above apply unchanged, since the script lands the same packages and the same drop in directories.
Troubleshooting
Three failure modes cover almost every broken first connection, and all three showed up in our lab at one point or another. Each one prints a message worth searching for, and each has a short path back to working.
Minion did not return. [No response]
The master sent the command and nothing came back, which points at the return path or at a minion that never finished connecting. Check the firewall first, because TCP 4506 is the port results travel on and it is the one most often forgotten. Then restart the minion and read its log, since a key that was accepted while the minion was disconnected only takes effect after the next authentication cycle. Both fixes take under a minute.
Does not match the authenticating master’s key
The minion rejected the master because the pinned fingerprint is wrong. This is the error our lab produced with a deliberately bad master_finger value, and the message prints the fingerprint the minion computed for the master it actually reached. Copy that value only if you have verified the master out of band, update master.conf, and restart the minion. Never paste a fingerprint you cannot vouch for, the check exists to catch exactly that situation.
Master address could not be resolved
The minion log shows Master address: 'salt' could not be resolved when the drop in from step 6 was never written, or was written while the service held its old configuration. The default address is the hostname salt, which only works if you have DNS pointing at the master. Confirm the file exists with the master: line, then restart salt-minion and watch the log clear.
From here the fleet grows one machine at a time. Each new minion needs the repository from step 1, the package from step 3, and the two drop in files from step 6, then one salt-key -a on the master. When that loop starts feeling repetitive for more than a handful of machines, states in /srv/salt/ replace the manual work entirely, and that is the point where Salt starts paying for its own setup.