How to install WordPress in Ubuntu?

WordPress can be easily installed in your Ubuntu machine. If you want to manually install wordpress from scratch, you can refer the post on how to install wordpress in Localhost. Let’s take a look into the procedures. As you know WordPress works on LAMP (Linux Apache MySQL and PHP). WordPress can also work in Windows based machines.

Let’s take a look into the procedure for installation

1. Install the mysql-server

$ sudo apt-get install mysql-server

2. The second step is to install the wordpress.This can be easily done by the following command

$ sudo apt-get install wordpress

The above command installs PHP, MySQL and Apache and starts the apache server as well. The wordpress is installed in the /usr/share directory. Let’s check this by checking the contents of the wordpress package.

$ dpkg -L wordpress



3. Apache makes use of the web pages available in the /var/www directory. So the next step to do is to create a symbolic link to the above directory

$ sudo ln -s /usr/share/wordpress /var/www/wordpress

4. Now you have to create the setup: setting up database and creating the configuration files. The best part is that you can easily do it by the following command. All you need to do is to specify the database name of your choice and the hostname

Here, we are using the database name as wordpress and the hostname as localhost.

You can choose any name. The hostname can be the name of your website for which you are following this post

$ sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost

5. All the setup will be complete by the above command. Now you have to restart the apache server

$ sudo /etc/init.d/apache2 restart

6. Go to your browser and specify the following address


Note that if your hostname is not localhost, you have to type the following address


7. Enter your blog name and title and save the user name and password you get

8. Login with the credentials you got from the previous step


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s