Install WordPress on Ubuntu or Debian PC is actually very easy. Its just running some commands from Terminal and here is full guide with Screen shots to help. Basically we need a LAMP setup (Linux – Apache – MySQL – PHP). So basic need is to install Apache, MySQL and PHP. The commands are almost same for Ubuntu and Debian, although Debian has some preconfigured packages. Here is the full guide to Install WordPress on Ubuntu or Debian PC.
Install WordPress on Ubuntu or Debian PC Guide
The first thing you should know to Install WordPress on Ubuntu or Debian PC is – if you have a Static IP, your www folder and WordPress is actually accessible by default from Internet. This is great if you want to use your Ubuntu 12.04 PC as a server, but keep in mind the security issues. This actually works for Mac too, for both there is actually very less need to install other softwares like WAMP as we usually do for Windows PC.
Install WordPress on Ubuntu or Debian PC : Steps
Open your terminal and type sudo su to avoid typing sudo every time with commands. You basically will run commands to install WordPress on Ubuntu as root user inside terminal :
---

First install Apache2 by this command :
1 | apt-get install apache2 |
Accept the installation prompt and after completion of installation of Apache2, you will be able to open your static IP on browser :

And run these commands one after one :
1 | apt-get install mysql-server-5.5 |
You will get a password setting GUI prompt, fill it. Then :
1 | mysql_install_db |
Please follow the screen commands, you need to cd to usr/bin/ and provide password. Read the on screen instructions carefully. Now :
1 | mysql_secure_installation |
In both cases in above, adding sudo before the commands will give debug reports.
This command must have to be used with sudo :
1 | sudo apt-get install php5 |
And install two packages for WordPress, this is the minimum need :
1 | sudo apt-get install php5-mysql |
and :
1 | sudo apt-get install php5-gd |
The rest is like installing WordPress on real server (in fact the full process). Change directory to www folder :
1 | cd /var/www |
Now wget WordPress :
1 | wget http://wordpress.org/latest.tar.gz |
Uncompress it :
1 | tar -xzvf latest.tar.gz |
As it your local computer, you can go to var > www to see the fact that WordPress is unpacked under wordpress folder. You need to move to move them to root (if you want) by command or copy paste on GUI. Basically you need to create a database. Before going to that, Edit your Apache :
1 | sudo vi /etc/apache2/apache2.conf |
And add this line at the end :
1 | AddType application/x-httpd-php .html |
Restart Apache :
1 |
1 | sudo /etc/init.d/apache2 restart |
It is painful for the most to use the MySQL to add database from command prompt. Actually we will follow Install WordPress on Rackspace Cloud Server guide if you want from command prompt. Else install PHpMydmin if you want a GUI.
1 | mysql -u root -p |
1 | create database wordpress; |
1 |
1 | create user ˜wordpress™@'localhost™ identified by ˜password™; |
1 |
1 | grant all privileges on ˜.™ to ˜wordpress™@'localhost™ with grant options; |
Change the red letters and words to your own. Installing WorPress itself is easy. Point your browser to :
1 | http://localhost/wp-admin/install.php |
or
1 | http://your-ip/wp-admin/install.php |
and follow the on browser guide to complete installation.
Tagged With Install WordPress Locally on Ubuntu Linux with LAMP