Install LAMP Stack


A “LAMP” stack is a group of open-source software that is typically installed together in order to enable a server to host dynamic websites and web apps written in PHP. This term is an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP.

Other versions like WAMP is suited for Windows and more versions are listed here.

The installation requires a Command Line Interface (CLI). Either you can continue on the server itself with the connected screen and keyboard or connect to the server via TELNET or better SSH (secure TELNET). 

Installing Apache

The Apache web server is among the most popular web servers in the world. It’s well documented, has an active community of users, and has been in wide use for much of the history of the web, which makes it a great default choice for hosting a website.

Assumed to be logged in and have root privilege:

$ sudo apt update
$ sudo apt install apache2

Press Y when promted to install.

Update UFW.

$ sudo ufw app list

Should display:

Available applications:
Apache Full
Apache Secure

What does this mean:

  • Apache: This profile opens only port 80 (normal, unencrypted web traffic).
  • Apache Full: This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic).
  • Apache Secure: This profile opens only port 443 (TLS/SSL encrypted traffic).

Although no secure certificate is available yet, let's use the FULL profile.

$sudo ufw allow in "Apache"


$ ufw status

Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Apache Full (v6) ALLOW ANYWHERE (v6)


Do a spot check right away to verify that everything went as planned by visiting your server’s IP address in your web browser: http://server-ip-address
The following page should be downloaded.

apache test

Apache installation successfully completed

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Tools used to give you more features when navigating on the website, this can include social sharing.