Install WordPress on a CentOS VPS

wordpress-logoToday we will show you how to install WordPress on a Centos VPS using Apache web-server and MySQL database.

WordPress is a web software you can use to create a beautiful website or blog. An open source CMS, WordPress is often used as a blog publishing application powered by PHP and MySQL. Currently it is the most popular of the blogging platforms available.

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


We are using our 1 VPS hosting plan for this tutorial.


First make sure your CentOS VPS is fully up-to-date using the command below:

# yum update


Enter a directory by your choice and download WordPress. For our purpoces we are using the /opt directory.

# cd /opt

Install wget and unzip that are needed for the installation further:

# yum install wget unzip

Download WordPress using the wget command:

# wget

Install php-gd in order to work with images, install plugins etc…

# yum install php-gd


Enter MySQL as root:

# 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

Now we will unzip the WordPress zip file in the /var/www/html/ directory.

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

Set the proper permissions:

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

We need to create the upload directory manually:

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

Allow the Apache web server to write to the uploads directory. Do this by assigning group ownership of this directory to your web server which will allow Apache to create files and directories. Issue the following command:

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

Enter the WordPress directory:

# cd /var/www/html/wordpress/

Rename wp-config-sample.php into wp-config.php:

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

Open the WordPress configuration file with your favorite text editor and change the database values with the ones you gave at the time of the database creation.

# 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’);

Now you can finish your WordPress installation by opening your favorite web browser and navigate to: http://your_ip_address/wordpress/wp-admin/install.php

Install WordPress on a CentOS VPS
Written by: AFRIDA YANTI
Reting: 4.9

Cheap Best Hosting is a leading provider of web hosting, shared hosting, resellers hosting, virtual private servers, vps hosting, dedicated servers and domain name registration.

Follow me on Google+ | Twitter | Facebook | Linkedin | YouTube

Share This Post

Recent Articles

Leave a Reply

© 2019 Cheap Best Hosting Blog. All rights reserved. · Entries RSS · Comments RSS
Hosting By Cheap Best Hosting