NodexVPS
Deploy VPS
Back to All Guides
Getting Started15 min read•Updated 2026-11-09

AlmaLinux VPS Setup Guide

Prepare an AlmaLinux server for production with updates, EPEL, SELinux checks, firewalld and automatic patches.

AlmaLinux behaves like Red Hat Enterprise Linux, so this guide follows Enterprise Linux habits: leave SELinux on, use firewalld, and let dnf handle patching.

  • Works on: AlmaLinux 10, 9 and 8
  • Recommended server: 2 GB of RAM or more
  • You will need: an SSH client and the emailed root password
1

Choose your release

Pick AlmaLinux at checkout. Version 9 has the widest vendor support today, and 10 is the better choice for new projects whose software supports it. Check your vendor's list before choosing 8.

2

Log in and identify the system

Connect, then confirm the release and SELinux state.

ssh root@YOUR_SERVER_IP
cat /etc/almalinux-release
getenforce
3

Update the system

Install every available update, then reboot if a new kernel was included.

The needs-restarting command comes from the dnf-utils or yum-utils package. Install that package if it is missing.

dnf upgrade -y
dnf needs-restarting -r || systemctl reboot
4

Add the EPEL repository

EPEL holds thousands of extra packages. Many of them also need the CRB repository on version 9 and later.

On AlmaLinux 8, this repository is called powertools, so use --set-enabled powertools instead.

dnf install epel-release dnf-plugins-core -y
dnf config-manager --set-enabled crb
5

Create your admin user

Membership of the wheel group gives sudo access.

useradd -m -G wheel deploy
passwd deploy

# on your own computer
ssh-copy-id deploy@YOUR_SERVER_IP
6

Harden SSH

The service is called sshd on this family of systems.

Confirm your key login works in a second terminal before you close this one. On version 8, this folder is not read, so set PermitRootLogin no and PasswordAuthentication no in /etc/ssh/sshd_config instead.

sudo tee /etc/ssh/sshd_config.d/10-hardening.conf > /dev/null <<'EOF'
PermitRootLogin no
PasswordAuthentication no
EOF

sudo sshd -t && sudo systemctl restart sshd
7

Enable firewalld

firewalld works with named services, so you rarely need to remember port numbers.

sudo dnf install firewalld -y
sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --reload
8

Work with SELinux, not against it

SELinux is the feature most people are tempted to turn off. Read what it blocked instead, and fix that one thing. For example, a web server that needs to connect to a backend needs one setting.

sudo ausearch -m avc -ts recent
sudo setsebool -P httpd_can_network_connect 1
9

Automate security updates

dnf-automatic only downloads updates unless you tell it to apply them.

sudo dnf install dnf-automatic -y
sudo sed -i 's/^apply_updates.*/apply_updates = yes/' /etc/dnf/automatic.conf
sudo systemctl enable --now dnf-automatic.timer

Get a server for this guide

AlmaLinux OS plans run everything in this guide, from $10.99/mo.

See AlmaLinux OS plans

AlmaLinux VPS Setup Guide: Frequently Asked Questions

Quick answers to common questions.

Why are my sshd_config.d settings ignored on AlmaLinux 8?

On AlmaLinux 8 the SSH server does not read files in /etc/ssh/sshd_config.d/, so a hardening file placed there has no effect. Set PermitRootLogin no and PasswordAuthentication no directly in /etc/ssh/sshd_config instead, check the file with sshd -t and restart sshd. AlmaLinux 9 and 10 read that folder. Confirm your key login works in a second terminal before you close your session.

How do I fix an SELinux denial on AlmaLinux?

Read what SELinux blocked with sudo ausearch -m avc -ts recent, then fix that one thing instead of turning SELinux off. For example, a web server that must connect to a backend needs only setsebool -P httpd_can_network_connect 1. Keeping SELinux enforcing is one of the Enterprise Linux habits this AlmaLinux guide follows.

What is the wheel group on AlmaLinux and how does it grant sudo?

The wheel group is the administrators' group on AlmaLinux and other Enterprise Linux systems: its members can run commands with sudo, because the default sudoers file allows that group. Create your admin user and add it in one step with useradd -m -G wheel deploy, set its password with passwd deploy, then copy your SSH key from your own computer with ssh-copy-id. For an existing user, run usermod -aG wheel followed by the username.

How do I turn on automatic updates on AlmaLinux?

Install dnf-automatic, set apply_updates = yes in /etc/dnf/automatic.conf and enable dnf-automatic.timer with systemctl. Without that setting, dnf-automatic only downloads updates on AlmaLinux and never installs them. Once the timer is on, security fixes keep arriving on your server without you having to log in.

How do I disable root SSH login on AlmaLinux?

Create an admin user in the wheel group and copy your SSH key to it first. Then put PermitRootLogin no and PasswordAuthentication no in a file under /etc/ssh/sshd_config.d/, test with sshd -t and restart sshd. On AlmaLinux 8 that folder is not read, so add both lines to /etc/ssh/sshd_config, and confirm key login works in a second terminal.

How do I check if AlmaLinux needs a reboot after updates?

Run dnf needs-restarting -r after dnf upgrade -y. It reports whether a new kernel or core library needs a reboot, and the guide's command restarts the AlmaLinux server only when one is required. The command comes from the dnf-utils or yum-utils package, so install that package if it is missing.

How do I check which AlmaLinux version my VPS runs?

Log in over SSH and run cat /etc/almalinux-release to see the exact AlmaLinux release, and getenforce to confirm SELinux is enforcing. Check this before following the rest of the guide, because a few steps differ on version 8, such as the powertools repository name and where SSH settings go.

How much RAM is recommended for an AlmaLinux VPS?

This AlmaLinux setup guide recommends a server with 2 GB of RAM or more, and its steps work on AlmaLinux 10, 9 and 8. Beyond the server, all you need is an SSH client and the root password we email when the server is ready.

Start Your NodexVPS Today

Save 50% with yearly billing.