Operating System CentOS

How to Install Salt (SaltStack) on AlmaLinux 9 or Rocky Linux 9

Install a Salt master and minion on the RHEL 9 family from the Salt Project repository, open firewalld correctly and accept the minion key safely.

This guide installs Salt (formerly SaltStack) on AlmaLinux 9, Rocky Linux 9 or CentOS Stream 9 from the Salt Project's own RPM repository. You set up one master and one minion, open the right ports in firewalld, verify and accept the minion's key and run a first command. CentOS 7 reached end of life in June 2024 and is not on Salt's list of supported systems; RHEL 9, AlmaLinux 9, Rocky Linux 9 and CentOS Stream 9 are, and the commands below are the same on all of them.

Older tutorials install Salt from EPEL or from repo.saltstack.com. Neither is current: the project now publishes self-contained "onedir" packages, which bundle their own Python, from a repository hosted by Broadcom.

Requirements

  • Two servers running a RHEL 9 family distribution: a master (203.0.113.10 in the examples) and a minion (203.0.113.20). Use private addresses instead if both servers share a private network.
  • A user with sudo rights on both.
  • TCP ports 4505 and 4506 on the master reachable from the minion. Minions always initiate the connection, so they need no inbound ports.

Step 1: Add the Salt repository (both servers)

Update the system, then download the repository definition published by the Salt Project and refresh the metadata:

sudo dnf update -y
curl -fsSL https://github.com/saltstack/salt-install-guide/releases/latest/download/salt.repo | sudo tee /etc/yum.repos.d/salt.repo
sudo dnf clean expire-cache

The file defines several repositories, one per release line. The one enabled by default provides Salt 3008 LTS, the line the project recommends for production. Confirm which is active:

sudo dnf repolist enabled | grep -i salt

If EPEL is enabled on your servers, it may also offer an older salt package. The Salt repository file sets a higher priority for itself, so dnf prefers the Salt Project's packages.

Step 2: Install and start the master

On the master server:

sudo dnf install -y salt-master
sudo systemctl enable --now salt-master

The master listens on all interfaces by default. To bind it to one address, for instance a private network interface, add a drop-in file and restart the service:

echo 'interface: 203.0.113.10' | sudo tee /etc/salt/master.d/network.conf
sudo systemctl restart salt-master

Step 3: Open the master's ports in firewalld

Port 4505 publishes jobs to minions and port 4506 receives their returns and serves files. Allow only your minions to connect. For a single minion address:

sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.20" port port="4505-4506" protocol="tcp" accept'
sudo firewall-cmd --reload

For a whole private subnet, use it as the source address (for example 10.0.0.0/24). Avoid opening the ports to everyone with a plain --add-port: a master reachable from the whole internet is an unnecessary risk.

Now print the master's public key fingerprint. You need the master.pub value for the minion's configuration:

sudo salt-key -F master

Step 4: Install and configure the minion

On the minion server (after Step 1):

sudo dnf install -y salt-minion

Tell the minion where the master is, give it an ID, and pin the master's fingerprint so it will not accept a different master. Replace the fingerprint with the master.pub line from Step 3:

echo 'master: 203.0.113.10' | sudo tee /etc/salt/minion.d/master.conf
echo 'id: minion1' | sudo tee /etc/salt/minion.d/id.conf
echo "master_finger: 'aa:bb:cc:...'" | sudo tee /etc/salt/minion.d/finger.conf
sudo systemctl enable --now salt-minion

Without an id setting, the minion identifies itself by its host name. A DNS name works in place of the master's IP address.

Step 5: Accept the minion's key on the master

The minion sends its public key to the master on first start and waits. On the master, list the keys:

sudo salt-key -L

minion1 appears under Unaccepted Keys. Compare its fingerprint on both sides before you accept it. On the minion:

sudo salt-call --local key.finger

On the master:

sudo salt-key --finger minion1

If the two values match, accept the key:

sudo salt-key -a minion1

Step 6: Verify the connection

From the master, ask the minion for its Salt version and run a shell command:

sudo salt 'minion1' test.version
sudo salt '*' cmd.run 'cat /etc/redhat-release'
sudo salt -G 'os_family:RedHat' pkg.version salt-minion

A reply to the first command proves that the master can publish to the minion and receive its return. Repeat Steps 1, 4 and 5 for each further minion, and add its address to the firewall rule.

Maintenance

Upgrades and version pinning

sudo dnf upgrade updates Salt within the enabled release line. If you want Salt to change only when you decide, lock the installed packages with the versionlock plugin:

sudo dnf install -y 'dnf-command(versionlock)'
sudo dnf versionlock add salt salt-master salt-minion

Lock only the packages installed on that server; remove the lock with sudo dnf versionlock delete before a planned upgrade. To follow a different release line, switch repositories. For example, to stay on the previous LTS:

sudo dnf config-manager --set-disable salt-repo-*
sudo dnf config-manager --set-enabled salt-repo-3006-lts

Keep the master and its minions on the same major version, and upgrade the master first.

Logs and troubleshooting

  • Logs are in /var/log/salt/master and /var/log/salt/minion; sudo journalctl -u salt-minion shows service start-up errors.
  • If the minion never appears in salt-key -L, test the path from the minion with curl -v telnet://203.0.113.10:4506. A timeout points at firewalld on the master or at a firewall in your provider's control panel.
  • If the minion log reports that the master's key does not match, the master_finger value is wrong or the master was reinstalled. Correct the value, and if the master's key really changed, delete /etc/salt/pki/minion/minion_master.pub on the minion and restart it.
  • To run a minion in the foreground with debug output: sudo systemctl stop salt-minion, then sudo salt-minion -l debug.

The Salt install guide for RPM-based systems lists the other packages in the repository, such as salt-ssh, salt-api and salt-cloud.

Frequently asked questions

Does Salt work with SELinux in enforcing mode?

The packages install and run on a default RHEL 9 family system with SELinux enforcing; you do not need to disable it to follow this guide. If a state later fails with a permission error that file modes do not explain, look for denials with sudo ausearch -m avc -ts recent before changing the SELinux mode.

Which Salt release line should I install?

Salt 3008 is the current LTS line, released in May 2026, and is what the repository enables by default. Salt 3006, the previous LTS, receives only security and critical fixes until June 2027, so use it only when existing minions require it.

Can the master also be a minion?

Yes. Install salt-minion on the master, point it at 127.0.0.1 (or the address the master is bound to) and accept its key like any other. That lets you manage the master's own configuration with the same states as the rest of your servers.

How do I remove a server from Salt?

On the master, delete its key with sudo salt-key -d minion1. On the server itself, stop and remove the agent with sudo systemctl disable --now salt-minion and sudo dnf remove salt-minion salt.

Share story:

Continue reading other guides on How VPS.