Control panels

aaPanel: install the LNMP stack and create your first website

Install aaPanel on a Linux VPS, add Nginx, MySQL and PHP from the app store, then create your first website and confirm it loads over HTTP and HTTPS.

BeginnerLinux server4 min read

This guide shows you how to do an aaPanel install of the LNMP stack — Nginx, MySQL and PHP — and create your first website on a Linux VPS. You will run the installer, add the three components from the aaPanel app store, point a domain at the server and confirm the site answers over HTTP and HTTPS.

Before you start

You need:

  • A Linux VPS running Ubuntu 22.04 or 24.04, Debian 12, or AlmaLinux/Rocky 8–9.
  • The server's public IP address and root password, both shown in your VPS provider's control panel.
  • A domain you control, with access to its DNS records.
  • An SSH client. The browser console in your VPS provider's control panel works if SSH is blocked.

Warning: aaPanel installs its own Nginx, MySQL (or MariaDB) and PHP packages. Do not run it on a server that already has a web server, database or another control panel installed — the packages conflict and existing sites can break.

Connect to the server:

Bash
ssh root@203.0.113.10

Update the OS before you start:

Bash
# Ubuntu / Debian
apt update && apt upgrade -y
Bash
# AlmaLinux / Rocky
dnf update -y

Install the aaPanel LNMP stack

  1. Run the installer. Use the command published on aaPanel's official installation page, because the script filename is updated from time to time — check their docs before you copy an older line.
Bash
curl -ksSO https://www.aapanel.com/script/install_6.0_en.sh && bash install_6.0_en.sh aapanel
  1. Confirm with y when prompted. The script builds the panel and takes a few minutes. When it finishes, it prints an internet address, a username and a password.

Note: the panel listens on TCP 8888 and recent builds add a random security entrance path, for example http://203.0.113.10:8888/a1b2c3d4. Save the whole URL, not just the IP.

  1. Open the ports the panel and your websites need:
Bash
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw allow 8888/tcp
ufw reload

On AlmaLinux or Rocky, use firewalld instead:

Bash
firewall-cmd --permanent --add-port=8888/tcp
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

If your account has an external firewall or a cloud security group, open 8888, 80 and 443 there as well.

Warning: port 8888 is the admin port. Keep the random security entrance, avoid sharing the URL, and restrict that port to your own IP address where you can — anyone who reaches the login page can try to guess the password.

  1. Open the panel URL, log in with the printed credentials and accept the terms. Sign in with an aaPanel account if the app store asks for one; it needs that to fetch packages.

Add Nginx, MySQL and PHP from the app store

Open App Store in the left menu and install the three components in this order.

  1. Nginx — click Install and choose the quick option. Wait until the task queue shows the job as finished.
  2. MySQL — choose the MySQL or MariaDB version your application supports and install it. aaPanel creates a root password; copy it from the Database page rather than relying on memory.
  3. PHP — pick the PHP version your site needs. Install it, then open its settings to enable any extensions your application requires (for example fileinfo, opcache or gd).
  4. phpMyAdmin (optional) — install it if you prefer a browser-based database tool. phpMyAdmin has its own login; use the database credentials aaPanel created.

Tip: install one PHP version at first. You can add more later and assign a different version per website, which is useful when migrating older sites.

Compiled installs run in a queue in the background. Leave the tab open until the queue is empty, then reload the page.

Create your first website

  1. Go to Website → Add site.
  2. Fill in the form:
  • Domain: example.com, and add www.example.com on a second line if you want both.
  • Root directory: the default /www/wwwroot/example.com is fine.
  • PHP version: the one you installed.
  • Database: MySQL, with a name and user you choose.
  1. Click Submit. aaPanel creates the vhost, the web root directory and the database.
  2. Upload your files with the built-in File manager, or over SFTP with a user you create under FTP. The entry file must be named index.php or index.html in the web root.
  3. Point DNS at the server: an A record for example.com and another for www with the value 203.0.113.10. Confirm it resolves:
Bash
dig +short example.com
  1. Issue a certificate: open the site, go to SSL → Let's Encrypt, select both domains and apply
Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.