How To Install aaPanel on AlmaLinux 9
Managing a web server can be complex, especially for users without extensive command-line experience. Fortunately, tools like aaPanel offer a solution. aaPanel is a free and open-source web hosting control panel that simplifies server management through an intuitive graphical user interface (GUI). In this guide, we will walk you through the process of installing aaPanel on AlmaLinux 9, a popular CentOS replacement known for its stability and security.
What is aaPanel?
aaPanel is a lightweight control panel designed to make web server management easier. It provides one-click installations for essential web environments such as LNMP (Linux, Nginx, MySQL, PHP) and LAMP (Linux, Apache, MySQL, PHP). With aaPanel, users can manage websites, databases, FTP accounts, and more—all from a browser-based interface.
Why Choose AlmaLinux 9?
AlmaLinux is an enterprise-grade Linux distribution that emerged as a community-driven alternative to CentOS after CentOS shifted focus to CentOS Stream. AlmaLinux 9 offers long-term support and stability, making it an excellent choice for hosting environments. Its compatibility with Red Hat Enterprise Linux (RHEL) ensures that it works seamlessly with most server software.
Prerequisites
Before we dive into the installation process for aaPanel on AlmaLinux 9, there are a few prerequisites to consider:
Server Requirements
- A server running AlmaLinux 9 with root or sudo privileges.
- A minimum of 512MB RAM (1GB or more recommended).
- At least 20GB of disk space.
Basic Server Setup
If you haven’t already set up your server, ensure that you have a clean minimal installation of AlmaLinux 9. This will help avoid potential conflicts with pre-installed services like Apache or MariaDB.
Firewall Configuration
Ensure that your firewall is configured to allow traffic on the ports used by aaPanel:
- Port 7800: Used for accessing the aaPanel interface.
- Port 888: Used for the default website service.
You can configure your firewall using the following commands:
sudo firewall-cmd --permanent --add-port=7800/tcp
sudo firewall-cmd --permanent --add-port=888/tcp
sudo firewall-cmd --reload
Step-by-Step Guide to Installing aaPanel on AlmaLinux 9
1. Update System Packages
The first step in any installation process is to ensure that your system packages are up-to-date. Run the following command to update your package index and upgrade installed packages:
sudo dnf update -y
This ensures that your system has the latest security patches and software updates.
2. Install Required Tools
Next, install some essential tools that will be needed during the installation process. These include tools like wget (for downloading files) and gcc (for compiling software). Run the following command:
sudo dnf install wget vim nano gcc -y
This command installs wget (for downloading files), vim/nano (text editors), and gcc (a C compiler required for certain installations).
3. Download and Run the aaPanel Installer Script
The easiest way to install aaPanel is by using their official installer script. Use wget to download the script and then run it:
wget -O install.sh https://www.aapanel.com/script/install_7.0_en.sh && sudo bash install.sh
The script will automatically download and install all necessary dependencies for aaPanel. This process may take several minutes depending on your server’s performance.
4. Accessing the aaPanel Web Interface
Once the installation is complete, you will see a message containing the URL you need to access the aaPanel web interface along with login credentials. Open your browser and go to:
https://your-server-ip:7800
You may encounter a browser warning about an insecure connection since aaPanel uses a self-signed SSL certificate by default. You can safely ignore this warning or install a valid SSL certificate later.
5. Initial Configuration: One-click LNMP/LAMP Installation
After logging in for the first time, you will be prompted to install either the LNMP or LAMP stack. LNMP (Nginx) is recommended by default due to its performance advantages over Apache (LAMP), but you can choose based on your specific needs.
- LAMP: Linux + Apache + MySQL + PHP.
- LNMP: Linux + Nginx + MySQL + PHP.
Select your preferred stack and click “Install.” The one-click installer will handle everything from downloading packages to configuring services.
Post-installation Configuration
1. Setting Up Basic Security
Your server’s security should be a top priority after installing aaPanel. Start by ensuring that your firewall is correctly configured as mentioned earlier.
Create Strong Passwords
Create strong passwords for both your root account and any additional users created through aaPanel.
Add SSL Certificates
If you plan to host websites through aaPanel, it’s essential to secure them with SSL certificates. You can easily add Let’s Encrypt certificates via the panel’s built-in SSL management tool.
2. Creating a Website in aaPanel
You can create new websites directly from within the control panel by navigating to “Website” > “Add Site.” Enter your domain name and select additional options like database creation if needed.
3. Managing Databases in aaPanel
The “Database” section allows you to create and manage MySQL databases with ease. Simply click “Add Database,” fill in the required details such as database name and user credentials, then click “Submit.” You can manage databases via phpMyAdmin or other database management tools integrated into aaPanel.
4. Setting Up FTP Access in aaPanel
If you need FTP access for file management, navigate to “FTP” > “Add FTP” within the panel interface. Enter details such as username and password along with directory permissions for secure access control.
Troubleshooting Common Issues During Installation
Error: No Acceptable C Compiler Found
If you encounter an error stating that no acceptable C compiler was found during installation, ensure that gcc is installed:
sudo dnf install gcc -y
Error: PHP Compatibility Issues
If you face compatibility issues related to PHP versions during installation or configuration of your web environment stack (LNMP/LAMP), ensure that all necessary dependencies are installed:
sudo dnf install -y oniguruma
Nginx Startup Issues After Installation
If Nginx fails to start after installation due to Lua-related errors in configuration files, comment out Lua-related directives in Nginx config files if Lua isn’t required for your setup.
Congratulations! You have successfully installed aaPanel. Thanks for using this tutorial for installing aaPanel free and open-source hosting control panel on AlmaLinux 9 system. For additional help or useful information, we recommend you check the official aaPanel website.