Install LAMP Server on Debian 9

Hello everyone, today we will show you how to install LAMP Server on Debian 9. LAMP (Linux Apache MySQL PHP) is a powerful web server and database stack needed to built a robust web server and web applications. Installing LAMP Server on Debian 9 is pretty easy. On this tutorial, we will work mostly via command line. You can either log in to the Debian server physically or via SSH.

Steps to install LAMP Server on Debian 9

The following commands must be run with root privileges. You can also use sudo user to execute these commands.

Step 1. Update system

Step 2. Install Apache Web Server

Output example:

Run and enable Apache on startup

Now check if the web server is correctly installed

Step 3. Install MySQL Server

Output example:

The default mysql-server command will actually install mariadb-server instead of MySQL Server. But don’t worry its as good as MySQL Server.

Secure MySQL Installation

Output example:

Step 4. Install PHP

The command below will install the latest version of PHP 7 on Debian 9.

Output example:

Optionally check PHP version using PHP script.

Paste these lines into it

Close and save it. Now type the server IP address and add info.php at the end. For example in my case:

You should see something like this

At this point, our LAMP Server is ready. We can now install any other web applications such as Pydio, WordPress, Owncloud, Nextcloud and many others.


Leave a Reply

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