• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

AlmaLinux vs Rocky Linux on VPS: CentOS Migration Guide 2026

July 11, 2026

CentOS Linux reached full end-of-life in 2024, leaving millions of servers running unsupported software with no security patches. For teams still running CentOS 7 or CentOS 8 on their Hong Kong VPS, migration to a maintained RHEL-compatible alternative is now a security necessity. The two leading replacements — AlmaLinux and Rocky Linux — are both excellent choices, but they have meaningful differences worth understanding before you migrate.


Why CentOS Reached EOL

Red Hat changed the CentOS project in 2020, shifting from CentOS Linux (a stable downstream rebuild of RHEL) to CentOS Stream (an upstream development branch). The last stable CentOS Linux releases are permanently out of support:

  • CentOS Linux 8 — EOL December 31, 2021
  • CentOS Linux 7 — EOL June 30, 2024

Running EOL CentOS in 2026 means no security patches for known CVEs. This is an unacceptable risk for any production VPS handling real traffic or user data.


AlmaLinux vs Rocky Linux: Comparison

FeatureAlmaLinuxRocky Linux
Founded byCloudLinuxOriginal CentOS co-founder
RHEL binary compatibilityYes (ABI compatible)Yes (1:1 bug-compatible)
Release cadenceFast (within days of RHEL)Fast (within days of RHEL)
Support lifecycle10 years per major version10 years per major version
Current stable versionAlmaLinux 9.xRocky Linux 9.x
cPanel supportYes (official)Yes (official)
Plesk supportYesYes
ARM64 supportYesYes
Community sizeLargeLarge
Backing organisationAlmaLinux OS FoundationRocky Enterprise Software Foundation

For practical purposes, both are excellent drop-in CentOS replacements. AlmaLinux tends to release slightly faster after RHEL updates and has strong commercial backing from CloudLinux. Rocky Linux emphasises strict bug-for-bug RHEL compatibility. Either is a safe choice; pick based on your team’s familiarity or the recommendation of your hosting provider.


Option A: Fresh Installation on Hong Kong VPS

The cleanest migration path is a fresh VPS with AlmaLinux or Rocky Linux, followed by application migration. Server.HK offers both as OS options during VPS provisioning.

# After provisioning with AlmaLinux 9 or Rocky Linux 9:

# Update immediately after first login
dnf update -y

# Install common tools
dnf install -y epel-release
dnf install -y vim curl wget git htop net-tools unzip bind-utils

# Configure firewall (firewalld replaces iptables/ufw on RHEL-based systems)
systemctl enable --now firewalld
firewall-cmd --permanent --add-service=ssh
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

Option B: In-Place Migration from CentOS 7

AlmaLinux provides an official in-place migration tool — ELevate — that upgrades CentOS 7 directly to AlmaLinux 8 or 9 without reinstalling the OS. This preserves your application configuration, installed packages, and data.

# On your existing CentOS 7 VPS:

# Install ELevate migration tool
yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm
yum install -y leapp-upgrade leapp-data-almalinux

# Run pre-migration check
leapp preupgrade

# Review the report — fix any blocking issues
cat /var/log/leapp/leapp-report.txt | grep -A2 "INHIBITOR"

Common Pre-Migration Issues to Fix

# Remove unsupported packages
yum remove -y kernel-devel   # If flagged
yum remove -y python2-leapp  # Version conflicts

# Disable unsupported kernel modules
echo "blacklist " > /etc/modprobe.d/migration.conf

# Remove third-party repos that conflict
ls /etc/yum.repos.d/  # Identify and disable non-standard repos
# After resolving all inhibitors:
leapp upgrade

# System reboots into migration environment (~10-20 minutes)
# Then reboots again into AlmaLinux 8

# Verify migration success
cat /etc/almalinux-release  # Should show AlmaLinux 8.x

Upgrade from AlmaLinux 8 to 9

<code"># Use ELevate again for 8→9 upgrade
dnf install -y leapp-upgrade leapp-data-almalinux
leapp preupgrade --target 9.0
leapp upgrade

Option C: In-Place Migration from CentOS 8

# AlmaLinux provides almalinux-deploy script for CentOS 8
curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
bash almalinux-deploy.sh

# The script converts CentOS 8 repos to AlmaLinux repos and replaces packages
# Reboot required after completion
reboot

# Verify
cat /etc/almalinux-release

For Rocky Linux migration from CentOS 8, the migrate2rocky script performs an equivalent conversion:

curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
bash migrate2rocky.sh -r   # -r flag for Rocky Linux
reboot

Post-Migration: LEMP Stack on AlmaLinux/Rocky Linux 9

The package names differ slightly from Ubuntu/Debian. Here is the LEMP stack setup for RHEL 9 compatible distros:

# Install Nginx
dnf install -y nginx
systemctl enable --now nginx

# Install MySQL 8
dnf install -y mysql-server
systemctl enable --now mysqld
mysql_secure_installation

# Install PHP 8.2 (via Remi repo — RHEL 9 ships PHP 8.1)
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm
dnf module reset php -y
dnf module enable php:remi-8.2 -y
dnf install -y php php-fpm php-mysqlnd php-xml php-mbstring php-redis \
  php-curl php-zip php-gd php-opcache php-intl
systemctl enable --now php-fpm

# Install Redis
dnf install -y redis
systemctl enable --now redis

Key Differences from Ubuntu

# PHP-FPM socket location (different from Ubuntu)
# AlmaLinux/Rocky: /run/php-fpm/www.sock
# Ubuntu:          /run/php/php8.2-fpm.sock

# Update Nginx fastcgi_pass accordingly:
fastcgi_pass unix:/run/php-fpm/www.sock;

# Service management: same systemctl commands
# Package manager: dnf (not apt)
# Config location: /etc/nginx/ (same), /etc/php.ini (vs /etc/php/8.2/fpm/php.ini)

SELinux: The Key RHEL-Family Difference

RHEL-based systems (AlmaLinux, Rocky Linux) ship with SELinux enabled by default — Ubuntu does not. SELinux can block Nginx from reading web files or PHP-FPM from writing to certain directories if contexts are incorrect.

# Check SELinux status
getenforce  # Should show: Enforcing

# Allow Nginx to connect to PHP-FPM (required)
setsebool -P httpd_can_network_connect 1

# Fix file context for web directories
semanage fcontext -a -t httpd_sys_content_t "/var/www/myapp(/.*)?"
restorecon -Rv /var/www/myapp

# Allow PHP-FPM to write to storage directories
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/myapp/storage(/.*)?"
restorecon -Rv /var/www/myapp/storage

# Debug SELinux denials (useful during setup)
ausearch -m AVC -ts recent | audit2allow

SELinux enforcement is a security feature — resist the temptation to disable it with setenforce 0. Fix the contexts instead; it takes 10–15 minutes and meaningfully improves your server’s security posture.


cPanel Migration Considerations

cPanel supports AlmaLinux 8 and 9, and Rocky Linux 8 and 9 as officially supported operating systems. If your CentOS VPS runs cPanel:

# cPanel provides its own migration tool for ELevate upgrades
# Install cPanel ELevate integration
/scripts/elevate-cpanel --non-interactive --start

This upgrades both the OS and cPanel simultaneously. Back up all accounts before running — use cPanel’s built-in backup tool to export all accounts to an external destination first.


Conclusion

Both AlmaLinux and Rocky Linux are stable, long-term-supported CentOS replacements that run identically on a Hong Kong VPS. In-place migration via ELevate (AlmaLinux) or migrate2rocky is available for CentOS 8 servers; CentOS 7 requires the two-step ELevate path through AlmaLinux 8 then 9. Fresh installations on new VPS instances remain the cleanest option for complex applications.

The key post-migration adjustment for teams coming from Ubuntu is understanding SELinux — fix contexts rather than disabling enforcement, and your RHEL-compatible VPS will be more secure than its predecessor.

Migrate to a supported OS: Browse Server.HK Hong Kong VPS plans — AlmaLinux 9 and Rocky Linux 9 are available as OS options during provisioning.

Recent Posts

  • Hong Kong VPS vs Cloudflare Workers: Which for Asia-Pacific APIs? (2026)
  • How to Self-Host Gitea on Hong Kong VPS: Private Git Server (2026)
  • WooCommerce for China Market on Hong Kong VPS: Sell Cross-Border in 2026
  • Game Server on Hong Kong VPS: CS2, Valheim, and Minecraft for Asia (2026)
  • Linux Kernel and Sysctl Hardening for Hong Kong VPS Security (2026)

Recent Comments

  1. Hong Kong VPS Uptime and SLA: What 99.9% Uptime Really Means for Your Business (2026) - Server.HK on How to Monitor Your Hong Kong VPS: Uptime, Performance, and Alert Setup Guide (2026)
  2. Best Hong Kong VPS Providers in 2026: Compared by Speed, Routing, and Value - Server.HK on How to Migrate Your Website to a Hong Kong VPS: Zero-Downtime Transfer Guide (2026)
  3. vibramycin injection on How to Choose the Right Hong Kong VPS Plan: A Buyer’s Guide for 2026
  4. allopurinol for gout on CN2 GIA vs BGP vs CN2 GT: What’s the Real Difference for China Connectivity?
  5. antibiotics online purchase on How to Set Up a WordPress Site on a Hong Kong VPS with aaPanel (Step-by-Step 2026)

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot