WordPress Installation on Ubuntu with LAMP

This tutorial is how to install WordPress on Ubuntu Linux Desktop using LAMP. Why ? One reason is that you can do a lot of developing (playing around) much quicker as there is no need to use ftp. If You like me, play around with WordPress as a developer (perhaps you create your own theme or plugin), you should install WordPress locally in your Ubuntu Linux Desktop.

You do not need to convert your Ubuntu Desktop into Ubuntu Server. You only need install addition packages that you need to run WordPress on your Ubuntu Linux desktop.

Get ready?! Let?s start to install WorPress on Ubuntu Linux desktop.

Install LAMP

You can view my previous post about LAMP Installation On Ubuntu, if you have not already done so.

Download WordPress

You can download WordPress from their official website into your Ubuntu desktop.

Extract your WordPress archieve into your server directory

sudo tar zxvf wordpress-x.x.x.tar.gz --directory=/var/www/

Prepare MySQL Database for WordPress

Create a database for WordPress on your Ubuntu, as well as a MySQL user who has all privileges for accessing and modifying it. You can use phpMyAdmin to make it easier ;)

  • First create dababase: wordpress
  • Then create a new user: wordpress with password: wordpresspassword

Write down the values you used for databasename, wordpressusername, hostname, and password for future purpose ;)

Configure WordPress Setting

Copy the wp-config-sample.php file to wp-config.php. Open and edit wp-config.php file

// ** MySQL settings ** //
define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpress');
define('DB_PASSWORD', 'wordpresspassword');
define('DB_HOST', 'localhost');

Run the Install Script

Using your favorite web browser (Firefox by default), visit wp-admin/install.php within the directory into which you just installed WordPress on your web site. For example: point your browser to http://localhost/wordpress/wp-admin/install.php
.

Preview your New WordPress

Point your browser to http://localhost/wordpress.

Well done! You have your own WordPress on Your Ubuntu Linux Desktop.

:D Happy New Year!

Share and Enjoy:

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • BlinkList
  • co.mments
  • del.icio.us
  • digg
  • DZone
  • Furl
  • Ma.gnolia
  • NewsVine
  • RawSugar
  • Reddit
  • Shadows
  • Simpy
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • YahooMyWeb
 

Related Posts


43 Responses to “WordPress Installation on Ubuntu with LAMP”  

  1. a gravatar 1 G. Chai

    If you’ve come this far, you can have the following in your /etc/hosts:

    127.0.0.1 localhost yourblog.com

    Now when you try http://yourblog.com in your browser, you will be served from your local server (wordpress installation). In fact, you could configure (in Options section of) your local wordpress installation WordPress address (URI) and Blog address(URI) as http://yourblog.com

    Of course, when you want to refer to your blog which is not local, you will type http://www.yourblog.com

  2. a gravatar 2 kus

    apakah tutorial membuat databank sql merupakan tutorial terpisah?

    kupikir ada baiknya disertakan, dan oh iyah untuk pengguna pemula kayak aku mungkin lebih suka dengan tutorial pake gui nya saja.

  3. a gravatar 3 Anirudh

    Well, I’ve done a similar thing on my debian system but there’s one small problem, the php function mail() is invoked which doesen’t work. You can also mention that you can export your database with your webhost phpmyadmin, and you can install it in your local machine
    apt-get install phpmyadmin
    sudo apt-get install phpmyadmin (#ubuntu)

    That’ what I’ve done and then pull out bluefish and hack away at the code.

  4. a gravatar 4 William

    The extraction of WordPress didn’t work for me at first using
    “tar zxvf wordpress-x.x.x.tar.gz –directory=/var/www/”.

    By prefacing the command with “sudo” it worked first time.

  5. a gravatar 5 supriyadisw

    Hi William, thanks for ur correction. Thanks a bunch!

  6. a gravatar 6 elitz

    I wonder if I can do the exact same thing in SLES10, without phpmyadmin. I want to install WP on our office. Any advise?

  7. a gravatar 7 tyleestuff

    Hi, and let me first say thank you for the wonderful tutorial. When I try to run the install script it comes up with a page that says:
    Your PHP installation appears to be missing the MySQL which is required for WordPress.

  8. a gravatar 8 supriyadisw

    Hi tyleestuff, you should install MySQL first. Please view my post about MySQL installation in LAMP Installation On Ubuntu.

    Have a great day and gud lak!

  9. a gravatar 9 Tyler

    Awesome. Helped me A LOT!

  10. a gravatar 10 Silveira Neto

    Nice.
    I’m having a trouble: “Your PHP installation appears to be missing the MySQL which is required for WordPress.”.
    Don’t know if is php that can’t login in mysql, or is a mysql-php binding problem…

  11. a gravatar 11 The+Gas+Grill

    Hello your post is delightful. I will definitely read your blog.. bye

  12. a gravatar 12 Seatowngrrl

    I totally need to do this. This tutorial sounds exactly like what I need. I like to mess around with my themes alot and it would be great if they broke on a local copy instead of one that can be seen by the masses (ok so my boyfriend is the only one that looks at it but thats just a tiny detail)

    Anyway, thanks for the tutorial.

  13. a gravatar 13 Brian

    Problem: I can access the blog from my home internet connection, as it points to 192.168.0.6 ( a local address). However, I can’t view it froma public internet connection outside of my house no matter what address I use in the wp-config.php file, I get an error(http://www.joinerfam.us/blog/wordpress/). Any suggestions?

  14. a gravatar 14 Ken

    Had to grant access to wordpress database inside MySQL by issuing command:

    grant all on wordpress.* to wordpress;

    (DB is wordpress and user is wordpress ;^)

  15. a gravatar 15 Mel B

    I have copied your instructions for installing wordpress and Lamp on Ubuntu. I was wondering since I have (XAMPP) installed if you could have a tutorial for installing wordpress using xampp?
    http://www.apachefriends.org/en/xampp.html it istalls the following:

    XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.

    Is it feasable? I am pretty new at this and any help would be appreciated. I could really use wordpress installed on my local machine for testing also joomla and geeklog as I run several website and use all 3 of them.
    Mel B

  16. a gravatar 16 supriyadisw

    Brian: You can not access your local server from public internet connection useless you put your server on public IP. You can access your local server from your internal internet only. CMIIW

    Mel B: Thanksfor your suggestion. I will explore this stuff. Gud lak for you ;)

  17. a gravatar 17 Mel B

    Hello Supriyadi
    Everything works with Lamp so far, But after I install wordpress and get to the part to create a Data Base I am lost. I can’t seem to start the (phpMyAdmin) I don’t know how. I have tried in the browser and from the command line. any help would be appreciated.
    Thank you
    Mel B

  18. a gravatar 18 supriyadisw

    Mel B: First you should make sure that your mysql server was running, try to type:

    sudo /etc/init.d/mysql status
    

    or you can type instead:

    sudo /etc/init.d/mysql restart
    

    Then you can create a new database your your wordpress, eg.

    mysql -u root [enter]
    mysql> create database wordpress;
    

    Gud lak…

  19. a gravatar 19 Mel B

    supriyadisw Thank You Thank You! I finally got it working and was able to bring up the Mysql and create a data base. Thanks again for a fine tutorial even a novice like me managed with a little help from you. Thanks again
    Mel B

  20. a gravatar 20 JJMacey

    Hi,

    I’ve got several Joomla! Sites, and SMF Forums hosted. As well as, a WordPress Blog.

    I’ve got LAMP running on my Linux Mint PC. I can show Apache, PHP, and MySQL going. Linux Mint is Ubuntu with a lot of add-ons. Check it out.

    I’ve run into a problem. Using Firefox I can launch phpmyadmin create a new “wordpress” database, but need to add a name for a Database, and the # of fields.

    I can send you an ImageShack photo of what happens if you would like.

    It has been a while since I have run LAMP on my machine, as I have gone to hosted services. However, to play with WordPress I think that I need to run it locally.

    I think that you know what I mean.

  21. a gravatar 21 Mel B

    Hello supriyadisw
    I have another question. Everything is working fine using Localhost/mywordpress in my browser. my machine is on my home network with 2 other computers. I would like to be able to access wordpress from one of the other computers on my local network I type in 192.168.0.56 which is the IP address that has wordpress on it. so I type 192.168.0.56/mywordpress and get the following error
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/mywordpress/wp-content/themes/beautiful-sunrise-10/functions.php:72) in /var/www/mywordpress/wp-includes/pluggable.php on line 391

    line 391 is: header(”Location: $location”);
    I also have joomla installed on the same machine and I can access it using 192.168.0.56/myjoomla why can’t I access wordpress?
    Thank You
    Mel
    PS I am not worried about security this is a private home network.

  22. a gravatar 22 supriyadisw

    JJMacey: Could you send the screenshot to my email please?

    Mel B: Hi, I think you got problem with beautiful-sunrise-10 theme. Try to use default theme instead. let me know if your error still exist.

    Thanks a bunch

  23. a gravatar 23 Mel B

    Yes I think you are right. I went back to the default theme and it worked OK. will have to try other themes to see if I have the same problem.
    Mel B

  24. a gravatar 24 Coby

    Ubuntu has Wordpress in their repositories and it installs by default to /usr/share/wordpress.

    I had to make a symlink from /usr/share/wordpress to /var/www/wordpress


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

    I also had to create a dummy file called /etc/wordpress/config-localhost.php so the install would proceed. Ubuntu has some script in /etc/wordpress/wp-config.php that says “do not edit” and that requires this file, so I added the lines that set up MySQL and left the others alone.

    Thanks,

    Coby

  25. a gravatar 25 Mel B

    hello Cody
    I also am aware of the Ubuntu wordpress and have used it But it is a older version in the ubuntu repositories and not the latest one.also there is a very good easy to follow tutorial in the ubuntu community on how to install it for local use or as a remote. Between it and supriyadisw tutorial you can do about any type of installation of wordpress on Ubuntu.
    Mel

  26. a gravatar 26 supriyadisw

    Coby: Thanks for sharing.

    Mel B: Yes, You’re right ;)

  27. a gravatar 27 JJMacey

    supriyadisw,

    I’ve taken a screen shot of what I mean by “Naming” a MySQL data base, and “Number of Fields”. It seems that I need to do this before I can set-up a “wordpress” data base, then run WP.

    I’ll send you the shot of my Desktop via e-mail. As of right now then I run http://localhost/wordpress/ I get this.

    There doesn’t seem to be a wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn’t work for all server setups. The safest way is to manually create the file.

    Thanks in advance for your response.

    JJMacey
    Phoenix, Arizona

  28. a gravatar 28 supriyadisw

    JJMacey: Thanks for email me. I think you need to create wp-config.php manually. You can copy wp-config.php from wp-config-sample.php. Then you need to edit the file to match with your database information.

    // ** MySQL settings ** //
    define('DB_NAME', 'wordpress');
    define('DB_USER', 'root');
    define('DB_PASSWORD', '');
    define('DB_HOST', 'localhost');
    

    That configuration should works for the default mysql server on ubuntu. Then try to open your local wordpress http://localhost/wordpress.

    Gud lak!

  29. a gravatar 29 JJMacey

    supriyadisw,

    I did get WP installed on my local machine. I first installed Drupal because I had successfully done that before, then remembered what to do.

    Basically, I ignored the MySQL request to add a name and number of tables to my new wordpress database. Then edited wp-config-sample.php with the needed information and saved it as wp-config.php. All good now!

    Thanks for your help! Now that I have a “clone” of my hosted WP Blog @ wwww.jjmacey.net/blog on my machine I want to edit the Theme and Image.

    Do you know any good tutorials?

    Again, thanks for the exchange here.

    Regards,

    JJMacey
    Phoenix, Arizona

  30. a gravatar 30 cerno

    Wow I managed to get WP running on VMWARE!

    I used a very cool VMware image by the The Canned OS Project called “Grandma’s LAMP”. Its essentially a VMWARE “appliance”/ disk image (xubuntu) fully set up with all the LAMP stuff you need to get going. Just a matter of untaring WP and adding the data base with phpmyadmin!

    Check out all the details at
    http://canned-os.blogspot.com/2006/10/grandmas-lamp-its-easy-enough-for.html

    Note: I’m not linked to the canned OS project - I’m just a newbie whose’s thrilled to bits that I got WP running on my own machine using “Grandma’s LAMP”

  31. a gravatar 31 Adam

    Hi i have wordpress installed and it all works great from inside my network, but when i try to connect from the internet the page loads fine but all the post links and such are still using the internal address. How can i fix this?? Thank you.

  32. a gravatar 32 evilbuntu

    hi i am having trouble where i am supposed to point my browser to the install file.

    its telling me the file is not present on my server, but i can physically go in and see it.

    this is the second time i am installing wordpress on my machine for a project and any help is greatly appreciated, i am on a time frame

    thanks

  33. a gravatar 33 Roberto

    I can’t install it for some reason. I’ll post the error later today.

  34. a gravatar 34 sielkentjakk

    I tried to install wp but something failed. I have downloaded wp to my desktop but when i try to extract it to my server directory I get this message. I write sudo tar zxvf wordpress-x.x.x.tar.gz –directory=/var/www/ in my terminal and get this message in return.
    tar: wordpress-2.5.1.tar.gz: Cannot open: No such file or directory
    tar: Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error exit delayed from previous errors

    What should I do?

  35. a gravatar 35 sielkentjakk

    wrong.

    I write sudo tar zxvf wordpress-2.5.1.tar.gz –directory=/var/www/ in my terminal

  36. a gravatar 36 sielkentjakk

    wrong again.

    I write:
    sudo tar zxvf wordpress-2.5.1.tar.gz –directory=/var/www/

  1. 1 Planeta Ubuntu » WordPress Installation on Ubuntu with LAMP
  2. 2 Planeta Ubuntu » WordPress Installation on Ubuntu with LAMP ? supriyadisw dot net
  3. 3 My New Direction » Blog Archive » Installing WordPress on Ubuntu LTS
  4. 4 WoProt
  5. 5 LAMP + WordPress Installation On Ubuntu Linux - Quick Tutorial
  6. 6 Installing WordPress « Klikvnet99’s Weblog
  7. 7 Installing WordPress
Posting Your Comment
Please Wait

Yes, leave a comment here!

There was an error with your comment, please try again.