stuff/homeservers/RPI.md
2025-04-14 22:11:02 +02:00

65 lines
1.5 KiB
Markdown

# Raspberry PI
On the Raspberry PI I am running FreeBSD with Bastille which currently has 1 jail:
```sh
sudo bastille list
```
```
ID IP Address Hostname Path
1 192.168.1.200 caddy /usr/local/bastille/jails/caddy/root
```
The ip address 192.168.1.200 is chosen deliberately. On my router (192.168.1.1) I have the following port mappings:
* 32222 to 192.168.1.108:22 (ssh) - Maps to the Raspberry PI 8 for external access
* 80 to 192.168.1.200:80 (http) - Maps to the Caddy jail
* 443 to 192.168.1.200:443 (https) - Maps to the Caddy jail
* 3478 to 192.168.1.10 (Nextcloud talk) - This is a direct connection to the Lenovo machine.
To view the Caddy setup in the Caddy jail, run this:
```sh
sudo -i
bastille console caddy
cat /usr/local/etc/caddy/Caddyfile
```
Result:
```
www.allisonandmoni.online {
reverse_proxy 192.168.1.11:8081
}
www.monigh.nl {
reverse_proxy 192.168.1.11:8081
}
photos.allisonandmoni.online {
reverse_proxy 192.168.1.11:2283
}
nextcloud.allisonandmoni.online {
reverse_proxy 192.168.1.11:11000
}
jellyfin.allisonandmoni.online {
reverse_proxy 192.168.1.11:8096
}
audiobookshelf.allisonandmoni.online {
reverse_proxy 192.168.1.11:13378
}
git.allisonandmoni.online {
reverse_proxy 192.168.1.11:3000
}
```
As you can see I have setup reverse proxies for www, photos and nextcloud for allisonandmoni.online.
The instructions for the caddy setup on my RPI4 can be found in this file:
* [Caddy on FreeBSD](../os/FreeBSD/Bastille.md#caddy)