How to install LAMP Server on Debian 9

This tutorial is going to show you how to install LAMP Server on Debian 9 Stretch. LAMP is a combination between Linux, Apache, MySQL/MariaDB and PHP. With this LAMP we can built a powerful, rock solid web server to host web apps and many other stuffs. There are several steps to install LAMP on Debian 9. Please have a look at my other post on how to install Debian 9 Stretch. On this tutorial, I will guide you to install LAMP Server on a headless Debian 9 server. So, no GUI is available on my case. If you have Debian 8, please visit this page to watch how to install LAMP on Debian 8.8.

System Configuration

  • OS: Debian 9 Stretch
  • IP address: 10.34.0.202
  • Domain name: debian.manjaro.lan

Steps to install LAMP Server on Debian 9

Open Terminal (if you have GUI) or simply ssh to the Debian 9 Server and login as root.

Step 1. Install Apache web server

Output sample:
Start and enable Apache on boot
Now verify the web server. Open a web browser and type the Debian IP address. You should see similar to this one below.

Step 2. Install MariaDB Server

Use the following command to install MariaDB Server. FYI, MariaDB is the default database for MySQL package on Debian 9.

Output sample

Now start MariaDB and enable it on boot

Check the status of mariadb service

Secure MariaDB installation

Follow on screen wizard to harden the MariaDB installation. Congratulation, you have successfully installed MariaDB Server on Debian 9.

Step 3. Install PHP

Now we will install PHP on Debian 9. Use the following command

Output sample

Now check PHP version installed

At this point we have successfully installed LAMP Server on Debian 9 Stretch. Thank you for reading this post. Please share this article if you found useful.

2 Comments

6 Trackbacks / Pingbacks

  1. How to install Nextcloud 12.0 on Debian 9 - Free Linux Tutorials
  2. Debian Tutorial - How to install Owncloud 10 on Debian 9
  3. Arch Linux Tutorial to install LAMP Server on Arch Linux 2017 Server
  4. Debian Tutorial - How to install Wordpress on Debian 9
  5. Debian Tutorial - How to install PHPMyAdmin on Debian 9 Stretch
  6. Migrate Wordpress Site Manually - NO PLUGINS NEEDED

Leave a Reply

Your email address will not be published.


*