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
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.
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:
ssh [email protected]Update the OS before you start:
# Ubuntu / Debian
apt update && apt upgrade -y# AlmaLinux / Rocky
dnf update -yInstall the aaPanel LNMP stack
- 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.
curl -ksSO https://www.aapanel.com/script/install_6.0_en.sh && bash install_6.0_en.sh aapanel- Confirm with
ywhen prompted. The script builds the panel and takes a few minutes. When it finishes, it prints an internet address, a username and a password.
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.
- Open the ports the panel and your websites need:
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw allow 8888/tcp
ufw reloadOn AlmaLinux or Rocky, use firewalld instead:
firewall-cmd --permanent --add-port=8888/tcp
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reloadIf your account has an external firewall or a cloud security group, open 8888, 80 and 443 there as well.
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.
- 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.
- Nginx — click Install and choose the quick option. Wait until the task queue shows the job as finished.
- 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.
- PHP — pick the PHP version your site needs. Install it, then open its settings to enable any extensions your application requires (for example
fileinfo,opcacheorgd). - phpMyAdmin (optional) — install it if you prefer a browser-based database tool. phpMyAdmin has its own login; use the database credentials aaPanel created.
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
- Go to Website → Add site.
- Fill in the form:
- Domain:
example.com, and addwww.example.comon a second line if you want both. - Root directory: the default
/www/wwwroot/example.comis fine. - PHP version: the one you installed.
- Database: MySQL, with a name and user you choose.
- Click Submit. aaPanel creates the vhost, the web root directory and the database.
- 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.phporindex.htmlin the web root. - Point DNS at the server: an A record for
example.comand another forwwwwith the value203.0.113.10. Confirm it resolves:
dig +short example.com- 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.
Related guides
Control panels
How to install Plesk on a Linux VPS (AlmaLinux and Ubuntu)
Install Plesk on a fresh Linux VPS with the official one-click installer, apply your licence key and log in to the panel for the first time on port 8443.
- Beginner
- Linux VPS
- 8 min read
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
Control panels
Plesk Backup Manager: schedule backups and restore a site
Set up scheduled backups in Plesk Backup Manager, keep a copy off the server, and restore a single domain or subscription when something goes wrong.
- Intermediate
- Linux VPS
- 7 min read