WordPress is a great Content Management System that powers a lot of websites and blogs online. CMSs are made of scripts that allows website owners or webmasters to manage their sites easily.

WordPress relies on other servers and scripts to function. Without these technologies, WordPress is nothing but fancy scripts.

This blog post is going to show you how to run WordPress in CentOS using Nginx, MariaDB and PHP. These different servers and scripts allows for WordPress to function.

This post assumes that you already have CentOS installed and ready. It also assumes that you have root access to the server via SSH. If everything is correct, continue below to begin.

Installing Nginx Webserver in Centos

The first thing we’re going to be installing it Nginx. Nginx is a powerful webserver that has been gaining grounds lately. It’s fast, efficient and handle increased web traffic using less resources.

The most popular webserver is Apache, but we’re using Nginx because it has worked well for our WordPress blog.

To install Nginx in CentOS run the following commands to create Nginx repository file in CentOS.

vi /etc/yum.repos.d/nginx.repo


Then copy and paste the lines below into the file and save it.

name=nginx repo


When you’re done, run the commands below to install Nginx.

yum install nginx



Installing MariaDB in CentOS

The next server to install it MariaDB or MySQL database server. WordPress cannot function without a database server. To install MariaDB in CentOS, run the commands below to create MariaDB repository file.

vi /etc/yum.repos.d/mariadb.repo


Then copy and paste the lines below into the file and save it.

name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64


Next, run the commands below to install MariaDB and MariaDB client.

yum install MariaDB-server MariaDB-client


After installing MariaDB, run the commands below to create a root password for MariaDB. There are other security options you can also choose.



If the above command doesn’t run, start MariaDB, then rerun it.

service mysql start



Installing PHP and other required scripts

Finally, we’re going to install PHP and other scripts that will allow WordPress to function. To do that, run the commands below.

yum install php php-cli php-common php-xmlrpc php-mysql php-gd php-fpm 


Now that all the required servers and scripts are installed, it’s now time to configure each one of them. The first area to consider is Nginx. By default, Nginx installs its configuration files in the /etc/nginx directory. Next, we’re going to configure MariaDB and create a database for WordPress.

Finally, we’ll configure all other PHP settings that will allow WordPress to function properly


All of the configurations will be done in our next post. Please stay tuned.