In this handy guide, we will be showing how to easily install the latest version of WordPress (currently 4.2.2) on Debian 8 Jessie and Debian 7 Wheezy. This is a first install guide of WordPress and not an upgrade. So if you are upgrading your current WordPress version, then this guide may not be useful for you.

Preparing Your System For WordPress

1. LAMP Server Installation

First of all, we meed to install the LAMP server so that you can run WordPress on Debian. To do this, open the terminal and run these commands:

su - 
apt-get install apache2 mysql-client mysql-server php5 php5-mysql php5-curl php5-gd

During the installation you will be asked to enter a password for the MySQL root user:

Set any password of your choice then proceed.

2. Creating WordPress Database

Let's now create a database for WordPress. From the terminal, write this (use the MySQL password set earlier):

mysql -u root -p

Now run this sequence of commands to create the database, database user & password:

CREATE DATABASE wpdatabase; 
CREATE USER wpuser@localhost IDENTIFIED BY 'wppass'; 
GRANT ALL PRIVILEGES ON wpdatabase.* TO wpuser@localhost; 

Restart now Apache and MySQL servers with these commands so that changes are taken into effect:

service apache2 restart 
service mysql restart

Installing WordPress

Open the terminal and issue these commands:

cd /tmp 
wget -c http://wordpress.org/latest.zip 
unzip -q latest.zip -d /var/www/html/ 
chown -R www-data.www-data /var/www/html/wordpress 
chmod -R 755 /var/www/html/wordpress 
mkdir -p /var/www/html/wordpress/wp-content/uploads 
chown -R www-data.www-data /var/www/html/wordpress/wp-content/uploads

Let's now insert our database details to the WordPress config file. To do this, run these commands:

cd /var/www/html/wordpress/ 
cp wp-config-sample.php wp-config.php

Edit the wp-config.php file with any text editor of your choice. For example, you can use gedit or nano:

gedit wp-config.php


nano wp-config.php

Then enter the database name, database user and password you have created earlier:

Save your file and exit. Finally open your browser and type this link to complete the installation of WordPress:


Then follow setup instructions:

Post a Comment

  1. Franchement , j'en suivi des tutos , et ben merci , ça n'a jamais etait aussi bien expliqué. Bon travail =)

  2. Appreciate it regarding creating such a good write-up, We happened on your web site as well as understand a number of post. I like your look associated with creating.. All In One Seo Backlinks To Rank You In 5$

  3. Hi Brian,
    It is lucky for me to read this post and I did create a wordpress website as your tutorial. Thanks!
    Could you please elaborate how to create SSL to a wordpress website after your example? I messed the website even was not able to be logged in.

  4. Check out LetsEncrypt (https://letsencrypt.org). Sponsored by industry greats such as Cisco, Mozilla and Facebook.

    Free and full SSL certificate that automatically renews every 90 days. For specific instructions check out their site, but for me using a Debian 8 (Jessie) server with Apache2, it's as simple as:

    nano /etc/apt/sources.list
    deb http://ftp.debian.org/debian jessie-backports main
    apt-get update

    sudo apt-get install python-certbot-apache -t jessie-backports -y
    certbot --apache

  5. If you use a virtual host setup, just set that up to point to the documentroot of wordpress and head over to your IP instead of the localhost. Works like a charm.

  6. Thanks for the elaborated explanation. I did as you instructed but when I opened the web browser for the last stage, I reached a blank page. do you have any thoughts/ideas/ dirdection on what could have done wrong?

  7. This comment has been removed by the author.

  8. This tutorial is very good! Congratulations!!!

  9. When you go to sign-up for hosting, you have to buy any among shared, VPS (Virtual Private Server), dedicated or managed hosting themes.best article.

  10. dear friend, how to change localhost/wordpress to localhost ?