Install WordPress in ubuntu 16.042 min read

In this document we will show you how to install and configure  WordPress  in ubuntu 16.04.


Make sure that you have Ubuntu 16.04 server install.

You should have root access to server.

Install wordpress in ubuntu 16.04

First we will update the server

apt-get update

Next we will install our webserver apache

sudo apt-get install apache2

Install the following dependencies package need for wordpress installation.

sudo apt-get install curl ; apt-get install mysql-server

During mysql installation it will ask for root user password. Enter the password and confirm the same
apt-get install php libapache2-mod-php php-mcrypt php-mysql ; apt-get install php-cli

Create a file called /var/www/html/info.php and enter the following inside the file.


save and exit

Once its done goto browser and check all the dependencies are installed or not. It will show you the following output.


Once all the dependenices are installed then remove the /var/www/html/info.php file due to security reasons.

rm /var/www/html/info.php

Next download latest wordpress

wget -c
tar -xzvf latest.tar.gz

Move the wordpress files to webserver location

sudo rsync -av wordpress/* /var/www/html/

Now we will give correct permissions and ownership to the wordpress files.

chown -R www-data:www-data /var/www/html/

chmod -R 755 /var/www/html/

Now we will create database for wordpress

Login to wordpress as root user.

mysql -u root -p

GRANT ALL PRIVILEGES ON site.* TO ‘your_username_here’@’localhost’ IDENTIFIED BY ‘your_chosen_password_here’;

Configure the created database in the wordpress configurtion files.
cd /var/www/html
mv wp-config-sample.php wp-config.php

And configure same details in below mentioned lines in wp-config.php file.

define(‘DB_NAME’, ‘database_name_here’); /** MySQL database username */ define(‘DB_USER’, ‘username_here’); /** MySQL database password */ define(‘DB_PASSWORD’, ‘password_here’); /** MySQL hostname */ define(‘DB_HOST’, ‘localhost’); /** Database Charset to use in creating database tables. */ define(‘DB_CHARSET’, ‘utf8’); /** The Database Collate type. Don’t change this if in doubt. */ define(‘DB_COLLATE’, ”);


Once all these configuration Done , restart all the services
/etc/init.d/mysql restart

/etc/init.d/apache2 restart

Then open web browser and browse your IP address. Enter all the details. Enter the database,user, password, host details as you mentioned above.

install wordpress in ubuntu 16.04You can start creating the website  or Blogging design.


Prabhin Prabharkaran Administrator
DevOps Engineer

He is a Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!

follow me
We need your support!!
Other Amount:
Questions Answered
Articles Written
Overall Points

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

You may also like...

9 Responses

  1. I every time emailed this websit post pagge too all my contacts, as if like to read
    it next my links will too.

  2. wordpress says:

    Hello mates, how is all, annd what you want to say regarding this paragraph, in my view its iin fact amazing in favor of me.

  3. Hi there this is kind of of off topic but I was wanting to know if blogs usee WYSIWYG editors or iif you have to manually
    ode wjth HTML. I’m starting a blog soon but have no coding expertise
    so I wanted to get advice from someone with experience.
    Any help wohld be greatly appreciated!

    • prabhin says:

      Techrunnr is ready to help you on this,

      Let us what issue you are facing. For setting up a blog doesn’t need coding expertise. You can choose wordpress for that as it is easy to setup and implement.

  4. Fantastic blog! Do you have any hinnts for aspiring writers?
    I’m planning to start my own blog soon but I’m a lkttle lost on everything.
    Would you propose starting with a free platform llike WordPress or go for a paid option? Therde are so many choices out there that
    I’m totally overwhelmed .. Any tips? Thanks a lot!

    • prabhin says:

      I never support for paid software, I always prefer open-source. So I recommend you to use wordpress platform for blogging. For any support techrunnr is here.

  5. Hi there everyone, it’s my first visit at this site, and article is genuinely fruitful for
    me, keesp up posting these articles.

  6. wordpress says:

    These are rreally wonderful ideas in concerning blogging.
    You have touched some pleasant things here. Anny way
    keep up wrinting.

Leave a Reply