How to Provision a Website With aaPanel and LetsEncrypt

Published:24 January 2022 - 7 min. read

Nicholas Xuan Nguyen Image

Nicholas Xuan Nguyen

Read more tutorials by Nicholas Xuan Nguyen!

You’ve just built a pretty website but don’t know how to get it online? Setting up your website can be a daunting task. There are so many options and services available, and it’s hard to know where to start. But don’t lose hope! aaPanel is the perfect solution for you!

In this guide, you will learn how to get your first site running securely over HTTPS using Let’s Encrypt SSL Certificates for free!

Read on and get ready to get your website online!

Prerequisites

This tutorial will be a hands-on demonstration. If you’d like to follow along, be sure you have the following:

  • A Linux system – This demo uses Ubuntu 20.04 LTS, but any Debian distributions will work.
  • A non-root user with sudo privileges.
  • A domain pointing to your server.

Downloading and Installing aaPanel

By default, aaPanel is not installed on your Ubuntu machine, so the first step is downloading and installing aaPanel with the wget command.

1. Run the apt update command to update your package index. This command ensures that you only install the correct packages and get the software you need.

sudo apt update -y
Updating your package index
Updating your package index

2. Next, run the wget command below to download the install-ubuntu_6.0_en.sh file from the aaPanel website (http://www.aapanel.com/script/). The -O flag tells the wget command to save and name the downloaded file as install.sh (shell script).

Once the download is complete, the command automatically executes the shell script (sudo bash install.sh) to install aaPanel.

You will get the latest stable version, which is 6.8.19 as of this writing. You should always check the official website for the latest version. Or click on the update at the top-right to update your panel to the latest version, as shown below.

Updating your panel to the latest version
Updating your panel to the latest version
wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && sudo bash install.sh

During the installation process, you’ll get the prompt below. Enter Y and press Enter to accept the prompt and continue the installation.

Downloading and Installing aaPanel
Downloading and Installing aaPanel

When the installation completes, you will get the following output. Note the URL access page, username, and password generated for you. You’ll use these login credentials when managing your website on aaPanel.

At this point, your aaPanel instance is running.

Previewing the login details
Previewing the login details

3. Run the ss command below to show a list of open ports (-antpl) and check if your aaPanel is listening on port 8888.

ss -antpl | grep 8888
Checking port 8888
Checking port 8888

4. Finally, run the below ufw command to check the status of your system’s firewall and verify if your firewall is allowing port 8888.

sudo ufw status

As you can see below, port 8888 is allowed to any incoming traffic from Anywhere.

If port 8888 is not yet open, run this command to create a rule on the firewall to open port 8888 for incoming traffic: sudo ufw allow 8888/tcp

Checking firewall status
Checking firewall status

If you put your server behind a firewall, the firewall may not allow traffic to port 8888. You will need to open this port on your firewall to use your aaPanel. Luckily, the installation script (install.sh) automatically opens port 8888 for you.

Building the LEMP Stack

Now that you have aaPanel installed, it’s time to build the LEMP stack for your server. LEMP Stack is a collection of free, open-source software (FOSS) that you can use to run dynamic web pages, like a blog or website.

aaPanel runs on top of your Ubuntu Linux operating system and uses NGINX as a webserver to serve its panels to users. Since your website might be serving many users, you’ll need a web server that can handle a large volume of simultaneous connections to a single server. NGINX is one of the best web servers that will do the trick.

1. Open your favorite browser, navigate to the URL of the aaPanel panel you noted in the “Downloading and Installing aaPanel” section (step two), and log in. This action redirects your browser to the aaPanel Linux login panel, as shown below.

Google Chrome is the recommended browser to use and disable adblocking while setting up the server. Google Chrome has a great network inspector. You can use it to see what is happening between your client and your server.

Logging into the URL of your aaPanel panel
Logging into the URL of your aaPanel panel

2. On the next page, select the LNMP(Recommended) option on the left to use for your website, and click on One Click.

Selecting the LNMP(Recommended) option
Selecting the LNMP(Recommended) option

You will get the following output while building the LEMP stack.

Building the LEMP Stack
Building the LEMP Stack

After building the LEMP stack, view the PHP extensions you’ll need for your website with the following:

  • Click on the App Store menu on the left panel to view the App Store.
  • Click on Installed to see installed applications.
  • Look for PHP-7.4, then click Settings on the right-hand side to view additional extensions to install.
Accessing Extensions to Install
Accessing Extensions to Install

Lastly, click on Install extensions in the Manage pop-up window, and click Install on the right of the extension you need for your website.

PHP extensions provide you with files that add features to the PHP language. They also provide you with a way to add new functions or change existing functions in PHP without modifying PHP core files.

Installing the PHP extensions
Installing the PHP extensions

Securing a Website with Let’s Encrypt

By now, you already have a web server running, but it doesn’t do anything yet until you provision a website. So you’ll create a website and secure it with Let’s Encrypt SSL certificate. Let’s Encrypt is a free, automated, and open Certificate Authority (CA) that issues, maintains, and automatically renews your certificates at no cost.

Let’s Encrypt also uses the strongest industry-standard encryption to secure your website connections. Let’s Encrypt certificates are trusted by all major modern browsers and search engines. As a result, your website is less likely to not get errors like the one below.

Previewing connection error
Previewing connection error

To create and secure a website with Let’s Encrypt:

1. On your aaPanel dashboard, click on the Website menu on the left panel, then click on Add site to add your first website.

Adding a new website
Adding a new website

2. Enter the website details in the form below and click on Submit to create your website.

Providing details for your website
Providing details for your website

If everything goes correctly, you will get a Successfully created site message, as shown below. You will now see your website in the list of websites on your aaPanel dashboard (step two).

Previewing the Successfully created site message
Previewing the Successfully created site message

3. Click on the website’s hyperlink to access the website’s settings, where you’ll set up SSL for your website.

Accessing Website’s Settings
Accessing Website’s Settings

4. Now, click on SSL on the left panel on the Site modification pop-up window to configure Let’s Encrypt SSL for your website.

Check the Select all option and click Apply to secure your newly-created website with Let’s Encrypt SSL.

Securing your newly-created website
Securing your newly-created website

You’ll get an output similar to the one below if everything goes correctly.

Previewing the SSL Certificate and Private key
Previewing the SSL Certificate and Private key

5. Navigate your website’s URL on a new browser tab to see if your website is working as intended.

You’ll get the same page like the one below, confirming that your site is running.

Previewing your site
Previewing your site

6. Finally, click on the pad lock on the top-left. You will get the following output. This output confirms that your Let’s Encrypt works as intended and your connection is secure.

Previewing your Let’s Encrypt certificate
Previewing your Let’s Encrypt certificate

Conclusion

In this tutorial, you’ve learned how to install aaPanel and build the LEMP Stack for your server. You’ve also touched on securing server connections with Let’s Encrypt’s SSL certificate for free — a pretty good deal.

With aaPanel’s one-click installation process, you get to choose from over 100 different applications and services, including WordPress, Shopify, and Tumblr. And at this point, you can now navigate through the aaPanel dashboard to manage and secure your website.

Now how would you kick this newfound knowledge up a notch? Perhaps set up a CMS, like WordPress, and run your first blog?

Hate ads? Want to support the writer? Get many of our tutorials packaged as an ATA Guidebook.

Explore ATA Guidebooks

Looks like you're offline!