Search our database

How To Install WordPress In Centos

You need to have a LAMP ready server to install WordPress into your Centos server. Read more: How to Setup LAMP Configuration on Centos.


Step 1 – You need to create a database and user account in MySQL for WordPress. Login to your MySQL using the username and password created earlier by running the command below:

mysql -u root -p


Step 2 – After you have successfully logged in, you can now create a database, a new user and its password. ALL MySQL commands MUST end with a semicolon.

To create a database:

To create a new user:

To create a password for the user:


Step 3 – You can then grant the user all privileges for the database by running the command below:



Step 4 – Flush to refresh MySQL and its configuration. You have successfully created a database for WordPress use.

mysql> Flush Privileges;


Step 5 – Download the latest WordPress installation file into /usr/local/src and extract them. If you do not have wget installed in your server, you can do so by running “yum install wget”.

cd /usr/local/src
tar -zxvf latest.tar.gz


Step 6 –  Edit the WordPress’s config file to link the MySQL database that we have created earlier to the WordPress CMS.

cd /usr/local/src/wordpress
cp wp-config-sample.php wp-config.php
vi wp-config.php



Step 7 – Copy all WordPress files into httpd root folder.

cp -r /usr/local/src/wordpress/* /var/www/html


Step 8 – We have to install additional php module.

yum install php-gd


Step 9 – Change owner on ‘wp-content’ and ‘wp-admin’ folder to enable file upload and themes/plugins customisation

chown -Rf apache /var/www/html/wp-content
chown -Rf apache /var/www/html/wp-admin


Step 10 – Restart httpd service.

service httpd restart


Now you can access your WordPress by typing http://your-ip-address-here into your browser’s address bar.


Affordable but Powerful Cloud Hosting Package

Check out IPServerOne’s Cloud Hosting Packages.
Contact us @ +603-6259-5625 or email @

Tags: , , , , , ,