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.

  • Beginner
  • Linux VPS
  • 4 min read

By RunRacks Team · Published

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 RunRacks 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 the Dashboard.
  • A domain you control, with access to its DNS records.
  • An SSH client. The browser console in the Dashboard works if SSH is blocked.

Connect to the server:

Terminal
ssh [email protected]

Update the OS before you start:

Terminal
# Ubuntu / Debian
apt update && apt upgrade -y
Terminal
# 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.
Terminal
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.
  1. Open the ports the panel and your websites need:
Terminal
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:

Terminal
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.

  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.

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:
Terminal
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 RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.

Control panels

CyberPanel: back up and restore a website

Create on-demand and scheduled website backups in CyberPanel, download the archives off the server, and restore a site from a backup when something breaks.

  • Intermediate
  • Linux VPS
  • 6 min read