How To Install WordPress On CentOS 7



WordPress is a free and open-source content management system (CMS) based on PHP and MySQL. WordPress is installed on a web server, which either is part of an Internet hosting service or is a network host itself; the first case may be on a service like, for example, and the second case is a computer running the software package An example of the second case is a local computer configured to act as its own web server hosting WordPress for single-user testing or learning purposes. Features include a plugin architecture and a template system. WordPress was used by more than 26.4% of the top 10 million websites. WordPress is reportedly the easiest and most popular blogging system in use on the Web, supporting more than 60 million websites.

Before we going to install we must install LAMP STACK. You can get the detailed instructions to install Lamp stack from here:How to install LAMP Stack in Linux

Now create the WordPress database as follows

[root@localhost ~]#  mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 834
Server version: 5.6.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
| Database           |
| information_schema |
| mysql              |
| performance_schema |
3 rows in set (0.02 sec)

MariaDB [(none)]>  create database wordpress;
Query OK, 1 row affected (0.01 sec)

MariaDB [(none)]> grant all privileges on wordpress.* to wordpress@'localhost' identified by 'password';
Query OK, 0 rows affected (0.02 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit

Now Download the Latest version of WordPress from their official site.


Now unzipp the package by using the following command.



After Completion of, We get a new folder wordpress copy this folder to /var/www/html folder as follows

[root@localhost ~]# cp -rf wordpress/ /var/www/html/

Now change the permissions by running the following commands as follows

[root@localhost ~]# cd /var/www/html/
[root@localhost html]# ls
chamilo  wordpress
[root@localhost html]# chmod -R 775 wordpress
[root@localhost html]# chown apache:apache wordpress
[root@localhost html]#

Now Open the browser open the following URL: http://localhost/wordpress

Sample Output:


Now click on Let’s go button and input the values as follows



Now copy the code into wp-config.php file and then press Run the install

Then restart the httpd service as follows

systemctl restart httpd

wordpress-window4In this window input the site name , username ,email address, password etc.

Now you will get the Success window as follow


After that we will get wordpress site as follows


Now Enjoy WordPress in your Linux Machine. For more articles signup for news letter.


Previous articleHow To Install Nginx on CentOS 7
Next articleDrupal installation on Linux
This is Naga Ramesh Reddy from Bangalore (India).I have 4+ years of experience in System and Network Administration field. I like to read and write about Linux, Cisco, Microsoft and DevOps technologies and the latest software releases. Particularly I am very interested about Linux flavors like Centos, RHEL, Ubuntu and Linux Mint.