# LAMP Generated on 19 Dec 2025 from [the LAMP catalog page](https://marketplace.digitalocean.com/apps/lamp) In less than a minute, spin up a cloud server with Apache, MySQL, and PHP installed. ## Software Included | Package | Version | License | |---|---|---| | Apache | [2.4.58](https://packages.ubuntu.com/focal/apache2) | [Apache 2](https://www.apache.org/licenses/) | | MySQL server | [8.0.43](https://packages.ubuntu.com/focal/mysql-server) | [GPL 2 with modifications](https://www.mysql.com/about/legal/licensing/oem/#5) | | PHP | [8.4.11](https://packages.ubuntu.com/focal/php) | [PHP v3.01](http://php.net/license/index.php) | | Fail2ban | [1.0.2](https://packages.ubuntu.com/focal/fail2ban) | [GPL 2 with modifications](https://www.mysql.com/about/legal/licensing/oem/#5) | | Postfix | [3.8.6](https://packages.ubuntu.com/focal/postfix) | [IBM Public](http://www.postfix.org/IBM-Public-License-1.0.txt) | | Certbot | [2.9.0](https://packages.ubuntu.com/focal/python3-certbot-apache) | [Apache 2](https://github.com/certbot/certbot/blob/master/LICENSE.txt) | ## Creating an App using the Control Panel Click the **Deploy to DigitalOcean** button to create a Droplet based on this 1-Click App. If you aren’t logged in, this link will prompt you to log in with your DigitalOcean account. [![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/droplets/new?image=lamp-20-04) ## Creating an App using the API In addition to creating a Droplet from the LAMP 1-Click App using the control panel, you can also use the [DigitalOcean API](https://docs.digitalocean.com/reference/api). As an example, to create a 4GB LAMP Droplet in the SFO2 region, you can use the following `curl` command. You need to either save your [API access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) to an environment variable or substitute it in the command below. ```shell curl -X POST -H 'Content-Type: application/json' \ -H 'Authorization: Bearer '$TOKEN'' -d \ '{"name":"choose_a_name","region":"sfo2","size":"s-2vcpu-4gb","image":"lamp-20-04"}' \ "https://api.digitalocean.com/v2/droplets" ``` ## Getting Started After Deploying LAMP In addition to the package installation, the 1-Click also: - Enables the UFW firewall to allow only SSH (port `22`, rate limited), HTTP (port `80`), and HTTPS (port `443`) access. - Sets the MySQL root password and runs `mysql_secure_installation`. - Sets up the `debian-sys-maint` user in MySQL so the system’s init scripts for MySQL will work without requiring the MySQL `root` user password. After you create a LAMP One-Click Droplet: - You can view the LAMP instance immediately by visiting the Droplet’s IP address in your browser. - You can log into the Droplet as root using either the password you set when you created the Droplet or with an SSH key, if you added one during creation. - The MySQL root password is in `/root/.digitalocean_password`. - The web root is `/var/www/html`. - You can get information about the PHP installation by logging into the Droplet and running `php -i`. In addition, there are a few customized setup steps that we recommend you take. Creating an Apache virtual hosts file for each site maintains the default configuration as the fallback, as intended, and makes it easier to manage changes when hosting multiple sites. To do so, you’ll need to create two things for each domain: a new directory in `/var/www` for that domain’s content, and a new virtual host file in `/etc/apache2/sites-available` for that domain’s configuration. For a detailed walkthrough, you can follow [How to Set Up Apache Virtual Hosts](https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04). Setting up an SSL certificate enables HTTPS on the web server, which secures the traffic between the server and the clients connecting to it. Certbot is a free and automated way to set up SSL certificates on a server. It’s included as part of the LAMP One-Click to make securing the Droplet easier. To use Certbot, you’ll need a registered domain name and two DNS records: - An A record from a domain (e.g., `example.com`) to the server’s IP address - An A record from a domain prefaced with `www` (e.g., `www.example.com`) to the server’s IP address Additionally, if you are using a virtual hosts file, you’ll need to make sure the server name directive in the VirtualHost block (e.g., `ServerName example.com`) is correctly set to the domain. Once the DNS records and, optionally, the virtual hosts files are set up, you can generate the SSL certificate. Make sure to substitute the domain in the command. ``` certbot --apache -d example.com -d www.example.com ``` HTTPS traffic on port `443` is already allowed through the firewall. After you set up HTTPS, you can optionally deny HTTP traffic on port `80`: ``` ufw delete allow 80/tcp ``` For a more detailed walkthrough, you can follow [How to Secure Apache with Let’s Encrypt](https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04) or view [Certbot’s official documentation](https://certbot.eff.org/docs/using.html). You can serve files from the web server by adding them to the web root (`/var/www/html`) using [SFTP](https://www.digitalocean.com/community/tutorials/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server) or other tools. A newly-created LAMP Droplet includes an `index.html` web page. You can change this by uploading a custom `index.html` file or remove it.