How to Install WordPress on CentOS VPS


This time we will show you how to install WordPress on your Centos VPS using Apache Web-servers and MySQL database. WordPress is a web software which can be used to create a website or blog. Open source CMS, WordPress is often used as a blog publishing application powered by PHP and MySQL. Currently the most popular blogging platforms available.


Before you start the installation, make sure that you have LAMP installed on your server. If not, follow a very good tutorial on installing LAMP (Linux Apache, MariaDB & PHP) on CentOS VPS.

SYSTEM UPDATE: first make sure your CentOS VPS uses the latest version of the update by using the command below:

# yum update

WORDPRESS SETUP: enter the directory with your choice and download WordPress. For our purposes, we use the/opt directory.

# cd /opt

Install wget and unzip needed for further installation:

# yum install wget unzip

Download WordPress using wget command:

# wget

Install php-gd to work with images, install the plugin etc.

# yum install php-gd


# mysql -u root -p

mysql> CREATE DATABASE wordpress;
mysql> GRANT ALL PRIVILEGES on wordpress.* to ‘wpuser’@’localhost’ identified by   ‘your_password’;
mysql> exit

Restart MySQL:

# systemctl restart mysqld.service

We will now unzip the WordPress zip file in the directory/var/www/html/

# unzip -q -d /var/www/html/

Set the appropriate permissions:

# chown -R apache:apache /var/www/html/wordpress
# chmod -R 755 /var/www/html/wordpress

we need to create the directory manually upload:

# mkdir -p /var/www/html/wordpress/wp-content/uploads

let the web server Apache to write to the directory upload. Do this by setting the Group ownership of this directory to your web server which will allow Apache to create files and directories.

# chown -R :apache /var/www/html/wordpress/wp-content/uploads

Run the following command:

# cd /var/www/html/wordpress/

Rename URwp-config-sample.php to become URwp-config.php:

# mv wp-config-sample.php wp-config.php

open the WordPress configuration file with your favorite text editor and change the value of the database with which you provided at the time of the making of the database.

# vim wp-config.php

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘wordpress’);

/** MySQL database username */
define(‘DB_USER’, ‘wpuser’);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘your_password’);

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);



This site uses Akismet to reduce spam. Learn how your comment data is processed.