AlmaLinux
Package management, EPEL, updates, and firewall setup on an AlmaLinux VPS.
Our AlmaLinux image is the official AlmaLinux Generic Cloud image, provisioned with cloud-init. AlmaLinux is binary-compatible with Red Hat Enterprise Linux, so most RHEL documentation and software applies to it as well. For help deciding whether AlmaLinux is right for you, see Choosing a Linux distribution.
What’s in the image
- Packages: a minimal AlmaLinux install with
dnf, OpenSSH, andcloud-init. - Networking: configured by
cloud-initat boot. See VPS networking for how your addresses are assigned. - Firewall: the cloud image doesn’t ship with an active firewall. See Set up a firewall.
- SELinux: enabled and enforcing. Some changes, like moving SSH to a different port, need an SELinux policy update as well.
To check which AlmaLinux release you’re running:
cat /etc/almalinux-releaseInstall packages
AlmaLinux uses dnf to install packages:
sudo dnf install htopEnable EPEL
AlmaLinux’s own repositories are smaller than Fedora’s or Debian’s. Many common packages, such as htop and fail2ban, are in EPEL (Extra Packages for Enterprise Linux). To enable it, along with the CRB repository that some EPEL packages depend on, run:
sudo dnf install epel-release dnf-plugins-core
sudo dnf config-manager --set-enabled crbUpdate your system
To install the latest updates:
sudo dnf upgrade --refreshReboot if the update installed a new kernel. Minor releases, such as 10.0 to 10.1, are delivered as normal updates, so you don’t need to do anything special to move between them.
Automatic updates
To install updates automatically, install dnf-automatic:
sudo dnf install dnf-automaticOpen /etc/dnf/automatic.conf and set apply_updates = yes in the [commands] section so updates are applied, not just downloaded. Then, enable the timer:
sudo systemctl enable --now dnf-automatic.timerMajor releases
Each major AlmaLinux release, such as AlmaLinux 10, is supported for about 10 years. Upgrading between major releases in place isn’t recommended. When your release nears the end of its support, we recommend creating a new VPS on the current release and moving your applications over. If you need an in-place upgrade, see AlmaLinux’s ELevate project.
Set up a firewall
AlmaLinux uses firewalld, the same as Fedora. Our hardening guide walks through installing and configuring it. Follow the Fedora instructions.
Next steps
Our non-root user and hardening guides apply to AlmaLinux. Follow the Fedora instructions in each. Install fail2ban from EPEL.