What hardware are you using for your self-hosted lemmy instance?
For those self-hosting a lemmy instance, what hardware are you using? I am currently using a small Hetzner VPS. It has 2 vCPU, 2GB RAM and 40GB SSD storage. My instance is currently just in testing with me as the only user, but I plan to use it for close friends or family that may want to try this out, but might not want to sign up for a different instance. My CPU and RAM usage is great so far. My only concern is how large the storage will balloon to over time. I’ve been up for ~20 hours and it’s grown to 1.5G total volume since.
From what I've heard (take this with a huge grain of salt) is that the posts themselves shouldn't take up much of your storage. The biggest thing that could take up your storage are images, but they are only stored on the instances where the community in which they were posted in is.
It's likely the Docker images, and maybe the Docker build cache if they built from source instead of using the Docker Hub image.
I've been up for about a day longer than OP, and my Lemmy data is still under 800MB. OP either included non Lemmy data in that math, or is subscribed to way more communities than me. My storage usage has been growing much faster today with all the extra activity, but I won't have to worry about storage space for about a month even at this rate.
And that's assuming Lemmy doesn't automatically prune old data. I'm not sure if it does or not. But if it doesn't, I imagine I'll see posts in about 2-3 weeks talking about Lemmy's storage needs and how to manage it as an instance admin.
EDIT: Turns out ~90% of my Lemmy data is just for debugging and not needed:
It's probably from the instance finding other instances and communities and saving them locally. But I don't know too much about how it actually works so I could be wrong. I also heard that they are only stored locally if someone on the instance subscribes to a community, so if that is the case my theory wouldn't make sense.
4vcpu (Ryzen), 8GB RAM, 256gb disk (which will be expanded when it gets to like 60% full). Not too worried about storage unless I get a bunch of image-happy users, text all comes in as json and goes straight to Postgres so it’s not a concern.
How many users do you have? Not starting a server any time soon, just curious. A you seem to have one of the bigger ones in this thread and are using them for privately. Are you public?
Mine is public, yes. Not sure how many active users I have, 28 signups but my sidebar shows 5 monthly active users so far. I imagine this will pick up once people start commenting and posting more.
I've got a baremetal server with OVH running VMware, so it's just a VM that I manage. I'm paying more for it than I'd like, but it's running far more than just Lemmy. If I wind up ditching it in the future, it's just a quick vMotion off to another machine + DNS updates.
Here's a current output of my storage about a week into hosting the instance. It's growing slower than I expected, and I do have plans to move volumes/pictrs up to an s3 bucket whenever I start running low on local storage.
[jon@lemmy lemmy]# du -sh volumes/*
2.5G volumes/pictrs
2.2G volumes/postgres
I would recommend locking down SSH on your Lemmy server, I have mine restricted to allow logins from VPN only. Otherwise you'll get probed 24/7 with a public server.
1 vCPU, 1GB Ram, 50GB storage using the smallest x86_64 compute instances on Oracle Cloud. Qualifies for always free which is nice while I'm simply testing out a personal server. It's working just fine within those constraints. For now, at least.
Like you, I'm worried about storage. I would like to run it from home, but I live in the woods and my internet isn't reliable enough.
Currently a 1CPU/2GB RAM Linode instance for 26 users. Linode's pricing gets insane as you scale up though so I will definitely be looking elsewhere if I need to scale much bigger. I think I could get away with 1gb of RAM at half the cost right now, but I'm also hosting a Matrix homeserver on this VPS and Synapse is a hungy boy.
I'm using a Ramnode VPS since I had some unused credit I wanted to use up. 2 vcpu, 1 GB ram, and 35 GB ssd.
Seems to be working well enough so far, but right now it's just me. If I open up to more users, I might need to upgrade, but we'll cross that bridge when we get there.
Edit: I may have spoke too soon; had to reboot the server due to low memory. Hopefully a swap file will alleviate that a bit, but I might have to upgrade the RAM on this server. We'll see.
5~ USD a month. Working great for personal use and I'd imagine a handful of users. Hosted in a data center that is very close to me.
Also fwiw: 4 days of lemmy. I am subbed to a bunch of stuff. I've only uploaded like three pictures to my instance... All that space is thumbnails from other instances.
692M ./postgres
8.0K ./lemmy-ui
499M ./pictrs
1.2G .
1.2G total
There's my current disk usage. I've gone wild subscribing to just about every community I come across to see how the storage adds up. Right now I've got ~150 communities subbed. We'll see how it goes and when I'll need to expand the storage.
It's definitely overkill, but right now I'm hosting it on my nomad cluster. It only has 4cpu/8gb allocated at the moment but will autoscale (vertically) if needed. I already have a separate postgres cluster used for other things so I'm just borrowing that for now too.
I haven't tried running multiple instances yet but I'll probably test that out this week to see how/if it works.
I used the ansible method to get running and I am using the default paths. If you are also using the default paths, you can find your data in /srv/lemmy/<domain>/ . This location will hold your configuration files and your volumes directory. The volumes directory holds postgres (the database), pictrs (your image hosting) and lemmy-ui (the web-ui for lemmy). To see how much disk space you are using:
I have it running on my microk8s single node cluster. It's a dual xeon (40 cores total) with unfortunately only 64gb ram. The motherboard's max. I got a das with 72tb storage, currently in btrfs mirrored. Hoping btrfs raid-like configs become more usable in the future. I was using zfs but I always ran into issues.
I am running mine on an old Optiplex that i bought to run pihole and plex. It seems to be working fairly well although I am still trying to understand how all of this works.
shower thoughts... and still on my first cup of coffee to more just musing than anything ...
if storage is the concern wonder if the lemmy roadmap might one day include an option to use cloud based storage?
azure storage at .06/gb per month is likely cheaper and more redundant than local storage - even if you factor in calls to the blob which could be lowered via caching.
cloud storage potentially might one day lead to a option for smaller self hosters to opt into a shared blob instance where the and cost is shared.
in this scenario security to ensure the cloud blob couldn't be deleted would need to be thought through (maybe splitting the password among multiple admins with each having one part of the whole?) but might be one way to better encourage more self hosting for them compute side of things.
If I self hosted my own Lemmy on my home server, just for myself and I posted / uploaded images on it, when another user from another instance views my image, they cache it, would this mean later down the line if I deleted to free up server space, if someone else on that instance was to come across my image after deletion, because it was previously cached, the image would still show?
Wondering if rolling storage is possible eventually, where an archive of posts older than 2 years is performed and data deleted.
If I can eventually get it to work, I'll be hosting my personal Lemmy instance on a Hetzner CX21 VPS (2 CPU, 4GB RAM). Unfortunately after about a dozen attempts, with many variables tweaked to try to narrow down the issue, I still get nothing but a spinning button when I try to login after installation. I find it so odd that some people have no problem getting it up-and-running, and it simply won't work for others.
I experienced this too. If you're logging in as an admin with email verification turned on, there is a bug that prevents you from logging in (since technically your email isn't verified yet). I was able to get logged in by following the steps here (https://lemmy.click/comment/973) which included modifying the database table to mark your account as verified.
I had this issue today while making my own server, i think i fixed it by telling it to not use the dev version of lemmy and the v1.17.1 version of lemmy-ui.
If you need my whole docker-compose.yml:
version: "3.3"
networks:
# communication to web and clients
lemmyexternalproxy:
# communication between lemmy services
lemmyinternal:
driver: bridge
internal: true
services:
proxy:
image: nginx:1-alpine
networks:
- lemmyinternal
- lemmyexternalproxy
ports:
# actual and only port facing any connection from outside
# Note, change the left number if port 1236 is already in use on your system
# You could use port 80 if you won't use a reverse proxy
- "82:82"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro,Z
restart: always
depends_on:
- pictrs
- lemmy-ui
lemmy:
image: dessalines/lemmy:0.17.4
# use this to build your local lemmy server image for development
# run docker compose up --build
#build:
# context: ../
# dockerfile: docker/Dockerfile
# args:
# RUST_RELEASE_MODE: release
# this hostname is used in nginx reverse proxy and also for lemmy ui to connect to the backend, do not change
hostname: lemmy
networks:
- lemmyinternal
- lemmyexternalproxy
restart: always
environment:
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
- RUST_BACKTRACE=full
volumes:
- ./lemmy.hjson:/config/config.hjson:Z
depends_on:
- postgres
- pictrs
lemmy-ui:
image: dessalines/lemmy-ui:0.17.4
# use this to build your local lemmy ui image for development
# run docker compose up --build
# assuming lemmy-ui is cloned besides lemmy directory
# build:
# context: ../../lemmy-ui
# dockerfile: dev.dockerfile
networks:
- lemmyinternal
environment:
# this needs to match the hostname defined in the lemmy service
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
# set the outside hostname here
- LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1234
- LEMMY_HTTPS=true
depends_on:
- lemmy
restart: always
pictrs:
image: asonix/pictrs:0.4.0-beta.19
# this needs to match the pictrs url in lemmy.hjson
hostname: pictrs
# we can set options to pictrs like this, here we set max. image size and forced format for conversion
# entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
networks:
- lemmyinternal
environment:
- PICTRS_OPENTELEMETRY_URL=http://otel:4137
- PICTRS__API_KEY=API_KEY
- RUST_LOG=debug
- RUST_BACKTRACE=full
- PICTRS__MEDIA__VIDEO_CODEC=vp9
- PICTRS__MEDIA__GIF__MAX_WIDTH=256
- PICTRS__MEDIA__GIF__MAX_HEIGHT=256
- PICTRS__MEDIA__GIF__MAX_AREA=65536
- PICTRS__MEDIA__GIF__MAX_FRAME_COUNT=400
user: 991:991
volumes:
- ./volumes/pictrs:/mnt:Z
restart: always
postgres:
image: postgres:15-alpine
# this needs to match the database host in lemmy.hson
# Tune your settings via
# https://pgtune.leopard.in.ua/#/
# You can use this technique to add them here
# https://stackoverflow.com/a/30850095/1655478
hostname: postgres
command:
[
"postgres",
"-c",
"session_preload_libraries=auto_explain",
"-c",
"auto_explain.log_min_duration=5ms",
"-c",
"auto_explain.log_analyze=true",
"-c",
"track_activity_query_size=1048576",
]
networks:
- lemmyinternal
# adding the external facing network to allow direct db access for devs
- lemmyexternalproxy
ports:
# use a different port so it doesnt conflict with potential postgres db running on the host
- "5433:5432"
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=InsertDBPasswordHere
- POSTGRES_DB=lemmy
volumes:
- ./volumes/postgres:/var/lib/postgresql/data:Z
restart: always
I'm running it on an LXC container that lives on a proxmox cluster.
2 vCPU at 2.6Ghz.
2GB of RAM (it's LXC so I can allocate more if needed...)
and 40GB of SSD-backed CEPH storage. I actually just upped this to 150GB because I can see the velocity of data I'm storing for this. I have about 2 more TB of storage on the CEPH cluster before I need to order a few more SSDs.
I have terrible internet, but I do have a static address. And they're installing fiber in my neighborhood right now. So that will change soon too.
Based on what I've seen thus-far, I suspect I can handle about a hundred users on this without much issue.
I host it on a low power PC in my closet. I also limit the resource usage to 2 cores and 2GB of RAM in Kubernetes (RKE2) config. My ISP won't give me any static IP, so I routed the traffic via a $3 VPS over tailscale network.
We have our instance running on a colo server. I am likely going to rebuild ansible to use a custom pict-rs docker container which offloads images to object storage so I don't need to store media locally on said server.
That is a good idea. I did a quick and dirty rclone mount for the pict-rs storage, partly because it was fast and partly because I was curious how it would hold up.
I'm running on a Racknerd BF deal .. 25gb HDD, 2GB Ram, 2CPU i think.. i can't find the link any more but it was from a site that seemed to list just a handful of vps deals..
I need to move it though to be honest to something with a little more disk space.
Works fine for me on the same Hetzner VPS. In parallel with Mastodon and Matrix instances. With minimal user base Lemmy is least resource consuming from other two
Mine is a VPS on Vultr with 1vCPU, 2GB RAM, and a small SSD. It's shared with a Mastodon instance as neither service appears to be particularly heavy on server resources and I don't intend to have very many active users (4-5 tops.)