Skip to content

SSL Configuration

  • A domain name
  • SSH access
  • sudo privileges

This tutorial will use Ubuntu Jammy 22.04 LTS as the operating system, and Cloudflare as the DNS provider.

To install the dependencies, you will need to run the following commands:

Terminal window
...
sudo apt update && sudo apt upgrade
sudo apt install nginx certbot python3-certbot-nginx
...

For this, we will want to go to Cloudflare, and create an A record for our domain with the name you want and your server’s Public IP. img1


To enable this, we will need to edit the file /etc/nginx/sites-enabled/pufferpanel.conf, and we will use nano to edit it. To edit it, run the following command:

Terminal window
...
sudo nano /etc/nginx/sites-enabled/pufferpanel.conf
...

And now, you have to add the following: Remember to change pufferpanel.servers.fun to your domain name!

/etc/sites-enabled/pufferpanel.conf
server {
listen 80;
root /var/www/pufferpanel;
server_name pufferpanel.servers.fun; # Change this to your domain name
location ~ ^/\.well-known {
root /var/www/html;
allow all;
}
location / {
proxy_pass http://localhost:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Nginx-Proxy true;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
client_max_body_size 100M;
}
}

If you’re using PuTTY, you can right click on the terminal to paste it, and if you’re using just a terminal, you can press Ctrl + Shift + V to paste it.

To save now, you have to press Ctrl + X, and then Y.

Now you’ll want to restart nginx, to do that, run the following command:

Terminal window
...
sudo systemctl restart nginx
...

We also need to open ports 80 and 443, so we can access the panel.

Terminal window
...
sudo ufw allow 80
sudo ufw allow 443
sudo ufw reload
...

To enable SSL, we will need to run the following command:

Terminal window
...
sudo certbot --nginx -d pufferpanel.servers.fun # Change this to your domain name
...

And that’s it! Now if you go into your browser, and try to go into https://panel.yourdomain.com, you should be able to access the panel!