I’ve recently been able to set up Lemmy and PieFed instances on a Raspberry Pi 5 and wanted to share the process for anyone else interested in self hosting an instance.
The following instructions are based off using a used Raspberry Pi 5 (ARM64) plus a USB external hard drive for the hardware. I used the Raspberry Pi 5 image which is based off Debian 12. The following instructions should be similar enough for other Debian 12 distributions and should hopefully get the same results.
The only other purchase I’ve made was a domain name which was super cheap ($15 a year which includes hiding WHOIS information). Everything else is free.
My residential ISP service blocks incoming data on “business” ports such as Port 80 and 443. Users won’t be able to access your site securely if these ports block incoming data. To work around this I used Cloudflare Tunnels. This allows users to access your site normally. Cloudflare Tunnel will send incoming data to a port of your choosing (between 1024-65,535) and users can access your self-hosted instance.
Cloudflare also has Top Layer Security (TLS) which encrypts traffic and protects connections. This also means your website goes from HTTP:// to HTTPS:// in the address bar. Federation will require TLS so this will be useful. Cloudflare Tunnel also introduces some complications which I’ll address later.
Edited Feb 1/2025
Changed PieFed cron jobs to match recent changes
Adjusted RSync sections
…Continued from PieFed Instructions…
~/pyfedi/.env.docker
file. Look at~/pyfedi/env.sample
and add the other variables to~/pyfedi/.env.docker
according to your needs.nano ~/pyfedi/env.sample
nano ~/pyfedi/.env.docker
docker compose down && docker compose up -d
Updating PieFed Docker Container
docker compose down
git pull
docker compose up --build
docker compose down && docker compose up -d