CloudLinux.ro
Applications

How to install LAMP on a Cloud VPS

Updated 7/18/2026

The classic LAMP stack (Linux, Apache, MySQL, PHP) ready to host any PHP application or website on your own server.

On your own VPS you get dedicated performance for your site, full root access and none of the compromises of shared hosting.

One-click install on cloudlinux.ro

The fastest way: LAMP installs automatically at the first boot of a new server.

  1. Create a Cloud VPS from the control panel.
  2. In the configuration step, pick LAMP from the app catalog.
  3. Start the server. The install runs in the background for a few minutes and its status shows on the server page.
  4. Access details and generated passwords are saved on the server in /root/app-credentials.txt.

Manual install on any Ubuntu server

If you prefer doing it yourself, below is the exact script our automatic install runs. Execute it as root on a fresh Ubuntu server (24.04 recommended). It stops at the first error, and when it finishes you will find the access details in /root/app-credentials.txt.

export DEBIAN_FRONTEND=noninteractive
apt-get update -y
apt-get install -y apache2 mysql-server php libapache2-mod-php php-mysql php-cli php-curl php-gd php-mbstring php-xml php-zip unzip
MYSQL_PASS=$(openssl rand -base64 24 | tr -dc 'A-Za-z0-9' | cut -c1-20)
mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '${MYSQL_PASS}'; FLUSH PRIVILEGES;"
systemctl enable --now apache2 mysql
IP=$(hostname -I | awk '{print $1}')
printf 'Apache: http://%s\nMySQL root: %s\n' "$IP" "$MYSQL_PASS" > /root/app-credentials.txt

You can also save this script as a recipe in your account and reuse it on any new server.

Put this guide into practice on your own VPS

EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.

See pricing

Related tutorials