How to install WordPress on Debian 8

In this tutorial, we’ll show you how to install and configure WordPress on a Debian 8 server. For those of you who don’t know, WordPress is an open source website building tool written in PHP. There is a general consensus among website developers that WordPress is probably the simplest and most powerful blog and management system (or CMS) in existence today.

This article assumes that you at least have a basic knowledge of Linux, know how to use the shell, and most importantly, you can host the site on your own VPS. The installation is very simple and assumes that you are running under the root account, if not you may need to use ‘sudo’ on commands to gain superuser privileges. We will show you step by step how to install WordPress on your server. Debian 8 (Jessie)

Installing WordPress on Debian 8

Step 1. Software update.

Before installing any software, it is very important to ensure that your system is up to date by running these following commands in a terminal:

apt-get update
apt-get upgrade

Step 2. Install LAMP on the server (Linux, Apache, MariaDB, PHP).

Debian 8 server requires LAMP. If you don’t have LAMP installed, you can follow our guide here.

Step 3. Install WordPress.

The first thing to do is go to WordPress upload page in and download the latest stable version of WordPress.It’s version 4.7.1 at the time of this writing:


Unpack the WordPress archive to the root directory on your server:

unzip -q -d /var/www/html/
cd wordpress
cp -a * ..

We will need to change some folder permissions:

chown www-data:www-data -R /var/www/html/

Step 4. Configuring MariaDB for WordPress.

By default, MariaDB is not secure. You can secure MariaDB using the mysql_secure_installation script. You should carefully read each step below, set a root password, remove anonymous users, disable remote administrator login, and remove the test database and secure MariaDB access:


Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Next, we will need to log into the MariaDB console and create a database for WordPress. Run the following command:

mysql -u root -p

You will be prompted for a password, so enter your MariaDB administrator password and press the Enter key. Once you are logged into the database server, you need to create a database to install WordPress:

CREATE DATABASE wordpress character set utf8 collate utf8_bin;
GRANT ALL PRIVILEGES on wordpress.* to 'wpuser'@'localhost' identified by 'ваш_пароль';

Step 5. WordPress setup

In this step, we will be setting up the main WordPress config file where we need to tweak its basic settings so that it can be database and user related:

mv wp-config-sample.php wp-config.php

Now open it with your favorite editor to make any changes to the WordPress config file:

nano wp-config.php

Below are the values ​​we need to update according to our previous database and user settings:

// ** MySQL settings - You can get this info from your web host ** //
/** имя базы данных WordPress */
define('DB_NAME', 'wordpress');
/** пользователь базы данных MySQL */
define('DB_USER', 'wpuser');
/** пароль базы банных MySQL */
define('DB_PASSWORD', 'ваш_пароль');
/** MySQL hostname */
define('DB_HOST', 'localhost');

Step 6. Gaining access to WordPress.

WordPress will be available over HTTP on port 80 by default. Open your favorite browser and go to or http: // server-IP / and follow the necessary steps to complete the installation. If you are using a firewall, you must open port 80 to allow access to the control panel.

Congratulations! You have successfully installed WordPress. Thank you for using this tutorial to install WordPress CMS (Content Management Systems) on your Debian 8 Jessie system. For further help or useful information, we recommend that you visit official website WordPress