FreeIPA on Rocky Linux for a small VPS fleet
Run FreeIPA on Rocky Linux or AlmaLinux 9 for a few VPSes: DNS and PTR prerequisites, a private network firewall, client enrollment, HBAC, sudo and backups.
What FreeIPA on Rocky Linux gives a VPS fleet
FreeIPA on Rocky Linux gives a small VPS fleet one place to keep user accounts, passwords, SSH keys and sudo rights. You install one IdM (identity management) server and enroll each VPS as a client. After that, every login on every client is checked against that server. This guide covers Rocky Linux 9 and AlmaLinux 9, and notes where the 10 releases differ.
The FreeIPA project calls itself an integrated security information management solution. It combines 389 Directory Server, which holds the LDAP (lightweight directory access protocol) data, MIT Kerberos for login tickets, and the Dogtag certificate system as its own CA (certificate authority). DNS (domain name system) is optional and runs on BIND. The installers also set up NTP (network time protocol). On each client, SSSD (system security services daemon) talks to the server and caches what it learns.
Whether a central directory is the right tool at all is a separate question. Central Linux logins with LDAP or an SSH CA weighs that choice. This guide assumes you have picked FreeIPA, and it starts from a server prepared the way securing a new Rocky Linux server describes.
All commands here are for you to run on your own servers. FreeIPA is a group of cooperating services that needs a real host. The procedure below is built from Red Hat's RHEL 9 and RHEL 10 documentation and from the FreeIPA man pages. Rocky and Alma rebuild RHEL, so the same steps apply. Still, read each check's output before you move to the next step.
Which FreeIPA packages do Rocky and AlmaLinux 9 ship?
The packages are named ipa-*, not freeipa-*. In the AppStream repository of both Rocky Linux 9 and AlmaLinux 9 you will find these:
ipa-server: the server itself.ipa-server-dns: the add-on for integrated DNS.ipa-client: what each enrolled VPS needs.ipa-healthcheck: a checking tool for a running server.
As of November 2026, AppStream on Rocky and Alma 9 and 10 carries version 4.13.4 of the ipa-* packages. The FreeIPA website lists 4.13.5 as the newest upstream release. You get the distribution build, so upstream release notes can describe features your packages do not have yet.
No module stream is involved. On RHEL 8 the IdM packages were modules, and you had to enable a stream before installing. Red Hat's RHEL 9 notes say the IdM installation packages "have been demodularized", so on 9 you install them with a plain dnf install. Confirm what your mirror offers before you start:
dnf info ipa-server
dnf list ipa-server-dns ipa-clientThe Repository line should name appstream. Rocky and Alma use the same package names, so nothing in this guide changes between them. How Rocky Linux and AlmaLinux differ covers the places where they do.
What the server needs before you install
Several of these choices cannot be changed after the install. Make them first.
A permanent, lowercase FQDN
The server needs a fully qualified domain name (FQDN), such as ipa.idm.example.com. Red Hat's rules are strict. Pick a permanent name, because you cannot change it after the install. Use lowercase letters only. The output of hostname must not be localhost or localhost6. The name must resolve to a network address, never to a loopback address in the 127.x.x.x range.
Use a subdomain you own, such as idm.example.com, and keep it for IdM only. The installer's man page says the domain must not contain DNS records of any other LDAP or Kerberos based management system.
sudo hostnamectl set-hostname ipa.idm.example.com
hostnamehostname should print ipa.idm.example.com.
DNS records that match, forward and reverse
Red Hat asks for two things. The forward lookup (the A record, plus AAAA where you use IPv6) must resolve to the server's address. The reverse lookup (the PTR record) must return the server's hostname. Red Hat strongly recommends only one PTR record per IP address. Its check is dig +short -x on the address. If that prints a different name, or nothing, the reverse DNS is wrong.
On a VPS this collides with the private network rule in the next section. Your provider's panel sets the PTR record for the public address it gave you, and setting a reverse DNS PTR record on a VPS walks through that. But this guide puts IdM on a private tunnel address, and no provider panel sets a PTR record for 10.8.0.1. Integrated DNS solves this, as the install section explains: IdM then serves the A and PTR records for its own private address.
4 GB of RAM, 4 GB of swap, and no ballooning
Red Hat's RHEL 9 sizing for 10,000 users and 100 groups is at least 4 GB of RAM and 4 GB of swap. For 100,000 users and 50,000 groups it is at least 16 GB of RAM and 4 GB of swap. A small fleet has far fewer users than either. The smaller tier is still the lowest figure in Red Hat's table, so treat it as the floor. Red Hat also says that for larger deployments, more RAM helps more than more disk.
If your VPS has no swap, add a 4 GB swap file:
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap defaults 0 0' | sudo tee -a /etc/fstab
free -hThe Swap: line in free -h should now show about 4 GB.
Red Hat also says that in virtualized environments, memory ballooning must be disabled, or the complete RAM must be reserved for the IdM guest. Ballooning lets the host take memory back from a running guest. You cannot see or change that setting from inside a VPS. Ask your provider whether your plan's RAM is fully reserved before you put IdM on it.
IPv6 in the kernel
Red Hat says the IdM system must have the IPv6 protocol enabled in the kernel. IPv6 does not have to be enabled on the network. Check it:
sysctl net.ipv6.conf.all.disable_ipv6It should print 0. If it prints 1, find the file in /etc/sysctl.d/ that sets it and remove that line before you install.
A clock within five minutes
Kerberos authentication fails when a client's clock differs from the server's by more than five minutes. The IdM installers configure the chronyd NTP client for you, on the server and on each client. Check that time sync works before you install:
timedatectlLook for System clock synchronized: yes. The server installer has --ntp-server and --ntp-pool options to name a time source, and --no-ntp to leave chronyd alone.
Why Kerberos, LDAP and the web UI stay on a private network
Red Hat's port list for an IdM server is: HTTP and HTTPS on TCP 80 and 443, LDAP and LDAPS on TCP 389 and 636, Kerberos on TCP and UDP 88 and 464, and DNS on TCP and UDP 53 if you use integrated DNS. Red Hat also notes that ports 8080 and 8443 are used internally by pki-tomcat. Never open those two.
Red Hat's example opens these ports on the default zone. It does not say who should reach them. This site's rule is stricter: Kerberos, LDAP and the web UI belong on a private network, never on the public interface. Your IdM server holds every password hash and every sudo rule in the fleet. Nothing outside the fleet needs to talk to it, so nothing outside the fleet should be able to.
Build the private network first. Connecting two VPSes over a private network covers a WireGuard tunnel between your machines. This guide assumes the IdM server is 10.8.0.1 on interface wg0, and the first client is 10.8.0.2. Bring the tunnel up before the install, so the address exists on the box when the installer runs.
Now use a firewalld zone. A zone is a set of rules that applies to the interfaces bound to it. Bind wg0 to the predefined internal zone and open the IdM services only there. firewalld names them freeipa-4 and dns. The freeipa-4 service bundles http, https, kerberos, kpasswd, ldap and ldaps. It does not include DNS. Its description says to enable dns separately when the server provides DNS. If you are new to zones, read firewalld basics for a VPS first.
sudo firewall-cmd --get-services | tr ' ' '\n' | grep -i ipa
sudo firewall-cmd --permanent --zone=internal --add-interface=wg0
sudo firewall-cmd --permanent --zone=internal --add-service={freeipa-4,dns}
sudo firewall-cmd --reload
sudo firewall-cmd --get-active-zones
sudo firewall-cmd --zone=public --list-allThe first command should list freeipa-4 among the IdM services. --get-active-zones should show wg0 under internal and your public interface under public. The public zone's services: line must not include freeipa-4 or dns. If it does, an earlier change opened them there. Remove them from that zone with --remove-service.
If NetworkManager manages your WireGuard connection, firewalld's documentation says NetworkManager assigns the connection's interface to the zone set for that connection. If no zone is set there, the interface goes to the default zone. In that case, set the zone on the connection in NetworkManager as well.
How to install FreeIPA on Rocky Linux 9
Integrated DNS or external DNS?
With integrated DNS, IdM runs its own BIND server for your IdM domain. It creates the DNS SRV records at setup and keeps them updated. It can also manage reverse zones, so the PTR record for 10.8.0.1 exists without extra work. Red Hat is clear that IdM DNS is not meant to be a general-purpose DNS server, and some advanced DNS functions are not supported. You also need one forwarder choice for names outside your domain.
With external DNS, you keep your existing DNS service. The installer writes a file of SRV and TXT records, and you must add them to your DNS servers yourself, or the install is not complete. Red Hat also warns not to let DNS tools create PTR records for ipa-ca, because that can break later replica installs.
For a small fleet on a private network, pick integrated DNS. The reason is the PTR record. External DNS needs a DNS server you control that can answer A and PTR queries for private addresses, which is one more service to run. Integrated DNS is that server, and it only serves your IdM subdomain.
Run ipa-server-install
Install the server and the DNS add-on:
sudo dnf install ipa-server ipa-server-dnsYou can run sudo ipa-server-install interactively. Red Hat's guide shows it asking whether to configure integrated DNS (BIND), then for the server host name, the domain name, the Kerberos realm, the Directory Manager password, the IPA admin password, the NetBIOS domain name, and whether to configure chrony with an NTP server or pool. It then asks you to confirm. The realm and the names cannot be changed after the install.
The flag form below is easier to repeat and to review. It reads the two passwords into shell variables first, so they stay out of your shell history:
read -rsp 'Directory Manager password: ' DM_PW; echo
read -rsp 'IPA admin password: ' ADMIN_PW; echo
sudo ipa-server-install \
--setup-dns --auto-reverse --auto-forwarders \
--hostname=ipa.idm.example.com --ip-address=10.8.0.1 \
--domain=idm.example.com --realm=IDM.EXAMPLE.COM \
--ds-password="$DM_PW" --admin-password="$ADMIN_PW" \
--unattendedWhat each choice does:
--setup-dnscreates the DNS zone named by--domainand fills it with the service records IdM needs.--auto-reverselooks for reverse zones for the server's addresses, and creates them if none resolve. This is what gives10.8.0.1its PTR record.--auto-forwardersforwards outside names to the resolvers in/etc/resolv.conf. Use--forwarder=with a resolver address instead if you want a specific one. You must give at least one forwarder, unless you pass--no-forwarders, which uses the root DNS servers.--ip-addressis the tunnel address. Without--setup-dns, a mismatch between this and the address the host resolves to fails the install.--realmis the Kerberos realm. The man page strongly recommends the upper-case form of your primary DNS domain. A trust with Active Directory later is impossible without it.--ds-passwordis the Directory Manager password. Keep it at 63 characters or fewer, because longer passwords break the embedded CA install.
The install sets up several services, including a directory server and a CA, so it takes a while. If it fails, read /var/log/ipaserver-install.log, which is the installer's log.
Check the server
Get a Kerberos ticket as admin and ask the directory something:
kinit admin
klist
ipa user-find admin
sudo dnf install bind-utils
dig +short -x 10.8.0.1 @10.8.0.1
dig +short SRV _ldap._tcp.idm.example.com @10.8.0.1klist should show a ticket for admin@IDM.EXAMPLE.COM. ipa user-find admin should return the admin account. The reverse lookup should print ipa.idm.example.com., which means Red Hat's PTR check passes. The SRV query should name the same host. For a deeper check, run sudo dnf install ipa-healthcheck and then sudo ipa-healthcheck.
To open the web UI, browse to https://ipa.idm.example.com/ from a machine on the tunnel, with that name mapped to 10.8.0.1 in its hosts file. By default the web UI's certificate is issued by IdM's own CA, so a browser warns until that machine trusts the CA. Adding a CA to the trust store on Rocky and Alma covers that for Linux machines.
Enroll a client with ipa-client-install --mkhomedir
On each client VPS, set a static FQDN and make the server's name resolve over the tunnel. By default, ipa-client-install searches DNS for _ldap._tcp SRV records of the domain. This client still uses its normal resolver, which knows nothing about your IdM domain. So pass the domain, the server name and the realm on the command line:
sudo hostnamectl set-hostname app1.idm.example.com
echo '10.8.0.1 ipa.idm.example.com ipa' | sudo tee -a /etc/hosts
echo '10.8.0.2 app1.idm.example.com app1' | sudo tee -a /etc/hosts
sudo dnf install ipa-client
sudo ipa-client-install --mkhomedir \
--domain=idm.example.com --server=ipa.idm.example.com \
--realm=IDM.EXAMPLE.COMWithout --unattended the installer is interactive, and it asks for the credentials of a user who may enroll hosts. admin works. --mkhomedir configures PAM to create a user's home directory if it does not exist, so you never create home directories by hand on each box.
Red Hat's own example adds --enable-dns-updates, which tells SSSD to update DNS with this client's IP address. Leave it off here, because this client does not use IdM's DNS. If you point a client's resolver at 10.8.0.1 instead, SRV discovery works and you can drop the explicit domain, server and realm options.
The man page says the client must use a static hostname. hostnamectl set-hostname sets the static name, so it survives a reboot. The installer also configures the OpenSSH server unless you pass --no-sshd. Check what it set:
sudo sshd -T | grep -i authorizedkeyscommandA line that points at sss_ssh_authorizedkeys means SSH asks SSSD for public keys stored in IdM. That matters on a hardened VPS where password logins over SSH are off.
Add a user, one sudo rule and one HBAC rule
Run these on the server, or on any enrolled host, after kinit admin.
Create a user
ipa user-add alice --first=Alice --last=Ops --password
ipa user-mod alice --sshpubkey="ssh-ed25519 AAAA...your-key... alice@laptop"--password prompts you to set the user's password. --sshpubkey stores her SSH public key in the directory. On the client, id alice should now print a user ID and a group from IdM. If it prints no such user, check that the client reaches 10.8.0.1 over the tunnel and that the /etc/hosts lines are right.
One sudo rule
This follows Red Hat's example, with dnf in place of reboot. It lets alice run dnf as root on app1, and nothing else:
ipa sudocmd-add /usr/bin/dnf
ipa sudorule-add alice_dnf
ipa sudorule-add-allow-command alice_dnf --sudocmds '/usr/bin/dnf'
ipa sudorule-add-host alice_dnf --hosts app1.idm.example.com
ipa sudorule-add-user alice_dnf --users aliceAs alice on app1, run sudo -l. It should list (root) /usr/bin/dnf. Red Hat notes that changes can take a few minutes to reach the client, so an empty list right after you add the rule is not yet a failure.
One HBAC rule, then retire allow_all
HBAC (host-based access control) decides which users may use which services on which hosts. A new IdM install has a default rule named allow_all, which allows universal access to every host for every user. Red Hat says you must disable allow_all so that it does not override your own rules.
The order matters. Red Hat warns that if you disable allow_all before your own rules exist, access to all hosts is denied for all users. Keep a root session open on each client while you do this.
ipa hbacrule-add --hostcat=all ops_access
ipa hbacrule-add-user --users=alice ops_access
ipa hbacrule-add-service --hbacsvcs=sshd ops_access
ipa hbacrule-add-service --hbacsvcs=sudo ops_access
ipa hbactest --user=alice --host=app1.idm.example.com --service=sshd --rules=ops_access
ipa hbactest --user=alice --host=app1.idm.example.com --service=sudo --rules=ops_accessThe rule lists the sudo service as well as sshd. Red Hat's own hbactest example tests --service=sudo, which shows that HBAC is checked for sudo too. Add it, so the sudo rule from the last step keeps working once allow_all is gone.
When both tests report that access is granted, disable the default rule:
ipa hbacrule-disable allow_allNow open a new SSH session as alice on app1. It should work, and her home directory should appear on first login. From now on, an IdM user who is not in a rule gets no access to the enrolled hosts.
Back up with ipa-backup
ipa-backup writes to subdirectories of /var/lib/ipa/backup/. By default it makes a full backup in offline mode, which stops all IdM services while it runs. Schedule it for a quiet time.
sudo ipa-backup
sudo ipa-backup --data --online
sudo ls /var/lib/ipa/backup/--data backs up the data only, and --online keeps the services running while it does. --online requires --data. Add --logs to include the IdM log files, and --gpg to encrypt the backup. Full backups are named ipa-full- followed by the date and time in GMT.
Two limits from the man page decide how you use these backups. A backup cannot be restored on another host. A backup cannot be restored in a different version of IPA. So a backup protects a working server from bad changes. It does not help if the VPS itself is lost: a second IdM server, a replica, covers that case. Copy the backups off the box anyway, and take a fresh full backup after any update that changes the ipa-server version. If you would rather choose when that happens, pin the IdM packages with dnf versionlock and update them on purpose.
What changes on Rocky Linux 10 and AlmaLinux 10
The package names and the firewalld service names are the same on 10, and there is still no module stream. Red Hat's RHEL 10 documentation lists these changes for IdM. Rocky and Alma 10 rebuild RHEL 10, so expect the same. These points come from Red Hat's text, not from a Rocky or Alma page.
- DNSSEC (DNS security extensions) is enabled for integrated DNS and cannot be disabled.
- New installs use random serial numbers (RSNv3) for the IdM CA. You cannot turn this off, because RHEL 10 does not support sequential serial numbers.
- 389 Directory Server uses LMDB. BDB instances are no longer supported.
- The SSSD
filesprovider and enumeration are removed, and IdM no longer provides NIS.
Before you build on 10, read Red Hat's RHEL 10 "Considerations in adopting" chapter on Identity Management for the full list.
FAQ
Is the FreeIPA server package called freeipa-server or ipa-server on Rocky Linux 9?
It is ipa-server. Rocky Linux 9 and AlmaLinux 9 ship ipa-server, ipa-server-dns for integrated DNS, ipa-client, and ipa-healthcheck in AppStream. The packages are not named freeipa-*. Red Hat demodularized the IdM packages in RHEL 9, so you install them with dnf install and no module stream. Run dnf info ipa-server to see the version your mirror offers.
Why does a Kerberos login fail when the FreeIPA server looks healthy?
Check the clocks first. Kerberos authentication fails when a client's clock differs from the server's by more than five minutes. The IdM installers configure chronyd on the server and on each client, unless someone passed --no-ntp. Run timedatectl on both machines and look for System clock synchronized: yes.
Should the FreeIPA web UI and LDAP be reachable from the internet?
This site's advice is no. Red Hat lists the ports IdM uses but does not say who should reach them. The server holds every password hash and sudo rule in your fleet, and only your own machines need it. Bind your WireGuard interface to a firewalld zone such as internal, add the freeipa-4 and dns services there only, and keep ports 8080 and 8443 closed everywhere.
Can I restore an ipa-backup on a new VPS?
No. The ipa-backup man page says a backup cannot be restored on another host, or in a different version of IPA. A backup protects a working server from bad changes. To survive the loss of the VPS itself, run a second IdM server as a replica, and take a fresh backup after each update to the IdM packages.