How To Install WordPress on Ubuntu: Part 2

November 26, 2009 by
Filed under: HowTo, linux, Ubuntu, web development 

In Part 1 of How To Install WordPress on Ubuntu I showed you some of the steps required to get Ubuntu ready for a fresh installation of WordPress to use for web development. In Part 2 I'll go through the steps of installing WordPress itself.

First, you need to download the latest version of WordPress. As of this writing, the latest is version 2.8.6. 

Extract the archive to your intended directory. In my case, I'm putting the files into ~/webdev/site1. This will create a wordpress sub-directory. Cut all of the files from the wordpress directory and paste them into the parent directory (~/webdev/site1). Go ahead and delete the wordpress directory, you don't need it any more. If you have an index.html file, delete it or rename it to something like index.html.bak.

Now you'll need to create a new mySQL database for WordPress to use. This is easy to do through phpMyAdmin. Enter http://localhost/phpmyadmin/ into your web browser address bar and log in to phpMyAdmin as root.

Affiliate Link

phpMyAdmin Home Page

Next, we're going to create a new user and database.

  • Click on the Privileges tab in phpMyAdmin.
  • Within this tab, click on Add a new user.
  • Enter a user name and password in the required fields.
  • Click the radio button for Create database with same name and grant all privileges.
  • Finally, hit the Go button at the bottom of the page.

Create a new db and user

Site1 user and database created

Site1 user and database created

You're now ready to start the WordPress installation. Point your browser to your new website (http://site1/ in my case).

WordPress install step 1

WordPress install step 1

  • Click on Create a Configuration File.
  • You'll see a page describing the upcoming steps. Click on Let's go! WordPress install step 2
  • Enter the database name, user name, and password that you created earlier.
  • Change the database prefix if you prefer.

    WordPress install step 3

    WordPress install step 3

  • Click Submit.
  • You'll see a page saying WordPress is able to talk to your database.
    WordPress install step 4

    WordPress install step 4

    Click on Run the install.

  • WordPress will ask for a blog title and email address. Enter what you want at this step. You can enter any email address, it doesn't really matter for a local install. You can also uncheck the box for allowing search engines to crawl your site. This is a local installation, so they can't see your site anyway.
    WordPress install step 5

    WordPress install step 5

    Click on Install WordPress.

  • If the install worked, you should see a page showing the username admin and a randomly generated password.
    WordPress install step 6

    WordPress install step 6

    Write down the password and click the Log In button.

  • Log in to WordPress.
  • Click the red link at the top that says Yes, Take me to my profile page.

    WordPress install step 7

    WordPress install step 7

  • Enter a new password that you can remember and click Update Profile.
  • Click on Visit Site in the upper left corner of the Dashboard.

    WordPress install complete

    WordPress install complete

Congratulations! You've just installed WordPress on Ubuntu.

Comments

25 Responses to “How To Install WordPress on Ubuntu: Part 2”

  1. Scott says:

    I can't get this working. After entering the database connection details I get:

    "Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at %. This could mean your host's database server is down."

    I read though the comments. Did a sudo adduser site1 www-data; did a reload/restart.

    So in envvars should user and group be www-data, or username? I have it with username.

  2. Brad says:

    Installed WP 3.01 locally on Ubuntu 10.04 including dependencies. Everything functioning except when viewing a theme in Firefox [3.6.12].
    Appears that not all graphic files are showing. Example: various menu*.jpg files don't appear with the menu bar on the home page, only the menu tags ['home' 'about' 'contact'] on the main background. Same with any icons; can see them in the images directory of the theme but not showing up.
    Issue possibly with FF?
    THX!

    • Linerd says:

      Try clearing the cache in FF if you haven't already. The only other thing I can think of is that it's a permissions issue on the theme folders. You might need to make sure you have execute permission on the images directory. http://codex.wordpress.org/Changing_File_Permissions

      • Brad says:

        You were spot on, Linerd! I should automatically think of this as I come across it often in Windows and have come across this before in Linux. Images are now showing up.
        Thanks for the 'clue'. I hope I can return the favor to the group with my growth in knowledge.

  3. bobot says:

    great! i always wanted to do this all along and had it not been for this guide... muchas gracias

  4. hoss says:

    I get this error when I try to unzip into /var/www

    You don't have the right permissions to extract archives in the folder "file:///var/www"

    any suggestions?

  5. Lois says:

    Ok, I'll try file manager then. Thanks for the advice, much appreciated.

  6. Lois says:

    Thanks Linerd, that makes a lot of sense. I've successfully set up WordPress on bluehost. I can certainly appreciate how valuable it is to have a platform set up to play with offline. Once that's done though, do you know of any good guides to help with uploading everything to the WordPress installation with my hosting provider?

    • Linerd says:

      Well, if you're working on a theme, just archive the theme folder in a tar.gz or zip format. You can then upload the archived file to your hosting account through the cPanel File Manager or use FTP/sFTP (depending on what your hosting package supports) to upload the archive. Then you just unzip the archive on the server to the proper location. If you're not familiar with FTP, then the File Manager is the most straight forward way to upload.

  7. Lois says:

    Ok I'm very new at this stuff, but now that I have WordPress "locally" installed according to the guides, what do I do now? how does it link to a domain name and hosting (bluehost) and make a "live" site? This isn't within the "scope" of this post but if you could point in the right direction that would be great. Thanks.

    • Linerd says:

      The whole point of this is that you can develop or customize a WordPress theme off line (as in editing the theme code, not just adjusting theme settings). This is jsut so you can experiment in your own controlled environment. Then, once you have your theme looking the way you want, you can upload it to your WordPress installation with your hosting provider.

      Your production WordPress site will be on your host's server. If you bought your domain name and hosting package from the same provider, then they should have setup their domain name servers to point your domain name to your account. This video should walk you through setting up WordPress on BlueHost. http://tutorials.bluehost.com/wordpress/
      You can also install it using Fantastico DeLuxe: http://tutorials.bluehost.com/fantastico/

  8. Tbay says:

    Question:
    For some reason when accessing my website from the outside, the theme doesn't show up, and most of the links go to local host instead of my ip/domain.

    Is there something I am missing here?!

  9. CTown says:

    Wow, what an amazing guide! This guide also works with phpBB3, just downloaded the latest. All I had to do (after installing wordpress) was download and extract phpBB3, put the entire folder in site2 and went to site2/phpBB3/install/install.php. Not only that, I surpassed the requirements needed! Thank you for everything! I hope you have a great day.

  10. Raj says:

    Hi
    Even though I extracted contents of the wordpress folder into site1 folder, when I go to http://site1/ I get

    ---------------------------------
    "It works!"
    ---------------------------------

    I then went back to http://localhost/phpmyadmin/

    this is fine, except it says towards the bottom of the page

    -------------------------------------------------------------------------
    The additional features for working with linked tables have been deactivated. To find out why click here.
    Connection for controluser as defined in your configuration failed.
    Open new phpMyAdmin window
    --------------------------------------------------------------------------

    the link takes me to this

    ------------------------------------------------------------------
    Server: localhost
    $cfg['Servers'][$i]['pmadb'] ... OK
    $cfg['Servers'][$i]['relation'] ... not OK [ Documentation ]
    General relation features: Disabled

    $cfg['Servers'][$i]['table_info'] ... not OK [ Documentation ]
    Display Features: Disabled

    $cfg['Servers'][$i]['table_coords'] ... not OK [ Documentation ]
    $cfg['Servers'][$i]['pdf_pages'] ... not OK [ Documentation ]
    Creation of PDFs: Disabled

    $cfg['Servers'][$i]['column_info'] ... not OK [ Documentation ]
    Displaying Column Comments: Disabled
    Bookmarked SQL query: Disabled
    Browser transformation: Disabled

    $cfg['Servers'][$i]['history'] ... not OK [ Documentation ]
    SQL history: Disabled

    $cfg['Servers'][$i]['designer_coords'] ... not OK [ Documentation ]
    Designer: Disabled

    Connection for controluser as defined in your configuration failed.
    Open new phpMyAdmin window
    ---------------------------------------------------------------------------

    Would be grateful if you pointed me the right way. Please note, I did use the command

    sudo adduser yourid www-data

    cheers
    Raj

    • Linerd says:

      To get rid of the "It works" page, just delete the index.html file from your site1 folder. Apache will then default to WordPress' index.php file.

      I've never seen that phpMyAdmin error before so I'm not sure where to start. I guess I would try reloading Apache to see if that helps.

      sudo /etc/init.d/apache2 reload

      If that doesn't work then I suggest you ask your question on the Ubuntu Forums. You'll get a lot more eyes looking at it there.

      • bobot says:

        i also ran into the same error and i was lucky to fix it by checking on the membership on my own group! i do not understand it but when i check on the group that has the same name as my user id, i am not a member! so what i did is to make myself a member of the above group. :-)

  11. CTown says:

    Hello, during the install lamp part I could get into phpmyadmin (when the username was root), now I tried again after this guide and cannot log in no matter what I use. By the way, great guide, never would I have ever thought I would get this far.

    • Linerd says:

      I think you need to add your ID to the www-data group. You can do this through System→Administration→Users and Groups or through the terminal with:

      sudo adduser yourid www-data

      It's the change to the Apache config in Part 1 that screwed this up. I guess I'll go add that to the tutorial.

      I'm not sure, but you might need to log out and log back in for the group change to take effect.

  12. Adam says:

    I figured out how to get joomla working if anyone wants to follow along feel free

    http://drknoxy.blogspot.com/2010/03/lamp-stack-joomla-wordpress.html

  13. Adam says:

    I had to make sure that host wasn't "root" and it had to be changed in the drop down to Any like yours, and it inserted a percentage symbol.

    My phpmyadmin was getting really wonky too. I not only had the same problem as jben
    Solution:
    sudo chown -R USERNAME /etc/phpmyadmin

    but my phpmyadmin started having some crazy log in issues. I still haven't gotten things settled for the Joomla development area though.

  14. Sam says:

    I'm very happy running WordPress right now. Thank you again!

  15. jben says:

    Hey great couple of guides just wanted to make one comment. Making the user and group to your own in apache messed up my phpmyadmin install (I am refering to the part 1 of this guide). After sometime of researching I found that in my case the phpmyadmin actually did not give me full read access. So I went to /etc/phpmyadmin and gave myself full read access to the files. It seems it placed some of the files under the www-data group. When I did this everything worked fine and I was able to create a new database for wordpress.

    • Linerd says:

      I ended up adding my ID to the www-data group to resolve the issue. I've got to figure out the best place to add that to the tutorial. Glad you got it working.

  16. Story added...

    This story has been submitted to fsdaily.com! If you think this story should be read by the free software community, come vote it up and discuss it here:

    http://www.fsdaily.com/EndUser/How_To_Install_WordPress_on_Ubuntu_Part_2

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>