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
Part 1: Download and installation
Run the following commands in the terminal.
cd /var/www sudo wget http://wordpress.org/latest.tar.gz sudo tar -xzvf latest.tar.gz
This set of commands downloads and extracts the WordPress files inside the www directory (that’s the base directory of the Apache webserver). The installation of WordPress is accessible under
Part 2. Creating a new MySQL database and User
After we unzip the wordpress files, they will be in a directory called wordpress in the home directory. Now we need to switch gears for a moment and create a new MySQL directory for wordpress.
We will now create a new MySQL database called “wpubuntu”. Remember we set the root password to “qwerty” in our tutorial. Let us login to the MySQL terminal:
mysql -u root -p
Login using your MySQL root password, and then we need to create a wordpress database, a user in that database, and give that user a new password. Keep in mind that all MySQL commands must end with semi-colon.
First, let’s make the database (I’m calling mine wpubuntu for simplicity’s sake; feel free to give it whatever name you choose):
Next, we type the MySQL command for creating a new database:
CREATE DATABASE wpubuntu;
Then we need to create the new user. You can replace the database, name, and password, with whatever you prefer:
CREATE USER wordpressuser@localhost; Query OK, 0 rows affected (0.00 sec)
Set the password for your new user:
SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password"); Query OK, 0 rows affected (0.00 sec)
Finish up by granting all privileges to the new user. Without this command, the wordpress installer will not be able to start up:
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.00 sec)
Then refresh MySQL:
FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
Exit out of the MySQL shell:
Here is an overview of the entire process:
mike@ubuntu:/var/www$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 44 Server version: 5.5.29-0ubuntu0.12.04.2 (Ubuntu) Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE wpubuntu; Query OK, 1 row affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> exit
Now you have successfully created a new MySQL database ready to be used by WordPress.
Part 3. Configuring WordPress Setup
Open the following URL in your browser:
You should see this image:
Click on Create Configuration File, followed by Let’s Go in the next step. In the 3rd step, enter the details as follows:
Database Name: wpubuntu User Name: root Password: dothisbest (or whatever password you've used for the root user) Database Host: localhost Table Prefix: wp_
Click on Submit. If you’ve followed the steps correctly, you should get this message:
Now after this the magic of WordPress – What You See Is What You Get(WYSIWYG) will start, just write what WordPress will ask during installation, Site Title, WordPress Username and Password (Do not share your password.), email and yes, I suggest to uncheck the “Allow search engines to index this site” box since we don’t want our offline/experimental site to be crawled by search engines.
So Enjoy, you have a fully working offline installation of WordPress on Ubuntu!
See more articles on Ubuntu: