LAMP Stack

Last change on 2024-04-18 • Created on 2021-06-23 • ID: CL-034BE
lamp logo

This app contains a ready to use LAMP installation. You can install it via the Hetzner Cloud Console or the Hetzner Cloud API.

LAMP describes a system which provides a Linux based Apache web server with PHP and MySQL database. All four components are open source projects.

L - Linux is the operating system.

A - Apache is the web server.

M - MySQL is the database system.

P - PHP is the programming language.

Getting started

Create your server on our Hetzner Cloud Console. Instead of an image, you will be able to choose the app that you would like to have preinstalled on your server.

LAMP is preinstalled when the image is booted, but it is not enabled.

In order to enable LAMP, first, please log into your server:

  • Via SSH key, if you selected one when you created the server
  • Via root password, which will be mailed to you if you created a server without selecting an SSH key

This will guide you through the process and give you additional Let's Encrypt support. If you choose to skip Let's Encrypt, you will still be able to activate it another time (see Activate Let's Encrypt post installation).

Hetzner Cloud API

In addition to the Hetzner Cloud Console you can also use the Hetzner Cloud API to set up a server with pre-installed LAMP stack.

  • For example with a curl command via CLI

    curl \
       -X POST \
       -H "Authorization: Bearer $API_TOKEN" \
       -H "Content-Type: application/json" \
       -d '{"name":"my-server", "server_type":"cx31", "image":"lamp"}' \
  • Or via hcloud-cli

    hcloud server create --name my-server --type cx31 --image lamp

Activate Let's Encrypt post installation

Let’s Encrypt provides digital certificates that are needed to enable HTTPS (SSL/TLS) for websites.

To activate Let's Encrypt after the initial script has run, please follow the steps below.

  1. Run Certbot (preinstalled) with the Apache plugin

    certbot --apache

    It will guide you through the process of obtaining a valid SSL certificate.

  2. Restart Apache

    systemctl restart apache2

Image content

Base OS

  • Ubuntu 20.04

Installed packages

Apache GPLv3 (Apache 2.0)
PHP GPL (Expat)
Certbot GPL (Apache 2.0)
Perl GPL


We use auto-generated passwords which are stored in:


For more information about the installed packages, please refer to their official documentation:

For more information about Hetzner Cloud and Hetzner Cloud Apps, please refer to our official documentation:

Table of Contents