Or copy link
Choosing the right operating system (OS) is the foundational step in deploying any successful online project. For those transitioning away from CentOS due to shifts in its lifecycle, AlmaLinux has emerged as the leading, stable, community-driven, and enterprise-grade alternative. If you are looking to take full control of your cloud resources or dedicated virtual private server (VPS), learning how to Install AlmaLinux on VPS is an essential skill.
This comprehensive guide from Amar Hoster (আমার হোস্টার) will walk you through the entire process, from initial provisioning to final configuration. AlmaLinux provides the stability, security, and performance required for high-traffic websites, robust applications, and intricate database operations. By the end of this tutorial, you will have a perfectly configured server ready for hosting your next big idea.
Before we dive into the technical steps, it is crucial to ensure you have the necessary foundations in place. A smooth setup relies heavily on proper resource allocation and choosing a reliable hosting partner.
The performance of your AlmaLinux installation is directly tied to the underlying hardware provided by your host. When selecting your VPS, consider the following:
You will need access to the root console or VNC (Virtual Network Computing) interface provided by your hosting control panel. This is essential for the initial boot and installation phase, especially if you are manually installing the OS via an ISO image rather than using a pre-built template.
AlmaLinux is 100% free and open-source. You do not need to purchase any licenses. If your host provides a generic OS installation option, you may need the AlmaLinux installation ISO image, though most reputable VPS providers, including Amar Hoster, offer AlmaLinux as a standard template choice, simplifying the process dramatically.
This guide focuses on the process of provisioning and configuring AlmaLinux, assuming you are starting with a new or freshly reset VPS instance.
The very first step is instructing your VPS control panel to allocate resources and prepare the server for the operating system installation.
For manual installations or highly customized setups, the VNC console allows you to interact with the graphical installer.
AlmaLinux utilizes the Anaconda installer, which is common across RHEL-based distributions. You will be presented with a centralized screen containing all configuration categories.
This is one of the most critical steps in the process of Install AlmaLinux on VPS.
/boot
swap
/
eth0
ens18
webserver1.mycompany.com
The choice here determines the complexity and resource usage of your initial installation.
Before starting the installation, you must secure the system with a root password and create an administrative user.
root
admin
sudo
Once all required fields are marked as complete (no warning triangles), click “Begin Installation.” The Anaconda installer will format the disks, copy the OS files, and prepare the bootloader. This process may take 10 to 30 minutes, depending on your VPS speed.
Once the installation is complete, the system will prompt you to “Reboot System.” Remove the installation ISO (if manual setup was used) and allow the system to boot from the newly installed AlmaLinux environment.
ssh [email protected]
This successfully completes the foundational process to Install AlmaLinux on VPS. Now we move to necessary post-installation hardening.
A newly installed AlmaLinux system, even a minimal one, needs immediate updates and configuration to ensure stability and security. These steps are crucial whether you are setting up a small personal website or large-scale hosting infrastructure.
The first action after successfully booting into your new AlmaLinux environment is to update all system packages to their latest versions, patching any security vulnerabilities present in the installation media.
# Switch to the root user or use sudo sudo dnf update -y
The dnf package manager (the successor to yum) will fetch and install all updates. This step is essential before installing any new applications.
dnf
yum
Ensure your server identity and clock are accurately set.
Setting the correct timezone is vital for logging, scheduling tasks (cron jobs), and proper application behavior.
# List available timezones timedatectl list-timezones # Set your specific timezone (Example: Dhaka) sudo timedatectl set-timezone Asia/Dhaka
# Set the desired hostname (replace example.com) sudo hostnamectl set-hostname myhost.example.com # Verify hostnamectl
AlmaLinux uses firewalld as its default dynamic firewall management tool. By default, the minimal installation may block most incoming connections. You must explicitly open ports for services you intend to run (e.g., SSH, HTTP, HTTPS).
firewalld
sudo systemctl enable firewalld sudo systemctl start firewalld sudo systemctl status firewalld
The following commands open the standard ports required for remote management and basic web services. The --permanent flag ensures these rules persist after a reboot.
--permanent
sudo firewall-cmd --zone=public --add-service=ssh --permanent
sudo firewall-cmd --zone=public --add-service=http --permanent sudo firewall-cmd --zone=public --add-service=https --permanent
After adding permanent rules, you must reload the service to apply them immediately.
sudo firewall-cmd --reload
SSH is your primary entry point, making its security paramount.
Connecting directly as root is dangerous. If an attacker gains the root password, they have full control. Disable this in the SSH configuration file (/etc/ssh/sshd_config).
/etc/ssh/sshd_config
sudo nano /etc/ssh/sshd_config
PermitRootLogin
PermitRootLogin no
Changing the default port (22) dramatically reduces the automated brute-force attacks against your server. Choose a high, non-standard port (e.g., 50022).
#Port 22
Port 50022
sudo firewall-cmd --zone=public --add-port=50022/tcp --permanent sudo firewall-cmd --reload
sudo systemctl restart sshd
Now, when you connect via SSH, you must specify the new port: ssh [email protected] -p 50022.
ssh [email protected] -p 50022
By performing these steps, you have successfully secured the foundation of your server after you Install AlmaLinux on VPS.
The goal of most users who Install AlmaLinux on VPS is to run a website, blog, or application. This requires installing a complete web stack. The two most common stacks are LAMP (Linux, Apache, MySQL/MariaDB, PHP) and LEMP (Linux, Nginx, MySQL/MariaDB, PHP). We will outline the LAMP setup, which is standard for hosting environments like those offered by Amar Hoster.
We will use the httpd package, which is the Apache web server implementation for RHEL-based systems.
httpd
# Install Apache sudo dnf install httpd -y # Enable Apache to start on boot and start the service now sudo systemctl enable httpd sudo systemctl start httpd
Since you already opened ports 80 and 443 in the previous firewall steps, Apache should be immediately accessible. You can test this by navigating to your VPS IP address in a browser.
MariaDB is a robust, community-developed fork of MySQL and is the preferred database server for AlmaLinux.
# Install MariaDB server sudo dnf install mariadb-server -y # Enable and start the service sudo systemctl enable mariadb sudo systemctl start mariadb
Immediately after installation, run the security script to set the root password and remove insecure defaults.
sudo mysql_secure_installation
Follow the prompts: set the root password, remove anonymous users, disallow remote root login, and remove the test database.
PHP is the scripting language used by most modern web applications, including popular CMS platforms like WordPress. Amar Hoster supports multiple versions, and you should install the version most appropriate for your application. We will use the standard repository, which typically installs PHP 8.x.
# Install necessary PHP packages for web hosting compatibility sudo dnf install php php-cli php-fpm php-mysqlnd php-gd php-curl php-zip php-json -y
By default, the PHP installation may use PHP-FPM (FastCGI Process Manager). For Apache, we need to ensure the correct modules are loaded, or sometimes ensure PHP-FPM is configured to work with Apache.
php-fpm
apache
sudo systemctl enable php-fpm sudo systemctl start php-fpm
sudo systemctl restart httpd
With the stack installed, you can now host content. The default web root for Apache on AlmaLinux is usually /var/www/html/.
/var/www/html/
info.php
sudo nano /var/www/html/info.php
Add the following content:
<?php phpinfo(); ?>
sudo chown -R apache:apache /var/www/html sudo chmod -R 755 /var/www/html
http://your.vps.ip.address/info.php
If you plan on installing a CMS like WordPress, note that while the manual AlmaLinux setup gives you flexibility, simpler hosting packages from Amar Hoster, such as the Budget hosting starting at 160 Tk or Premium hosting starting at 430 Tk, come with pre-configured cPanel environments that allow one-click installs. If you ever decide to move away from self-management, you can rely on the automated tools.
If you are determined to use this AlmaLinux VPS for WordPress, you will need to:
wp-config.php
(For a simplified installation process on a managed platform, please refer to the Amar Hoster video guide on WordPress installation: https://youtu.be/OoJMkdyJJm8).
Achieving long-term stability requires ongoing maintenance and optimization. These steps further refine your AlmaLinux environment.
AlmaLinux leverages SELinux (Security-Enhanced Linux), a powerful security module. While many guides suggest disabling SELinux because it can complicate configuration, keeping it enabled is essential for enterprise-level security.
When configuring web applications (especially custom installations or non-standard ports), SELinux may block operations. Instead of disabling it, use the semanage tool to adjust policies.
semanage
sestatus
audit.log
sudo dnf install setroubleshoot-server
The setroubleshoot tool can often generate commands to fix policy issues.
setroubleshoot
To efficiently manage and monitor your server after you Install AlmaLinux on VPS, install these utilities:
vi
sudo dnf install nano -y
sudo dnf install htop -y
Data loss is the single biggest threat to any hosting environment. While Amar Hoster provides robust infrastructure options, implementing off-server backups is critical.
If you encounter a disaster or need a specific rollback, our support team at Amar Hoster can often assist with server-level issues. If you require a full state rollback, you can open a support ticket directly at: https://go.amar.host/openticket.
As your website grows, you may need to scale your VPS resources (RAM, CPU). Use htop to regularly monitor:
htop
If you are using a non-BDIX Global location, and notice latency issues for your Bangladeshi audience, consider migrating to a BDIX Premium Hosting package available at Amar Hoster. Migration is typically free, and you can initiate a transfer hosting request via a ticket here: panel.amarhoster.com/submitticket.php?step=2&deptid=9.
Even a perfect process to Install AlmaLinux on VPS can sometimes yield minor post-install issues.
firewall-cmd --list-all
sshd
sudo systemctl status php-fpm
sudo systemctl status mariadb
127.0.0.1
ls -l /var/www/html
apache:apache
sudo dnf clean all
sudo dnf update
ping 8.8.8.8
If you are struggling with a complex configuration issue on your server after you Install AlmaLinux on VPS, Amar Hoster offers multiple robust support channels:
We understand that server management can be challenging. Whether you need help connecting a domain (Video: https://youtu.be/thbcPactI1o) or configuring your webmail (Video: https://youtu.be/ZkRr5wlu6EI), our team is ready to assist.
Learning how to Install AlmaLinux on VPS gives you a distinct advantage: a powerful, stable, and highly customizable hosting environment that rivals major enterprise solutions. AlmaLinux ensures compatibility with RHEL, providing a predictable environment that will receive security updates for years to come.
By following this comprehensive guide, you have successfully moved from a blank slate to a fully secured and operational web server, ready to handle traffic and deploy applications.
Remember that while self-managing a VPS running AlmaLinux offers maximum control, you always have the option to switch to a simpler, cPanel-driven environment with Amar Hoster (আমার হোস্টার) if your needs change. We offer flexible hosting solutions, including yearly hosting cycles (3, 6, 12, 24, 36 months), and easy payment methods including PayPal, Card, and local options like bKash/Nagad/Rocket.
Start building your next online project today with the reliability and speed of AlmaLinux and the dedicated support of Amar Hoster! For domain registration, remember that high-value domains like .COM are available for just 1099 Tk.
Contact Amar Hoster:
If you are trying to install or manage an SSL certifica...
When working with large databases, default upload limit...
Save my name, email, and website in this browser for the next time I comment.