How To Install WordPress in Ubuntu Server 12.04 LTS

In How To

WordPress is a free and open source blogging tool and a dynamic content management system (CMS) based on PHP and MySQL. It has many features including a plug-in architecture and a template system. WordPress is used by over 14.7% of Alexa Internet’s “top 1 million” websites and as of August 2011 manages 22% of all new websites. WordPress is currently the most popular CMS in use on the Internet. It was first released on May 27, 2003, by Matt Mullenweg as a fork of b2/cafelog. As of December 2011, version 3.0 had been downloaded over 65 million times – Wikipedia

Currently, the Latest version of WordPress is available in Official Ubuntu Software repository, Follow instructions how to install Wordpress in Ubuntu Server 12.04 LTS Precise Pangolin

How to install Wordpress in Ubuntu Server 12.04 LTS Precise Pangolin

Step 1. Install LAMP server on ubuntu server, to install LAMP Server in Ubuntu server 12.04 you can follow instructions @LAMP Ubuntu Server 12.04 LTS

Step 2. If you do not have a problem when installing lamp server in ubuntu server 12.04, we proceed to install wordpress

sudo apt-get install wordpress

Step 3. Make a symbolic link to the Apache2 directory /var/www/ , The wordpress installation placed in directory /usr/share/wordpress folder

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

Step 4. install WordPress with the supplied script, the script placed in directory /usr/share/doc/wordpress/examples/. 

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

After execute this script, it will creates the MySQL database and user wordpress for the new MySQL database named localhost. If you have installed virtual host on server and/or already know your URL, it is best to name your database the same as your URL. Also if you plan on hosting multiple blogs with different virtual hosts, each needs a differently named database.

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

Step 5. For automatic updates to occur, the folder and all its files and subfolders wordpress must be owned by www-data:

chown -R www-data /usr/share/wordpress

Now, open your web browser to install wordpress, type on address bar http://localhost/wordpress

Install wordpress Manually in Ubuntu server 12.04

if you want to install latest wordpress manully on ubuntu server,you can follow instructions below

Login on your ubuntu server,login as root

sudo -i
wget -O wordpress.tar.gz
tar -zxvf wordpress.tar.gz
cd wordpress
cp -R wordpress /var/www
chown -R www-data /var/www/wordpress

Log in to mysql server as root user

mysql -u root -p

Create database with command below,in case we’ll create database with name “dbwordrpess”

CREATE DATABASE dbwordpress;

Create a new user of username wordpressuser, with command below

CREATE USER wordpressuser;

Create password “wppassword” for user “wordpressuser”;

SET PASSWORD FOR wordpressuser = PASSWORD("wppassword");

Grant user wordpressuser all permissions on the database.

GRANT ALL PRIVILEGES ON dbwordpress.* TO wordpressuser@localhost IDENTIFIED BY ‘wppassword’;

Log out from mysql server


Now wordpress ready to install..

install wordpress


Tags: #Apache #Ubuntu Server 12.04 #Wordpress

How to Upgrade Ubuntu Server 12.04 to Ubuntu Server 14.04 LTS
How to Upgrade Ubuntu Server 12.04 to Ubuntu Server 14.04 LTS
This tutorial will describes how to upgrade
  • Guillermo Garron

    Install WordPress is really an easy task. 
    With this guide nobody will get lost doing that.

    I’ve written a guide to install it using Nginx, PHP-FPM and using APC for cache.

    And also tested performance of Nginx and Apache with wordpress. And they both performs more or less the same with the help of APC for logged users, and Varnish for anonymous ones.

    • Mr Helpful

      The first part of the article works until you try looking at the wordpress server from a different computer, only some graphics come up and the wp-admin login doesn’t show. Also, for the 2nd part, (manual install-3rd line down it should be tar -zxvf latest.tar.gz NOT tar -zxvf wordpress.tar.gz

      • Mr Helpful

        Oh, and just one last edit do not do the 4th line cd wordpress. In order to copy everything recursively (5th line) you can’t be in that directory. Other than that this was a huge help as I now have the manual method working so thank you.

  • Pingback: WordPress on Precise (Server) « 0ddn1x: tricks with *nix()

  • Thinnakorn

    Unable to create directory /srv/www/wp-uploads/localhost/2012/05. Is its parent directory writable by the server? 

  • Newbee

    This didn’t work for me neither

  • Pingback: Tech Info - Best WordPress Hosting 2012 – InMotion Hosting – Yahoo! News()

  • Frank

    This doesn’t work. I suspect that Apache/PHP need some tinkering at a minimum.

  • Giulio Jiang

    fantastic tutorial! The manual tutorial works, except one command
    GRANT ALL PRIVILEGES ON dbwordpress.* TO wordpressuser@localhost IDENTIFIED BY ‘wppassword’;
    doesn’t work but
    GRANT ALL PRIVILEGES ON dbwordpress.* TO wordpressuser@localhost IDENTIFIED BY “wppassword”;
    does. Thanks!

    • Farid Ghanchi

      Yes you are right Thanks

  • Jay

    Everything works fine until you get to the browser pointed at localhost. If you are installing to server there is no UI and no browser.

  • Will

    It looks like you need to restart Apache in order for the PHP modules to get loaded…

  • Will

    Oh, and it looks like it was trying to look for a /etc/wordpress/config- file, but all I had was -localhost. I just symlinked it to what it was looking for. Hope that helps.

  • OldManKris

    I had to do this to let WordPress update the .htaccess file:

    sudo chown www-data /etc/wordpress/htaccess

  • Amit

    Very nice tutorial.

  • shrinkray

    I’ve had issues with this install. It changes how WordPress 3.5.1 is setup. The site was OK until I added a theme to the site and my install failed. I don’t think this is a usable solution for a highly customized theme.

  • Farid Ghanchi

    Nice Your Post

  • :/

    it doesnt work when installing to amazon ec2, bad guide :/

    • Chris

      If you install something on EC2, then you are probably an expert and don’t need basic tutorials like this. There’s no need for you to use EC2 if you are an amateur who needs this tutorial.

  • htftygt

    not work manually it create database error

  • jbantifem

    Wrong. Every time I try this the wp-config and many other files don’t even exist.

  • b.s. bisht

    This is good and informative post. it will help many users.To read another very good article illustrating easy
    steps to install wordpress with proper images is available here


  • Jonas Russel Green

    Just to be complete: Before step 4 on ubuntu 12.1 i needed to
    gunzip /usr/share/doc/wordpress/examples/setup-mysql.gz

Must read×