Ubuntu, Debian and Rocky Linux are the three most common choices for a Linux server today, and CentOS is the name many people still search for even though classic CentOS Linux no longer exists. All of them are free, stable and well documented; they differ in release cadence, how long each release is supported, how new the packages are and which defaults they ship with. This guide compares them on those points, shows how the daily commands differ and explains how to choose.
What happened to CentOS
CentOS Linux used to be a free rebuild of Red Hat Enterprise Linux (RHEL). That project ended:
- CentOS Linux 8 reached end of life on December 31, 2021.
- CentOS Linux 7 reached end of life on June 30, 2024.
Its successor, CentOS Stream, is a different kind of distribution: it sits just ahead of RHEL and receives changes before they land in the next RHEL minor release. It is useful for testing upcoming RHEL changes but has a shorter lifecycle than RHEL and its rebuilds (CentOS Stream 9 ends in 2027).
Rocky Linux (and AlmaLinux) were created to fill the gap left by CentOS Linux: they are free, binary-compatible rebuilds of RHEL with the same 10-year lifecycle. If you need what CentOS Linux used to be, use Rocky Linux or AlmaLinux, not CentOS Stream.
Quick comparison
| Ubuntu Server LTS | Debian stable | Rocky Linux | CentOS Stream | |
|---|---|---|---|---|
| Backed by | Canonical | Debian community | Rocky Enterprise Software Foundation | Red Hat / CentOS project |
| Current release | 24.04 LTS (also 26.04 LTS) | 13 "trixie" (12 "bookworm" in LTS) | 9 and 10 | 9 and 10 |
| Release cadence | LTS every 2 years (April) | About every 2 years | Follows RHEL major releases | Follows RHEL development |
| Support per release | 5 years standard, up to 12 with Ubuntu Pro | About 3 years + 2 years LTS | 10 years | About 5 years |
| Package manager | apt (.deb) | apt (.deb) | dnf (.rpm) | dnf (.rpm) |
| Newer package versions | PPAs, snaps, HWE kernels | backports | AppStream, EPEL | AppStream, EPEL |
| Mandatory access control | AppArmor | AppArmor | SELinux (enforcing) | SELinux (enforcing) |
| Default firewall tool | UFW (installed, inactive) | none (nftables available) | firewalld (active) | firewalld (active) |
| Automatic security updates | unattended-upgrades enabled | unattended-upgrades optional | dnf-automatic optional | dnf-automatic optional |
Support lifecycle
The lifecycle decides how often you will have to upgrade or rebuild your servers.
- Ubuntu LTS: each LTS release gets 5 years of standard security updates for the main repository. Ubuntu 24.04 is supported until 2029. Ubuntu Pro (free for personal use on a few machines) extends security coverage to 10 years and adds the
universerepository; the Legacy add-on reaches 12 years. - Debian: a stable release gets about 3 years of security support from the Debian security team, then about 2 more years from the Debian LTS project. Debian 12 moved to LTS in June 2026 and Debian 13, released in August 2025, is the current stable.
- Rocky Linux: each major version is supported for 10 years, like RHEL. Rocky Linux 9 is supported until 2032 and Rocky Linux 10 until 2035. Minor releases (9.5, 9.6...) are upgrades within the same major version, applied with a normal
dnf update.
Check which release a server runs and its codename:
cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
Package versions
Distributions with longer lifecycles freeze package versions earlier. This table shows what each release installs from its default repositories:
| Package | Ubuntu 24.04 | Debian 12 | Debian 13 | Rocky Linux 9 | Rocky Linux 10 |
|---|---|---|---|---|---|
| Linux kernel | 6.8 (newer via HWE) | 6.1 | 6.12 | 5.14 (with backports) | 6.12 |
| Python 3 | 3.12 | 3.11 | 3.13 | 3.9 (3.11, 3.12 available) | 3.12 |
| PHP | 8.3 | 8.2 | 8.4 | 8.0 (newer via modules) | 8.3 |
| PostgreSQL | 16 | 15 | 17 | 13 (newer via modules) | 16 |
| Nginx | 1.24 | 1.22 | 1.26 | 1.20 (newer via modules) | 1.26 |
Rocky Linux's kernel version looks old, but Red Hat backports drivers and fixes into it, so it supports much newer hardware than the number suggests. For software that moves fast (PHP, Node.js, databases) all four distributions work well with the upstream vendor repositories, such as the official PostgreSQL, Nginx or NodeSource repositories.
You can always check the exact version a distribution offers before installing:
apt policy nginx
On Rocky Linux, the equivalent is:
dnf info nginx
dnf module list nginx
dnf module list only applies to Rocky Linux 9; Rocky Linux 10 no longer ships modular streams and offers newer versions as separately named packages.
Daily commands compared
Ubuntu and Debian share the same tooling, and so do Rocky Linux and CentOS Stream. The main differences are the package manager, the firewall and the security module.
| Task | Ubuntu / Debian | Rocky Linux / CentOS Stream |
|---|---|---|
| Refresh and upgrade | sudo apt update && sudo apt upgrade | sudo dnf upgrade |
| Install a package | sudo apt install nginx | sudo dnf install nginx |
| Remove a package | sudo apt remove nginx | sudo dnf remove nginx |
| Search | apt search redis | dnf search redis |
| Which package owns a file | dpkg -S /usr/sbin/nginx | rpm -qf /usr/sbin/nginx |
| Extra packages repository | universe (Ubuntu), backports (Debian) | EPEL (sudo dnf install epel-release) |
| Open a port | sudo ufw allow 80/tcp | sudo firewall-cmd --permanent --add-service=http then sudo firewall-cmd --reload |
| Check the security module | sudo aa-status | getenforce |
| Web server user | www-data | nginx or apache |
| Apache package / service | apache2 | httpd |
The last rows matter when following tutorials: a guide written for Ubuntu uses /etc/apache2/ and www-data, while on Rocky Linux the same setup lives in /etc/httpd/ and SELinux may block a web server from reading files outside the expected paths until you set the right context.
Security defaults
- Ubuntu enables AppArmor and installs
unattended-upgrades, which applies security updates daily. UFW is installed but inactive until you enable it. - Debian enables AppArmor since Debian 10. A minimal install ships with very few services and no firewall front end; you can install
ufwor write nftables rules. - Rocky Linux runs SELinux in enforcing mode and firewalld is active from the first boot, allowing only SSH and a few defaults. Automatic updates require installing and enabling
dnf-automatic.
SELinux gives Rocky Linux the strictest default confinement, but it also generates the most "permission denied" surprises for newcomers. Fix them with the right file contexts and booleans (semanage fcontext, setsebool), not by disabling SELinux.
Hardware support and CPU requirements
Rocky Linux 10, like RHEL 10, requires an x86_64 CPU that supports the x86-64-v3 feature level (roughly Intel Haswell or AMD Excavator and newer). Very old hardware, or virtual machines configured with a generic CPU model, may not boot it. Check support on any running Linux system with glibc 2.33 or later:
/lib64/ld-linux-x86-64.so.2 --help | grep x86-64-v
x86-64-v4
x86-64-v3 (supported, searched)
x86-64-v2 (supported, searched)
If x86-64-v3 is not listed as supported, use Rocky Linux 9, or AlmaLinux 10, which also publishes x86-64-v2 builds. Ubuntu 24.04 and Debian 13 still target the baseline x86-64 level.
Migrating away from CentOS
For a server still running CentOS Linux, the safest path is to build a new server with Rocky Linux (or Ubuntu or Debian), copy data and configuration over, and switch traffic.
In-place conversion is possible in some cases:
-
CentOS Linux 8 to Rocky Linux 8: the Rocky project provides the
migrate2rockyscript. Take a full backup or snapshot first, then download the script, read it and run it:curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh less migrate2rocky.sh sudo bash migrate2rocky.sh -rReboot when it finishes and confirm the result with
cat /etc/os-release. -
CentOS Linux 7: there is no direct conversion to a supported release. Upgrading requires a major version jump (for example with the AlmaLinux ELevate project), which is riskier than a rebuild and should only be attempted on a tested copy.
Switching families (for example Rocky Linux to Ubuntu) is always a rebuild: package names, config paths and the security module are different.
Which one should you choose?
Choose Ubuntu Server LTS when:
- You want the widest tutorial and vendor support; most software documents Ubuntu first.
- You run containers, Kubernetes, AI/ML tooling or cloud-native software.
- You like predictable two-year LTS releases with automatic security updates enabled by default.
Choose Debian when:
- You want a minimal, conservative system with no commercial vendor behind it.
- Your workload is long-running and rarely needs new package versions: DNS, mail, reverse proxies, databases.
- You prefer the same tooling as Ubuntu with fewer defaults and extras.
Choose Rocky Linux (or AlmaLinux) when:
- You need RHEL compatibility for commercial software certified on RHEL.
- You want a 10-year lifecycle per major version.
- Your team already knows the Red Hat ecosystem, SELinux and firewalld.
Choose CentOS Stream only when you want to test what the next RHEL minor release will contain; for production servers, prefer Rocky Linux or AlmaLinux.
Conclusion
Ubuntu, Debian and Rocky Linux are all solid server platforms; the choice comes down to lifecycle length, package freshness and whether you need Debian-style or RHEL-style tooling. For most new web and container projects Ubuntu 24.04 LTS is the easiest starting point, Debian suits minimal long-lived servers, and Rocky Linux is the replacement for CentOS Linux. Once you have chosen, set up a non-root sudo user, SSH keys and a firewall, and enable automatic security updates on your new server.
