Documenting the steps I took to make internal services (e.g plex, calibre, pihole) publicly available on the Raspberry Pi.


Follow [/2020/06/06/set-up-rapsberry-pi-as-a-public-server-with-a-domain.html)]

General Overview

We want to set up multiple services on a Raspberry Pi and have subdomains point to the various services. For example, Let’s assume ServiceA is currently running on the Raspberry Pi on port 8080 and ServiceB is running on port 8081. We can use NGINX to make both of those services accessible publicly by going to and respectively.

NGINX configuration

Add a new site to Nginx by creating a new file at /etc/nginx/sites-available/

upstream servicea_backend {
  keepalive 32;

server {
  listen 80;
  location / {
    proxy_pass http://servicea_backend;

Create a similar file for ServiceB. Then we need to enable the sites and restart NGINX.

cd /etc/nginx/sites-enabled/
ln -s ../sites-available/
systemctl restart nginx

Enable HTTPS

Get certs from LetsEncrypt. The app should ask you if you want to change the configuration to force HTTPS. That’ll update the Nginx config and enable HTTPS.

sudo certbot --nginx -d

This will update the NGINX configuration files for the sites.