CloudLinux.ro
Applications

How to install MySQL on a Cloud VPS

Updated 7/18/2026

MySQL is the world's most widely used open-source relational database, ready for production workloads on your own server.

A database on your own server gives you low latency and full control over configuration and backups, without managed-service pricing.

One-click install on cloudlinux.ro

The fastest way: MySQL 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 MySQL 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. The app will be available on port 3306.

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
curl -fsSL https://get.docker.com | sh
DB_PASS=$(openssl rand -base64 24 | tr -dc 'A-Za-z0-9' | cut -c1-20)
docker volume create mysql_data
docker run -d --name mysql --restart=always -p 3306:3306 \
  -e MYSQL_ROOT_PASSWORD="$DB_PASS" -v mysql_data:/var/lib/mysql mysql:8
IP=$(hostname -I | awk '{print $1}')
printf 'MySQL: %s:3306\nUtilizator: root\nParola: %s\nPortul este public, foloseste parola generata si restrictioneaza accesul daca nu ai nevoie de conexiuni externe.\n' "$IP" "$DB_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