How to Get Started with AlmaLinux/Rocky Linux on a VPS

This guide covers the essential first steps after deploying a new AlmaLinux or Rocky Linux VPS — connecting, updating, and creating a secure administrative user, adapted for the RHEL-family workflow.

Prerequisites

  • An AlmaLinux 9 or Rocky Linux 9 VPS
  • Root credentials or SSH key provided by your hosting provider

Step 1 — Connect via SSH

ssh root@YOUR_SERVER_IP

Step 2 — Update the System

sudo dnf update -y

Unlike Ubuntu/Debian's two-step apt update && apt upgrade, dnf update both refreshes package metadata and installs updates in one command.

Step 3 — Create a Sudo User

useradd deploy
passwd deploy
usermod -aG wheel deploy

The wheel group is the RHEL-family equivalent of Ubuntu/Debian's sudo group.

Step 4 — Verify Sudo Access

su - deploy
sudo whoami

Expected output: root

Step 5 — Set Up SSH Key Authentication

From your local machine:

ssh-copy-id deploy@YOUR_SERVER_IP

Step 6 — Check firewalld Status

AlmaLinux/Rocky Linux uses firewalld by default, not UFW:

sudo firewall-cmd --state
sudo firewall-cmd --list-all

See How to Configure firewalld on AlmaLinux/Rocky Linux for full configuration detail.

Step 7 — Check SELinux Status

getenforce

SELinux is enabled by default on AlmaLinux/Rocky Linux — a significant difference from Ubuntu/Debian's AppArmor-or-nothing default. See Understanding SELinux Basics on AlmaLinux/Rocky Linux before disabling it, since it provides meaningful additional security.

Step 8 — Set the Hostname

sudo hostnamectl set-hostname myserver.example.com

Step 9 — Set the Timezone

sudo timedatectl set-timezone UTC

Key Differences from Ubuntu/Debian to Keep in Mind

TaskUbuntu/DebianAlmaLinux/Rocky Linux
Package manageraptdnf
Sudo groupsudowheel
Firewallufwfirewalld
Mandatory access controlAppArmorSELinux
Default web root/var/www/html/var/www/html (same)

Step 10 — Disable Root SSH Login

sudo nano /etc/ssh/sshd_config
PermitRootLogin no
sudo systemctl restart sshd

Note the service name is sshd, not ssh as on Ubuntu/Debian.

Common Errors

"Permission denied" running standard commands despite wheel membership — log out and back in for group membership to take effect.

Application fails with a permissions error despite correct file ownership — likely an SELinux context issue, not a standard permission issue; see Understanding SELinux Basics on AlmaLinux/Rocky Linux.

Best Practices

  • Don't disable SELinux reflexively — learn to work with it, since it provides genuine additional security
  • Use firewalld's zone-based model rather than trying to force a UFW-like mental model onto it
  • Follow the same core security principles as any Linux VPS (SSH keys, updates, firewall) adapted to RHEL-family tooling

Continue Reading

Browse more articles in AlmaLinux & Rocky Linux.

  • almalinux setup, rocky linux setup, new vps almalinux, rhel getting started
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

AlmaLinux vs Rocky Linux vs CentOS: What Happened to CentOS?

If you're choosing a RHEL-compatible Linux distribution for your VPS, understanding the CentOS...

How to Use dnf: The Package Manager for AlmaLinux & Rocky Linux

dnf (Dandified YUM) is the package manager for AlmaLinux, Rocky Linux, and other RHEL-family...

How to Configure firewalld on AlmaLinux/Rocky Linux

firewalld is the default firewall management tool on AlmaLinux and Rocky Linux, using a...

How to Install Nginx on AlmaLinux/Rocky Linux

This guide covers installing and configuring Nginx on AlmaLinux or Rocky Linux, including the...

How to Install Apache (httpd) on AlmaLinux/Rocky Linux

On RHEL-family distributions, Apache is packaged as httpd rather than apache2 — a naming...