Log inSign up

Set up aaPanel for websites on a fresh Ubuntu or Debian VPS

On a freshly installed Ubuntu or Debian server, download the aaPanel install script from the project site and run it with sudo bash install_7.0_en.sh aapanel. When it finishes it prints a panel address with a random port and secret path plus a user name and password; sudo bt default shows them again. Log in, choose an LNMP or LAMP stack, then add sites, databases and certificates from the dashboard.

Topic: Control panels · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

What kind of panel is aaPanel?

aaPanel is a free hosting panel that installs its own web stack under /www and manages it through a web dashboard. You pick Nginx, Apache or OpenLiteSpeed, one or more PHP versions, MySQL or MariaDB and phpMyAdmin from an app store inside the panel. Sites, databases, FTP accounts, cron jobs, certificates and a file manager all live in the same interface, and a plugin store adds extras such as Redis or a mail server.

Because the panel compiles or unpacks its own copies of these services, it expects to own the machine. Mixing it with packages installed by hand through apt leads to two Nginx or two MySQL instances competing for the same ports.

Why should aaPanel go on a clean server?

The installer assumes nothing else serves web or database traffic. Deploy a fresh instance from the Ubuntu 24.04, Ubuntu 22.04 or Debian 12 image, or reinstall an existing one from the Settings tab (all data on the disk is erased, see reinstalling an image). Check the aaPanel site for the current list of supported releases before you pick Debian 13.

Plan for at least 1 GB of RAM for the panel and a small stack, and 2 GB or more when MySQL and several PHP sites run together. A swap file helps the first stack build finish on small plans. Update the system first:

sudo apt update && sudo apt full-upgrade -y
sudo reboot

How do I run the aaPanel installer?

Download the current English script, read it, then run it as root through sudo. The trailing aapanel argument selects the international edition:

curl -fsSLO https://www.aapanel.com/script/install_7.0_en.sh
less install_7.0_en.sh
sudo bash install_7.0_en.sh aapanel

Answer y to the prompt. The script installs Python dependencies, the panel service and its command line helper, then prints a block like this (values differ on every server):

aaPanel Internet Address: https://198.51.100.24:21483/f2a9c1d7
username: xk3mq9pt
password: 7c1e2b9a

Copy the block somewhere safe. If you lose it, show the address and reset details again with the helper:

sudo bt default
sudo bt

The plain bt command opens a numbered menu for restarting the panel, changing the login name or password and similar tasks.

How do I lock down the panel port?

The random port and the secret path after it are a first layer, not a firewall. Limit the panel port to your own IP. Use the port number from your install output instead of 21483 and your address instead of 203.0.113.7:

sudo ufw allow OpenSSH
sudo ufw allow 80,443/tcp
sudo ufw allow from 203.0.113.7 to any port 21483 proto tcp
sudo ufw enable
sudo ufw status numbered

aaPanel has its own Security page that edits the same firewall, so rules you add there appear in ufw status as well. Under Settings, turn on panel SSL, change the default user name and password, and enable two-step verification with an authenticator app. The UFW guide explains the rule syntax in depth.

Which stack should I install first?

After the first login a window suggests LNMP (Nginx) or LAMP (Apache). Pick LNMP for lower memory use and most modern PHP apps, LAMP if your software relies on .htaccess files. Choose the fast install option, which uses prebuilt packages, instead of compiling from source; compiling can take an hour on a small plan. Install one PHP version to start, matching what your application requires, and add more later from the App Store.

When the queue finishes, check the services from SSH:

sudo ss -tlnp | grep -E "nginx|httpd|mysqld"
/www/server/nginx/sbin/nginx -v
/www/server/php/83/bin/php -v

The PHP path uses the version number without a dot, so PHP 8.3 lives in 83.

How do I add a website with SSL?

Point the domain at the server first: an A record to 198.51.100.24 and an AAAA record to 2001:db8:4f2a::24, as in the DNS records tutorial. In aaPanel open Website, Add site, enter example.net and www.example.net, choose the PHP version and optionally create a database at the same time. The document root defaults to /www/wwwroot/example.net.

Open the site settings, go to SSL, choose Let's Encrypt, tick both names and apply. The panel renews certificates by itself and can force HTTPS with one switch. Test from any machine:

curl -I https://example.net

A 200 or 301 response with a valid certificate means the site is live.

How do I handle outgoing email?

Use an authenticated SMTP relay on port 587 from your applications or the mail plugin. Port 25 may not be available for direct delivery, so open a support ticket before you plan to send mail straight from the server, and ask for reverse DNS the same way. Most PHP applications and WordPress plugins accept relay settings (host, port 587, user name and password), which avoids running a full mail server at all. The SMTP relay guide walks through the settings.

How do I update, back up and troubleshoot aaPanel?

The panel shows an update button on its home page when a new version exists; system packages still update with sudo apt upgrade. Under Cron, aaPanel can schedule backups of sites and databases to a local folder; copy those archives off the server as well, and consider our optional daily backups add-on for whole disk recovery.

If the panel stops answering, restart it and read its log:

sudo bt restart
sudo tail -n 50 /www/server/panel/logs/error.log

Removing aaPanel cleanly is hard because it owns the whole stack. If you want to leave it, back up your sites and databases, then reinstall the image.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A1-2panel plus one LNMP site1 vCPU, 2 GB RAM, 50 GB NVMe$7.20/mo$43.20 for 6 months
A2-4several PHP sites with MySQL2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months

Questions about aaPanel hosting panel

Is aaPanel free?

The core panel is free. Some plugins in its store are paid; everything in this guide uses free parts only.

Can I install aaPanel on Rocky Linux?

The installer supports several RHEL family releases, but this guide covers Ubuntu and Debian only. Check the aaPanel site for its current list before using another system.

I forgot the panel address. Where do I find it?

Run sudo bt default over SSH. It prints the address with the port and secret path, and the user name.

Can I use apt to install Nginx next to aaPanel?

Avoid it. aaPanel runs its own Nginx under /www, and a second copy from apt would fight for ports 80 and 443. Add software through the panel App Store instead.

Does aaPanel set up the firewall for me?

It manages UFW through its Security page and opens the panel port during install. Review the rules afterwards and limit the panel port to your own IP.