How To Install WordPress in Ubuntu Server 12.04 LTS

Install the LAMP Server (Linux,Apache, Mysql, PHP) with the command below:

sudo apt-get install lamp-server^

It will prompt for mysql server root password, enter the root password:

Confirm mysql server root password:

Move to the tmp directory and download the latest version of wordpress there:

cd /tmp

Use this command to unpack the WordPress files:

tar -zxvf latest.tar.gz

To start the MySQL command-line client, use this command:

mysql -u root -p

Create a wordpress database and granting all privileges to the wordpress user on that database:

GRANT ALL PRIVILEGES ON wordpress.* TO wpuser@localhost IDENTIFIED BY 't*n***';

Note: In this tutorial, wpuser will be used for wordpress.

Move to the extracted wordpress directory and change the name of the config file from wp-config-sample.php to wp-config.php and then edit the wp-config.php file:

cd wordpress/
mv wp-config-sample.php wp-config.php
nano wp-config.php

Insert your MySQL settings that you have just created:

Now move all WordPress files to /var/www/ directory:

sudo cp -r * /var/www/

Change the ownership of /var/www directory to www-data:

sudo chown -R www-data /var/www

Move to the /var/www/ directory and check the permission:

cd /var/www/
ls -l

Open up the browser and go to http://hostname/wp-admin/install.php  to begin configuring WordPress:

To resolve this error, enable the php module and restart the apache service:

sudo a2enmod php5
sudo /etc/init.d/apache2 restart

Refresh the browser and fill all the information, and then click Install WordPress:

Login to the admin section:

Enter the username and password, that you have configured during the installation:

Congratulations!  smiley

Hope this will help you!

Please Remember me in your prayers!

Enjoy :-)

2 responses to “How To Install WordPress in Ubuntu Server 12.04 LTS

  1. sahil khanna April 25, 2013 at 8:53 pm

    I have a question, if you may answer. I want to host a wordpress website and suddenly had a thought about why not hosting it on ubuntu server on my laptop or desktop but then not getting the info i need, i can understand installing wordpress on ubuntu server but does that mean i have to keep my laptop or desktop swtich on for 24 hours and also is it same as hosting taken from godaddy and all. ?? please explain this as that may help me.

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

%d bloggers like this: