How To Install WordPress (CMS) on Ubuntu 16.04

Spread the love

WordPress is an open source content management system. It can be used simple or large organization. WordPress include many features like as Publish with Ease, Publishing Tools, User Management, Media Management, Full Standards Compliance, Easy Theme System, Extend with Plugins, Built-in Comments, Easy Installation and Upgrades etc. Another features for developer like as Plugin System, Theme System, Application Framework etc.

⇒ How To Install Ubuntu 16.04

⇒ How To Enable Root SSH Login

Step #01: Now update and upgrade command below.

[email protected]:~#  apt-get update && apt-get upgrade -y

Install apache web server with command line below.

[email protected]:~# apt-get install apache2 apache2-utils

Enable apache web server

[email protected]:~# systemctl enable apache2

Start apache web server

[email protected]:~# systemctl start apache2

Step #02: Install Mysql database server and client.

[email protected]:~# apt-get install mysql-client mysql-server -y

When mysql installation process is running then type mysql root password two times.

Run mysql source installation process command for change some settings.

  [email protected]:~# mysql_secure_installation 

Enter password for user root:
Press y|Y for Yes, any other key for No: y
Change the password for root ? (Press y|Y for Yes, any other key for No) :
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

Step #03: Install php update version with command below.

[email protected]:~# apt-get install php7.0 php7.0-mysql libapache2-mod-php7.0 php7.0-cli php7.0-cgi php7.0-gd

After installation process completed then test your server configuration is ok. Create php info file.

[email protected]:~#  vi /var/www/html/tech.php

Insert below php code into tech.php file.

<?php phpinfi() ; ?>

Restart your apache web server then goto your browser type your server IP address. If you can see php server details then all is ok.

Example below:


Step #04: Download wordpress latest version via wget command.

[email protected]:~#  wget -c

Extract downloaded file

[email protected]:~#  tar -xzvf latest.tar.gz

Move all file into www directory via below command.

[email protected]:~#  rsync -av wordpress/* /var/www/html/

Create permission into www directory

[email protected]:~#  chmod -R 755 /var/www/html/

Change ownership for www directory

 [email protected]:~#  chown -R www-data:www-data /var/www/html/

Step #05: Create database for store all data into your mysql database.

[email protected]:~#  mysql -u root -p

Type mysql root password previously created.

mysql> create database wp;
mysql> grant all privileges on wp.* TO 'tech'@'localhost' identified by 'passw0rd';
mysql> flush privileges;
mysql> \q

Goto your www directory for include database information into your wp-config.php file.

[email protected]:~#  cd /var/www/html

Copy or move wp-config-sample.php file name as wp-config.php

[email protected]:/var/www/html#  mv wp-config-sample.php wp-config.php

Now open  wp-config.php file. Then insert below information like as.

define('DB_NAME', 'Database_Name');
define('DB_USER', 'Username_Here');
define('DB_PASSWORD', 'Password_Here');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

Save and exit.

Press Exc :wq press Enter.

Step #06: Apache web server restart

[email protected]:/var/www/html#  systemctl restart apache2.service

Mysql server restart

[email protected]:/var/www/html#  systemctl restart mysql.service 

Remove default index.html file.

[email protected]:/var/www/html#  rm -rf index.html

Server configuration all is ok. Now goto your browser and type your server IP address for start installation WordPress.


Now configure WordPress installation process from web gui.

Step #07: Select your using language then click Continue button. Example below:


Step #08: Now popup wordpress welcome page. Create your web login details like as user name, password and email address then click Install WordPress button. Thus follows example below:


Step #09: All settings are ok then show Success message.


WordPress hass been installed. Thank you, and enjoy! 🙂

Click login button and show login form. Type previously created user name and password and then click login button.



Step #10: Login successfully then see WordPress Dashboard like as below example.


My another post

How to fix wordpress permalinks not working 404




  • Author Posts
Author Details
Network Administrator
I am system administrator as Windows and Linux platform. I have 2 years skilled from professional period. I have to configure Linux based system such as an Asterisk VOIP system, Network monitoring tools (ZABBIX), Virtualization (XEN Server), Cloud computing (Apache CloudStack) etc. Now share my professional skill each interested person. Thanks to all.

Related Topics

Leave a Reply

Be the First to Comment!

Notify of