Loading...

How to Install WordPress on CentOS 8

Simple.Predictable.Scalable

Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Installing WordPress on CentOS 8

WordPress is a popular website and blogging platform that allows users to create and manage their own websites with ease. In this tutorial, we will guide you through the process of installing WordPress on CentOS 8.

Step 1: Update the System

Before installing any new software, it is always a good idea to update the system to ensure that you have the latest packages and security patches. Open a terminal and run the following commands:

    
sudo dnf update -y
sudo reboot
    
  

Step 2: Install Apache Web Server

WordPress requires a web server to host your website. Apache is a popular and widely used web server. Install Apache by running the following command in the terminal:

    
sudo dnf install httpd -y
    
  

Step 3: Start Apache and Enable it to Start on Boot

Start Apache and enable it to automatically start on system boot by running the following commands:

    
sudo systemctl start httpd
sudo systemctl enable httpd
    
  

Step 4: Install MariaDB Database Server

WordPress also requires a database server to store its data. MariaDB is a popular and open-source database server. Install MariaDB by running the following command in the terminal:

    
sudo dnf install mariadb-server -y
    
  

Step 5: Start MariaDB and Enable it to Start on Boot

Start MariaDB and enable it to automatically start on system boot by running the following commands:

    
sudo systemctl start mariadb
sudo systemctl enable mariadb
    
  

Step 6: Secure the MariaDB Installation

Secure the MariaDB installation by running the following command:

    
sudo mysql_secure_installation
    
  

Step 7: Create a Database and User

Create a database for WordPress and a user that has access to the database. Open the MariaDB shell with the following command:

    
sudo mysql
    
  

Once you are in the MariaDB shell, create the database and user with the following commands:

    
CREATE DATABASE wordpress;
GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;
    
  

Step 8: Install PHP and Required Extensions

WordPress is built using PHP, so we need to install PHP and some required extensions. Run the following command to install PHP and the necessary extensions:

    
sudo dnf install php php-mysqlnd php-json php-gd php-xml php-mbstring php-fpm -y
    
  

Step 9: Configure Apache to Use PHP-FPM

Configure Apache to use PHP-FPM by editing the Apache configuration file /etc/httpd/conf/httpd.conf. Open the file in a text editor and add the following lines:

    

    SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost/"

    
  

Save the file and close the text editor.

Step 10: Restart Apache

Restart Apache to apply the changes by running the following command:

    
sudo systemctl restart httpd
    
  

Step 11: Download and Extract WordPress

Download the latest version of WordPress from the official website. Extract the downloaded file to the Apache document root directory /var/www/html/. You can do this by running the following commands:

    
cd /tmp
wget https://wordpress.org/latest.tar.gz
tar -xf latest.tar.gz
sudo cp -r wordpress/* /var/www/html/
    
  

Step 12: Configure WordPress

Configure WordPress by creating a configuration file. Rename the sample configuration file /var/www/html/wp-config-sample.php to /var/www/html/wp-config.php by running the following command:

    
sudo mv /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
    
  

Edit the configuration file /var/www/html/wp-config.php and update the following lines with your database details:

    
define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpressuser');
define('DB_PASSWORD', 'password');
define('DB_HOST', 'localhost');
    
  

Save the file and close the text editor.

Step 13: Set Permissions

Set the correct permissions for the WordPress files and directories by running the following commands:

    
sudo chown -R apache:apache /var/www/html/
sudo chmod -R 755 /var/www/html/
    
  

Step 14: Access WordPress

Now that WordPress is installed and configured, you can access it by opening your web browser and navigating to http://your_server_IP_address. You will see the WordPress installation wizard where you can set up your website.

Congratulations! You have successfully installed WordPress on CentOS 8.

Refer A Friend
Get $25

Installing WordPress on CentOS 8
WordPress installation on CentOS 8
CentOS 8 WordPress installation
Install WordPress on CentOS 8
Installing WordPress on CentOS
How to install WordPress on CentOS 8
CentOS 8 WordPress setup
PHP installation on CentOS 8
Apache installation on CentOS 8
MySQL installation on CentOS 8

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.