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

  • taters@piefed.socialOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    4 days ago

    …Continued from PieFed Instructions…

    1. OPTIONAL: Environment Variables
      • Some functions such as email or captcha’s won’t work unless you add the necessary variables into the ~/pyfedi/.env.docker file. Look at ~/pyfedi/env.sample and add the other variables to ~/pyfedi/.env.docker according to your needs.
      1. View the sample file
        • nano ~/pyfedi/env.sample
      2. Edit & Save .env.docker file
        • nano ~/pyfedi/.env.docker
      3. Restart PieFed Docker container
        • docker compose down && docker compose up -d

    Updating PieFed Docker Container

    1. docker compose down
    2. git pull
    3. docker compose up --build
    4. docker compose down && docker compose up -d