Setting Up the Home Lab
Setup the Raspberry Pi
Flash Ubuntu to SD Card and adapt these files afterwards:
# ... original content ...
# Turn off Power LED
dtparam=pwr_led_trigger=default-on
dtparam=pwr_led_activelow=off
# Turn off Activity LED
dtparam=act_led_trigger=none
dtparam=act_led_activelow=off
# Turn off Ethernet ACT LED
dtparam=eth_led0=4
# Turn off Ethernet LNK LED
dtparam=eth_led1=4 | |
Connect the raspberry pi to network and power and wait until cloud-init is done:
ssh rpi-0 cloud-init statusThis might take a while…
When the RaspberryPi is running, you might need to mount an external storage. Have a look at this guide: Set up automatic mounting
Access from the Internet
To access the HTTPS port on the RaspberryPi from the Internet, a dyndns is needed. This can be configured in the Router settings or alternatively with a small app on the RaspberryPi: Configuring your dynDNS Client If you run ddclient on the RaspberryPi, consider using compose for this as well: https://hub.docker.com/r/linuxserver/ddclient
Add a port forwarding rule to your router to route port 443 to 8443 and 80 to 8080 on the RaspberryPi. Make sure to create TCP and UDP rule for port 443. It is sufficient to only have a TCP rule for port 80. Have a look at the docs of the router: Configuring static port sharing in the FRITZ!Box
An alternative to dyndns is using a Cloudflare tunnel. A domain can be created using eu.org or by registering a custom domain name at any domain hosting service.
Another option would be to use an VPN like Tailscale.
Deploying Prod Instance
Create an .env file similar to the .env.dev file:
| |
and a prod.compose.yml:
| |
Make it executable by running chmod +x prod.compose.yml.
Push everything to the Git repository.
Connect to the Raspberry Pi via SSH, navigate to the mount point of the external storage, e.g. /mnt/storage and clone your Git repository.
Start the stack by running ./prod.compose.yml up -d and see if the services are accessible via https://pdf.example.com respectively your domain.