An aaPanel SSL certificate takes about a minute to issue once your domain points at the server, and the same panel handles databases and FTP accounts without you opening a terminal. This guide covers the three tasks you will repeat most often on a new site: securing it with Let's Encrypt, creating a MySQL database and user, and adding an FTP account for a colleague or a deployment script.
Before you start
- A Linux VPS with aaPanel installed and reachable on its panel port (8888 by default). If you have not installed it yet, the installer is a single shell command — check the aaPanel site for the current one, because it changes from time to time:
URL=https://www.aapanel.com/script/install_6.0_en.sh && curl -ksSO "$URL" && bash install_6.0_en.sh aapanel- SSH access to the server. If this is your first time, see Connect to your Linux VPS with SSH.
- A domain with an A record pointing at your server IP. The examples use
203.0.113.10andexample.com. - Panel login details. If you lost them, run
bt defaultover SSH. - These ports open on the server and at your provider: 8888 for the panel, 80 and 443 for websites, 21 plus the passive range 39000-40000 for FTP.
Tip: aaPanel ships with a security entrance path and a changeable panel port under Settings. Keep both, and restrict port 8888 to your own IP if your provider's firewall lets you.
Log in and open the ports aaPanel needs
- Open
http://203.0.113.10:8888(or your security entrance URL) and log in. - If the login page does not load, check the firewall on the server and at your provider:
sudo ufw status
sudo ufw allow 8888/tcp
sudo ufw allow 80,443/tcp
sudo ufw allow 21/tcp
sudo ufw allow 39000:40000/tcp- Confirm the panel service is running and print its details:
bt defaultThat shows the panel address, username and password. The bt command also opens an interactive menu for restarting services, changing the port and resetting the password.
Issue an aaPanel SSL certificate with Let's Encrypt
- Go to Website, find your site, and open its settings. Choose SSL in the left column, then the Let's Encrypt tab.
- Tick every domain you want on the certificate. Both
example.comandwww.example.comshould already resolve to203.0.113.10before you continue. - Pick the validation method. HTTP file validation is the simplest and works when port 80 is reachable. DNS validation is the right choice when the domain sits behind a proxy such as Cloudflare or the site is not serving on port 80 yet.
- Click Apply. aaPanel asks the ACME server for the certificate, writes the files, and reloads Nginx or Apache. Expect 10 to 60 seconds.
- Switch on Force HTTPS so plain HTTP requests redirect to the secure version.
Note: The SSL entry in the panel's left menu is for the panel itself, not for your websites. Per-site certificates live under Website, then the site's SSL tab.
Renewal is handled by a cron task that aaPanel creates for you. Open Cron and confirm a certificate renewal job exists. If you used DNS validation, the DNS API key has to stay valid, otherwise the renewal will fail silently.
Create a database and a database user
- Open Database and click Add database.
- Fill in the fields: database name
appdb, usernameappuser, a generated password, and the access permission. Uselocalhostfor an application on the same server. Use%only when something outside the server must connect, and pair it with a firewall rule. - Save. aaPanel creates the database and the user and grants the privileges in one step.
- Click phpMyAdmin in the database list to import a dump or run queries in the browser.
To import from the command line instead:
mysql -u appuser -p appdb < /home/deploy/appdb.sqlThen confirm the credentials work and the user sees only what it should:
mysql -u appuser -p -e "SHOW DATABASES;"Warning: Deleting a database in aaPanel removes it immediately — there is no recycle bin. Take a dump first, as described in How to back up and restore MySQL databases with mysqldump.
Create an FTP account
- Open FTP and click Add FTP.
- Set the username to
deploy, generate a password, and set the path. Point it at the site root,/www/wwwroot/example.com, so the account cannot wander into other sites on the server. - Set a quota if you want to cap uploads, then save.
- Connect from your own machine:
ftp 203.0.113.10Or use a GUI client with host 203.0.113.10, port 21, and the user deploy.
Warning: Plain FTP sends the password and every file unencrypted. If your client supports SFTP, use the SSH account instead and skip FTP entirely.
If the login succeeds but the directory listing hangs, passive mode is being blocked. Open TCP 39000-40000 on the server and at your provider.
Check it works
https://example.comloads with a padlock andhttp://example.comredirects to it.curl -I https://example.comreturns a 200 and a valid certificate chain.- The database user connects and can see its own database only.
- The FTP account lists files in the site directory and cannot reach
/etcor another site's folder.
Troubleshooting
- Let's Encrypt fails with "DNS problem: NXDOMAIN" — the A record is missing or still propagating. Check with
dig +short example.comand wait out the TTL. - The certificate was issued but the browser still shows the old one — the web server was not reloaded, or a CDN is caching the old certificate. Reload Nginx or Apache from the panel, then purge the CDN cache.
- "Access denied for user 'appuser'@'localhost'" — the password is wrong, or the user was created with host
%while the application connects to127.0.0.1. Recreate the user with the host that matches the connection. - FTP login times out — port 21 is blocked, or the passive range 39000-40000 is closed. Open both on the server and at your provider.
- The panel is unreachable after a firewall change — you locked yourself out of port 8888. Use your provider's console to run
sudo ufw allow 8888/tcp.
Next steps
- Secure Nginx with a free Let's Encrypt SSL certificate for the command-line equivalent of the panel workflow.
- Protect SSH from brute-force attacks with Fail2ban before you hand out more accounts.
- Check your VPS CPU, RAM and disk from the command line to confirm the server has room for the sites you are adding.
