WordPress is the most popular content management software based on PHP programming language, and as of this writing WordPress powers over one-third of the web as it captures at least 43 percent market share of all websites.
In this tutorial we will guide you on how to install WordPress on Almalinux 8 which a robust production grade platform binary compatible with Red Hat Enterprise Linux.
Since WordPress is based on PHP we will use MariaDB as database on this tutorial.
After adding the remi repository you need to update the system.
sudo dnf update
Then we need to reset the PHP module set on our system.
sudo dnf module reset php
Then enable the module. In this tutorial we will use PHP 8.0 but feel free to change the version you want.
Let us enable PHP
sudo dnf module enable php:8.0
Last metadata expiration check: 0:05:35 ago on Wed 03 Aug 2022 01:07:48 PM EDT.
Package Architecture Version Repository Size
Enabling module streams:
Is this ok [y/N]: y
3 Installing PHP and PHP extension
Let us proceed installing PHP 8.0 and the PHP extensions needed to run WordPress.
# php -v
PHP 8.0.13 (cli) (built: Nov 16 2021 18:07:21) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.13, Copyright (c) Zend Technologies
with Zend OPcache v8.0.13, Copyright (c), by Zend Technologies
4 Installing and Configuring MariaDB server.
The database we choose for this setup is MariaDB so let us start installing and configuring it.
sudo dnf install mariadb-server mariadb -y
Let us enable and start our MariaDB service.
sudo systemctl enable mariadb --now
Verify the status.
sudo systemctl status mariadb
● mariadb.service - MariaDB 10.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2022-08-03 13:31:51 EDT; 23s ago
Process: 236837 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
Process: 236700 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
Process: 236675 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 236806 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 30 (limit: 49455)
└─236806 /usr/libexec/mysqld --basedir=/usr
Let us secure our MariaDB installation.
Enter current password for root (enter for none): Just press enter
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] n
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
Remove anonymous users? [Y/n] y
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
- Removing privileges on test database...
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
In the setup we opted to set the root password but you can do so if you want.
Now let us create a database for our WordPress instance.
Let us connect to our MariaDB console.
Please note that we di not set the root password for MariaDB but if you have set it up you should use “sudo mysql -u root -p“.
Create a database.
MariaDB [(none)]> create database wordpress;
Create a database user and grant all privileges to database wordpress.
MariaDB [(none)]> grant all privileges on wordpress.* to 'wp_user'@'localhost' identified by 'mypassword';
Flush the privileges.
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
5 Download WordPress
Since we are done installing the system requirements we will now download and setup WordPress.