How to install a complete webserver on Debian

Hey, in this tutorial I will show you how to install a complete webserver, by that I mean; nginx, php5, mysql. Let’s start !

1. Update your system

apt-get update && apt-get upgrade

2. Uninstall apache2

apt-get remove apache2

3. Install the packages

The package is on Debian/Ubuntu by default and if you don’t uninstall it before setup, it will give lots of problems.

apt-get install nginx mysql-server php5 php5-fpm

It may ask you to insert a mysql password for your newly created mysql-server. Please choose one carefully and save it for later.

4. Configure nginx

nano /etc/nginx/sites-available/default

Uncomment, and add: “index.php” where the arrow is.

It should now be:

5. You can now restart nginx

service nginx restart

Congrats, you got your own Webserver !



Install Phpmyadmin

apt-get install phpmyadmin

Press TAB, then Enter.

Pres YES

Enter your mysql password previously saved.

Now, let’s create a symbolic link to Phpmyadmin

ln -s /usr/share/phpmyadmin /var/www/html/

So outdated considering Ubuntu 16.04 uses PHP 7 by default and PHP 5 isn’t even in the default repos.

I edited it for Debian only.