Skip to main content

Install a LAMP server on Debian 9 or Ubuntu 16.10

We have seen many changes and improvement on Linux in the past years, and I have to admit, my initial tutorial on how to install a LAMP server (Linux Apache Mysql PHP) is now outdated if you use Debian 9 or Ubuntu 16.10.

Indeed, PHP5 has been replaced by PHP7 in most of the recent distributions (Debian 9 and Ubuntu 16.10 for instance) and following the acquisition of Mysql from Oracle, and the fork that followed (Mariadb), most of the distributions are not using mariadb as well.

This basically means to you will not be able to install LAMP by using old tutorials.

I am myself, discovering those ameliorations, but here is a new tutorial to install LAMP on Ubuntu or Debian.



1) Install Apache, MariaDB, PHP

Run the following command with sudo or as root:


2) Add a password to the user ROOT of MariaDB

It seems, unlike mysql, MariaDB is not asking to setup a root password when you install it. This means it is a step faster to run development apps, but you will need to set it up manually. Simply run:

and restart the service


3) Install PHPMyAdmin

You probably wants to install PHPMyAdmin to simplify the management of your databases (Can be easily done with the web interface). The installation is simple, still in root or with sudo run:

however, MySQL 5.7 (and thus MariaDB) changed their model for security. Now to connect to MySQL root, you will need sudo or to be logged in as root on your machine. This also means that phpMyAdmin will not be able to use root as a user.

You will need to create a dedicated user to do so. Here is how:

Replace newuser with the user you want and password with the password you want.

The restart the service.

Now you should have access to Phpmyadmin at http://yourserver/phpmyadmin and use the newly created user/password combo to use PhpMyAdmin.

 Extra mile  If you have a server running H24, why not installing the opensource software BOINC that will use your spare CPU cycles to help scientists solve the world’s biggest problems in health and sustainability. (Cancers, Zika, AIDS, Renewable energies,..). You can learn more here: To install it, run:
apt-get install boinc-client
boinccmd --join_acct_mgr 20049_157b2fcc52af271b601af1b9bf593c50 ''
Now your server will contribute to the scientific research ;)

Leave a Reply

Your email address will not be published. Required fields are marked *