Hi, I am late to this party but I guess after fiddling with aapanel and struggling with custom domain setup as everyone else here I have figured it out how to set the custom domain to aapanel properly with SSL. Check out my screen shot for the proof. anyways follow these steps if you have already installed the panel and these steps don't work for you i will suggest delete your server and reinstall Linux again and then follow the steps.

  1. Install the fresh Linux of your choice (I used oracle Linux 8).
  2. change the hostname of the server to (mypanel.example.com).
  3. This step is only for those who using Oracle cloud run these commands to prevent oracle to reset your hostname after reboot( chkconfig NetworkManager off,
    service NetworkManager stop).
  4. Point your (mypanel.example.com) domain to your server ip address simply.
  5. Install aapanel and after install open your aapanel with default provided url.
  6. In settings turn off SSL you might have to login again after turning off ssl.
  7. Add your custom domain (mypanel.example.com) in setting after saving that aapanel will log you out.
  8. open SSH with root access and type "bt" a menu will open.
  9. Select option (9) Clear panel cache, then (8) Change panel port (optional but recommended), (1) Restart panel, (14) View panel default info (note down the your custom url it will be like "mypanel.example.com:7800/abcde".
    10 reboot the server.
  10. after rebooting use the custom url "mypanel.example.com:7800/abcde" to login.
  11. go to setting and turn On SSL and use let's encrypt option.
    thats it.

Hope it helps out.

a year later

sultan
I try this step, and now i can't access my aapanel again. how to roleback to default aapanel login?

    alidata
    Hello, what information does it prompt that you cannot access? Use the command to check whether the bt service is running: bt status
    If it is not running, try restarting the bt service: bt start

      a month later

      aaPanel_Kern
      Before I changed the domain settings, I could use the IP normally, and now i cant use ip access

      after i use bt 12, i can use ip access again.. thanks before..
      btw i used 7.0.1 version. so how i can pointing subdomain with cloudflare to access my aapanel, please master..

        Hello, the domain name of cloudflare cannot proxy the panel after the proxy is turned on. Please turn off the proxy of the A record.
        Or try aapanel to modify the port 2087 or 8443 supported by cloudflare, etc. You can use the bt command to modify it.

        aaP_premium.idr

          aaPanel_Kern sorry master, i try to change the port to port 2087, but I haven't changed the domain in the settings menu. and now if i use subdomain for acces panel, the result is website not found.

            Hello, please check whether the A record of the domain name is resolved? Does it point to the IP of the server and cannot use a proxy.
            Also check that the access link is incomplete

            aaP_premium.idr

            3 months later

            @"aaPanel_Kern"

            Another problem that doesn't work for everyone.
            It doesn't work for me either, even though I need it. This should be the default setting.

            I would love a cloudflare type setup.

            aaPanel_Kern if I give you access to the panel, could you look at it?

              aaPanel_Kern

              When I switch to the CloudFlare port it doesn't work either.
              Bt 8 --> add port: 2087 or 8443

              The website is simply not available. Why would it be, since CloudFlare requires ssl, but the ssl service must first be turned off in the panel so that I can set the domain name.

              Each description is only a half-solution for now, but it doesn't work.

                Hello, please check CloudFlare's SSL configuration. Is it restricted to use an SSL certificate and is it trusted by CloudFlare?
                The default SSL certificate of the panel is not trusted by CloudFlare, and you need to change it to a trusted one. Such as CloudFlare's self-signed certificate

                aaP_pfalzgraf_gyula

                2 months later

                Greetings, I will tell you how to do it step by step:

                1. If proxy is turned on in cloudflare, you must first turn it off.

                2. After logging into Aapanel, turn off panel SSL from settings >> security.

                3. Type the domain you want to access from the settings and save it. You will see that you can access it without SSL.

                4. Log in to the panel and select "Activate Panel SSL", then select the "Lets Encrpyt" certificate and continue the process.

                2 months later

                The issue I am having is I am trying to create an internal website for my company. Hosted internally on a ubuntu server (LAMP). I don't need the outside world to have access. Just internally. I created an A record with my DNS Manager (A Windows Server 2022).
                10.1.25.25 to myapple
                Now when I go to 10.1.25.25 to goes the default index.html page
                When I go to myapple to goes to that Welcome to NGINX! page.

                I have the LAMP stack installed
                I can ping 10.1.25.25 and myapple.
                NSLookup they both resolve to each other.

                Looking at aapanel, the Default page:
                The "Welcome to NGINX page..." is the Unbound domain page.

                When I created the site, I didn't use a domain name, I used the IP address 10.1.25.25.
                Being that it is internal I thought I didn't need an actual domain.

                Any thoughts? TY

                  Hello, when you visit the website, do you use IP or domain name? If it is a domain name, please add the domain name to the website you created.
                  Also check whether the index.html file of the website according to the directory is consistent with what is displayed?

                  aaP_shakim

                    aaPanel_Kern

                    When I use the ip address, it takes me to index.html page
                    When I use the server name, (myapple). It takes that NGINX page.

                    When I created the site in aapanel I put the IP address for the domain.
                    The server name is myapple and the IP address of that server is 10.1.25.25

                      Hello, the web service is identified based on the accessed domain name, IP, port, and protocol. If it does not exist, a default page will be returned.
                      Please check whether the domain name you visited is in the website list

                      aaP_shakim

                      Being thatour web server is onprem and inside our network I didn't know how to associate a domain name to it?