Installing WordPress on Ubuntu

Install wordpress package:
$ sudo apt-get install wordpress

Enter in mysql prompt:
$ mysql -u root -p

Create a wordpress user:
mysql> grant all privileges on *.* to wordpress_user@localhost;

Set a password:
mysql> set password for wordpress_user@localhost = PASSWORD(‘yourpass’);

Create your database:
mysql> create database wordpress_mad;

Flush it:
mysql> flush privileges;

Add to /etc/apache2/apache2.conf :

# wordpress
Alias /blog /usr/share/wordpress
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php

Remove wp-config.php link:
# rm /usr/share/wordpress/wp-config.php

Move config sample to original wp-config:
# mv /usr/share/wordpress/wp-config-sample.php /usr/share/wordpress/wp-config.php

Edit /usr/share/wordpress/wp-config.php and replace database variables with these ones you created.

In your web-browser access:

Just choose a name and go on!

16 thoughts on “Installing WordPress on Ubuntu

  1. I tryed to setup the wordpress from alot of people but could not get it. Maybe im expecting more work or programming to make it work. Your install was far more easy than the others and worked first time..

    Great job.

  2. Hi Thx very much,

    this was the first helping documentation that make me work wordpress on Ubuntu in 15 Minutes


  3. Again, thank you very much. Lots of incomplete tutorials out there, but this one is very nice. Appreciate it.

  4. These instructions are excellent.

    After I installed LAMP “sudo tasksel install lamp-server”, I followed your instructions and it worked really well.
    My only issue was that my blog installed to, and I realised this when I restarted Apache2.

    Again, well done, there are are many sites out there that supposedly show you how to do this but this is the best and most succinct one I’ve seen.


  5. thanks man – this has given me something i’d not had up until now .. and for that you are to be thanked.


  6. Unfortunately, it didn’t help me. 😦
    I’ve followed every single step and I get “The connection was refused when attempting to contact” when trying to connect to
    What could be the problem?

  7. Another satisfied customer – thank you very much!

    One additional question – if I try to install a new theme, I need to supply a hostname. I tried “localhost”,, etc. but got a “failed to connect: message – is the installer assuming I already have a hosting provider available? I don’t, I am just running it locally for now. Maybe I just need ftp running locally?

Leave a Reply to skippy2057 Cancel reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s