Install and Configure WordPress on AlmaLinux 9 Easy Steps
This guide is designed to walk you through the process to Install and Configure WordPress on AlmaLinux 9. A WordPress website is fundamentally any website that utilizes WordPress as its content management system (CMS). WordPress manages both the backend of your site (the interface where you log in to manage content and settings) and the frontend (the publicly visible portion of your website that visitors interact with).
Let’s proceed with the step-by-step instructions to set up WordPress on AlmaLinux 9.
To successfully Install and Configure WordPress on AlmaLinux 9, ensure you have the following prerequisites in place.
1. Requirements for WordPress AlmaLinux 9
You should be logged into your AlmaLinux 9 server as a non-root user with sudo
privileges and have a basic firewall configured. Refer to our guide on Initial Server Setup with AlmaLinux 9 for detailed instructions on setting this up.
Furthermore, you need a fully functional LAMP (Linux, Apache, MariaDB/MySQL, PHP) stack installed on your server. Our article on Installing LAMP Stack on AlmaLinux 9 will guide you through the LAMP stack installation process.
2. Install Additional PHP Modules on AlmaLinux 9
Assuming you’ve completed the prerequisites, the next step is to install necessary PHP extensions. These extensions are crucial for WordPress to function correctly. Execute the following command:
sudo dnf install php-{bz2,mysqli,curl,gd,intl,common,mbstring,xml}
After installing the PHP extensions, restart the Apache web server to apply the changes:
sudo systemctl restart httpd
3. Create a WordPress Database and User
WordPress requires a dedicated database and user to store its data. Log in to your MariaDB shell as the root user:
sudo mysql -u root -p
Inside the MariaDB shell, create a new database for WordPress. In this example, we’ll name it wordpressdb
:
MariaDB [(none)]> CREATE DATABASE wordpressdb;
Next, create a new user specifically for WordPress and grant them all necessary privileges on the wordpressdb
database. Replace <password>
with a strong, secure password:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpressdb.* TO 'wordpress_user'@'localhost' IDENTIFIED BY 'password';
Finally, flush the privilege tables to ensure the changes are applied, and exit the MariaDB shell:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
4. Set up WordPress on AlmaLinux 9
Now, download the latest WordPress package from the official WordPress website using the wget
command:
sudo wget http://WordPress.org/latest.tar.gz
Once the download is complete, extract the archive:
sudo tar -xzvf latest.tar.gz
Move the extracted WordPress files to your web server’s document root directory (typically /var/www/html/
):
sudo mv wordpress/* /var/www/html/
Set the appropriate ownership and permissions for the WordPress files:
sudo chown -R apache:apache /var/www/html/
Configure Firewall for WordPress
To allow access to your WordPress site, you need to open ports 80 (HTTP) and 443 (HTTPS) in your AlmaLinux 9 firewall. Run the following commands:
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
Reload the firewall to activate the new rules:
sudo systemctl reload firewalld
At this stage, you can proceed with the WordPress installation and configuration through the web interface.
5. Access WordPress Web Interface
Open your web browser and enter your server’s IP address or domain name:
http://<server-ip-address>
You’ll be redirected to the WordPress language selection screen. Choose your preferred language and click Continue.

The next screen presents a welcome message. Click Let’s Go! to continue.
Enter the database information you created earlier (database name, username, password, and hostname) and click Submit.

Click Run the installation and provide the necessary information, such as your site title, desired username, password, and email address. Then click Install WordPress.

After the installation is complete, you will see the WordPress login screen. Enter the username and password you created in the previous step and click Sign In.
You will now be logged into your WordPress dashboard.

Congratulations! You’ve successfully completed the WordPress installation on AlmaLinux 9.
Conclusion
In this guide, you learned how to Install and Configure WordPress on AlmaLinux 9. You began with installing the LAMP Stack, then followed the detailed steps to successfully access and configure WordPress on your AlmaLinux 9 server.
Enjoy your new WordPress site! You might also find these articles helpful:
Install and Use Podman on AlmaLinux 9
Install Nessus Scanner on AlmaLinux 9
Fix semanage command Not Found Error in AlmaLinux
Remove Old Linux Kernels on AlmaLinux
Configure Rsyslog in AlmaLinux
Alternative Solutions for Installing WordPress on AlmaLinux 9
While the method outlined above is a standard approach, here are two alternative ways to Install and Configure WordPress on AlmaLinux 9:
1. Using Docker Compose
Docker Compose provides a more containerized and isolated approach to deploying WordPress, simplifying management and ensuring consistency across different environments.
Explanation:
Docker Compose utilizes a docker-compose.yml
file to define and manage multi-container Docker applications. We’ll create a Compose file that defines two services: a MariaDB container for the database and a WordPress container. This isolates WordPress and its dependencies, making it easier to update, scale, and maintain.
Steps:
-
Install Docker and Docker Compose: If you haven’t already, install Docker and Docker Compose on your AlmaLinux 9 server. Refer to the official Docker documentation for instructions.
-
Create a
docker-compose.yml
file: Create a new directory for your WordPress project and create adocker-compose.yml
file within it:
mkdir wordpress-docker
cd wordpress-docker
nano docker-compose.yml
- Populate the
docker-compose.yml
file: Paste the following content into thedocker-compose.yml
file. Replace<your-db-password>
,<your-wp-admin-user>
, and<your-wp-admin-password>
with your desired values.
version: "3.8"
services:
db:
image: mariadb:10.6
restart: always
environment:
MYSQL_ROOT_PASSWORD: <your-db-password>
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: <your-db-password>
volumes:
- db_data:/var/lib/mysql
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "80:80"
restart: always
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: <your-db-password>
WORDPRESS_DB_NAME: wordpress
WORDPRESS_ADMIN_USER: <your-wp-admin-user>
WORDPRESS_ADMIN_PASSWORD: <your-wp-admin-password>
volumes:
- wordpress_data:/var/www/html
volumes:
db_data:
wordpress_data:
- Start the containers: Run the following command in the same directory as your
docker-compose.yml
file:
docker-compose up -d
This command will download the necessary images and start the MariaDB and WordPress containers in detached mode.
- Access WordPress: Open your web browser and navigate to your server’s IP address. You should be able to access your WordPress installation. You can log in to the admin panel using the username and password you specified in the
docker-compose.yml
file.
2. Using a Web Hosting Control Panel (e.g., cPanel, Plesk)
If you’re using a web hosting control panel, you can leverage its built-in tools to Install and Configure WordPress on AlmaLinux 9.
Explanation:
Web hosting control panels like cPanel or Plesk provide a graphical interface for managing your server, including installing applications like WordPress. They typically offer one-click installers or similar tools that automate the installation process.
Steps:
-
Log in to your control panel: Access your web hosting control panel using the credentials provided by your hosting provider.
-
Locate the WordPress installer: Look for a section labeled "Applications," "Software," or similar. Within that section, you should find a WordPress installer (often called "WordPress Manager" or "Softaculous").
-
Initiate the installation: Click on the WordPress installer and follow the on-screen instructions. You’ll typically need to provide information such as the database name, username, password, site title, and administrator credentials.
-
Complete the installation: The control panel will handle the installation process automatically. Once it’s finished, you’ll receive confirmation and login details for your new WordPress site.
Benefits of using a control panel:
- Ease of Use: Control panels simplify the installation process with user-friendly interfaces.
- Automation: They automate tasks such as database creation, file transfer, and permission configuration.
- Management Tools: Control panels provide tools for managing your WordPress site, including updates, backups, and security settings.
Choosing the right installation method depends on your technical expertise and specific requirements. The manual method offers greater control, while Docker Compose provides isolation and portability. Control panels prioritize ease of use.