How to access aapanel using domain and SSL?

I’ve been accessing my aapanel using an IP address and self-signed SSL certificate, but recently Google Chrome has been blocking me from accessing the panel. Can anyone help me by providing detailed instructions on adding a domain and a free Let’s Encrypt SSL certificate to the aapanel so I can access it without any issues?

Here is a step by step guide about adding domain and SSL to aapanel.

  1. Suppose you want to add ‘cp.example.com’. Now create a DNS record (A type) pointing to the IP address.
  2. If you are using Cloudflare, set it to “DNS Only.”
  3. Disable SSL and add the domain cp.example.com from aaPanel’s Settings Page.
  4. Now enable panel SSL and set ‘Let’s Encrypt’. It will enable SSL and secure your panel.

Auto Renew SSL

The SSL may not auto renew, but you can do a quick hack to auto renew the panel SSL.

  1. Create a website on aaPanel using the same domain name as the panel’s domain ‘cp.example.com’.
  2. Enable SSL for the website.
  3. Connect the server with SSH.
  4. Goto panel SSL directory.
cd /www/server/panel/ssl
  1. Take a backup of existing certificates to a safe place.
mv * /root/backup
  1. Remove everything from the directory.
rm *
  1. Create symlinks to the SSL
ln -s /www/server/panel/vhost/cert/cp.example.com/privkey.pem privateKey.pem
ln -s /www/server/panel/vhost/cert/cp.example.com/fullchain.pem certificate.pem
  1. Enable CRON Jobs for the Let’s Encrypt Certificate.