Prerequisite: You’ll want to set up a lamp server as outlined here.
Famous 5-Minute Install:
If that’s all working, the next thing you’ll want to do is grab WordPress
- Download and unzip the WordPress package if you haven’t already.
- Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it.
- (Optional) Find and rename wp-config-sample.php to wp-config.php, then edit the file (see Editing wp-config.php) and add your database information.
- Upload the WordPress files to the desired location on your web server:
- If you want to integrate WordPress into the root of your domain (e.g. http://example.com/), move or upload all contents of the unzipped WordPress directory (excluding the WordPress directory itself) into the root directory of your web server.
- If you want to have your WordPress installation in its own subdirectory on your website (e.g. http://example.com/blog/), create the blog directory on your server and upload the contents of the unzipped WordPress package to the directory via FTP.
- Note: If your FTP client has an option to convert file names to lower case, make sure it’s disabled.
- Run the WordPress installation script by accessing the URL in a web browser. This should be the URL where you uploaded the WordPress files.
- If you installed WordPress in the root directory, you should visit: http://example.com/
- If you installed WordPress in its own subdirectory called blog, for example, you should visit: http://example.com/blog/
We first need to find out what the root directory of your server is. This information is gerneraly found in the Apache configuration files here:
/etc/apache2/sites-available/. In new versions of Ubuntu the root directory can be viewed here:
Here we can see that the document root is set to
var/www/html/. We either need to edit this file or install WordPress here. I will so the latter.
sudo chown html/
tar -zvxf latest.tar.gz
During the Ubuntu installation process, the wizard asked you to specify a “root” password for MySQL. You’ll need that now, as we’re about to create a database for WordPress to use. The process for doing so is explained over on the WordPress codex, and goes a little something like this:
$ mysql -u root -p
Welcome to the MySQL monitor. Commands end with ; or g.
... ETC ...
Now, you’ll create the new database:
mysql> CREATE DATABASE wordpress;
Next, set up a database user:
mysql> GRANT ALL PRIVILEGES ON wordpress.*
-> TO "wp_user"@"localhost"
-> IDENTIFIED BY "password";
Clean up after yourself, and you’re done:
mysql> FLUSH PRIVILEGES;
I needed to create this as the installer (in Step 5) could not write this file (for some unknown reason):
cp wp-config-sample.php wp-config.php
All the WordPress files will be unpacked into a subdirectory of your website called wordpress. I prefer my blog to live at the root directory of my website, so I’ll be moving all these up one level:
mv wordpress/* .
The empty wordpress directory can be removed:
rm -r wordpress/
Since my document root is set to
/var/www/html/, I can access the installer using either of the following:
Once you have loaded the correct page you should see the following, and can press “Let’s go!” to proceed with the installation. (You might need to create the
wp-config.php manually as outlined in Step 3):
That’s it! WordPress should now be installed.
Note: You might need to delete or rename the original index file:
mv index.html index.html.bak