Does anyone run their own Lemmy instance on a pi? How was the process of setting it up? Were there any pitfalls? How is performance?
Hey OP, I’m on a similar journey (except I’m using an rpi kubernetes cluster)
I don’t have advice but I do want to wish you good luck
Not yet, but I’m planning to. And I don’t think there will be any “pitfalls” at all other than your microsd dying in a couple of months rather than years due to it getting hammered constantly by API requests, etc.
You could plug in a USB SSD or HDD and make sure the DB and other regularly written data goes there. That would pretty much remove the problem.
I would wonder how well it would perform. The limited memory and cpu power surely would make database access not great under even moderate load.
You are right – I completely forgot about those, thanks.
I would wonder how well it would perform.
Something between “usable” to “a complete nightmare” – depending of how popular the lemmy instance is. Which would scare new users away, leaving it as a “cool kids only” thing. Then again, theres the fact that the power draw is little to none, which is very important regarding most self-hosting stuff – “can’t use it if I can’t maintain it”.
I was able to get it setup, main things to watch out for:
- Don’t use the provided docker compose file. Or more precisely don’t build from source and lookup the correct image tag on docker hub first.
- The documentation was a bit confusing. This isn’t really specific for the Pi but since I was creating a compose file from scratch some of the steps listed didn’t quite explain all of the details.
I only used it for testing purposes, but performance was fine (on a Pi4 4gb). Note I only ever had one user.
As I only want to use it for myself as jump-off point (and to mess around a tad) I’m fine with performance on an RPi4 (have the 8 GB version), but I’m struggling to get it next to the rest in my Debian install on it.
Local install fails as I need imagemagick 7 (Debian still had 6.9), and it refuses to compile with imei method. (that script wants to use /usr/local/bin/identify which I think it needs to install itself (part of imagemagick) and the compose file I couldn’t get to work with an external (already hosted) postgres.
Any tips? I’m totally new with docker and ansible.
So in the official
docker-compose.yml
lines that define where/how to get the image for that application.For example:
build: context: ../ dockerfile: docker/Dockerfile
This tells docker to look for a file called
docker/Dockerfile
in the parent directory. This means that when you go to calldocker compose up -d
it will build an image from source using that Dockerfile. For the Pi we don’t want this (at least as of 0.17.x; I haven’t tested 0.18.0 yet).Instead we want to use a pre-built image. To do that we need to go to docker hub, specifically: https://hub.docker.com/r/dessalines/lemmy/tags and find the latest tag that matches the architecture of the system we’re building on. I assume you’re on a Pi4 running a 64bit so, so that gives us
0.17.3-linux-arm64
. After you’ve got that tag we just need to replace those 3 lines above with:image: dessalines/lemmy:0.17.3-linux-arm64
Now when we go to call
docker compose up -d
it will pull down that prebuilt image instead of building for source. Btw, you’ll want to do the same for thelemmy-ui
service.P.S. I don’t have much experience using Ansible, so I can’t help here. I normally just SSH directly into the Pi and do everything there.
What user cap would a pi have running an instance?
Are you asking me what i plan to set the cap to? I guess just me. I cant see anyone else wanting to run off a pi from my house and there are so many other instances to join.
No, I meant what is the user limit based on the power of the raspberry pi tech specs.
Basically the limit would be the speed of the database and the drive it runs on. If you connect a SATA SSD via usb3 it shouldn’t be too bad. Can’t tell you exact figures but a few hundred users is probably ok if you don’t expect the site to be super responsive.
Thanks. Might be useful for there to be a table outling diffrent hardware configs and acceptable user loads as more people people consider creating instances.
its difficult because different users have different usage patterns.
for example, two users who never post and are never online at the same time really take no resources from each other. they are effectively “one” user.one user who posts 10gb of content a day, and is constantly posting would be equivalent to hundreds of “normal” users.
Yes, sure, didn’t want to complicate the question by adding that :)