[Question] Disk Space for Lemmy and Mastodon instances

Hi, I'm new with self-hosting but managed to set up my own Lemmy and Mastodon instances on a VPS recently. However, I ran into an issue with disk space quite rapidly (which I had way too few, because I started with the cheapest, smallest package for my VPS).

Now I prepare a new setup, where I'll be able to dynamically scale disk space as needed, but this can get expensive quickly. Therefor my question: How much disk space do I typically need for private (1-3 user) instances of Lemmy and Mastodon? Are there settings, where I can limit the disk space utilization (at the cost of older stored content being overwritten)?

I would be fine with needing up to like 30-40 GB, but any more than that would be getting kinda expensive ....

ruud,
@ruud@lemmy.world avatar

Do you need Mastodon, or can it be something similar? Mastodon does a lot of caching. For my single-user instance I run Akkoma, which is very leight-weight and has all (even more) features Mastodon has.

ruud,
@ruud@lemmy.world avatar

By the way this is Media disk usage for my Mastodon instance, but it's not really small ;-)

https://lemmy.world/pictrs/image/a3a0bf1c-e96b-43f8-882b-fd7488dc635e.png

void_wanderer,

So, how much do you spend, why are you doing it, and do you get any funding or paying this or of your pocket? (just trying to understand how the fediverse works)

midas,

If you have storage at home, consider running pictrs and/or minio there and referencing it on the VPS through something like tailscale

losttourist, (edited )
losttourist avatar

I can't help with Lemmy, but I've been running a single-user Mastodon instance for almost a year now.

Like you, I found that the media very quickly used up much more disk space than I anticipated. There are a few things you can do.

You can tune how long media is stored for: some of this is done in the admin interface, but really you need to set up cron jobs to regularly run various tootctl commands. This is the crontab I use:

SHELL=/bin/bash
PATH=/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/bin:/usr/local/bin:/usr/bin:/bin

RAILS_ENV=production
# Remove media attachments older than 8 days
11  19  *   *   *     cd /home/mastodon/live && time bin/tootctl media remove --days 8
# Remove link previews older than 28 days
22  5   *   *   *     cd /home/mastodon/live && time bin/tootctl preview_cards remove --days 28
# Remove files not linked to any post
 3  23  *   *   0     cd /home/mastodon/live && time bin/tootctl media remove-orphans
# Prune remote accounts that never interacted with a local user
44  1   *   *   *     cd /home/mastodon/live && time bin/tootctl accounts prune

You can of course choose even stricter settings but I found that no matter what I did, given that I am following approx 1,000 other Fediverse accounts it still used up more disk space than I was comfortable with.

So I offloaded most of the media storage onto an S3-compatible service. It's breaking the self-hosting ethos somewhat, but with Backblaze B2 I can happily store and serve several hundred GB of media files for just a couple of dollars a month. To me, that was a no-brainer.

rimu,
rimu avatar

I have heard of Mastodon instances with a dozen users using about 50 GB. So 40 GB for a single user should be enough, if you set up cron jobs to automatically prune old content. It depends how many people you follow and whether you set up a relay or not. (Single user instances without a relay kinda suck)

NB space on a VPS is usually a lot more expensive than space on S3 or equivalent. If you can configure Mastodon to store images on S3 it'll be more cost effective.

meldrik,
@meldrik@lemmy.wtf avatar

My Lemmy instance is using 3GB and it has 100 users.

TX,

@Solvena my kbin instance is using 37 GB right now, and it is one of the oldest instances. I don't have many user thou.

akkerman,

@Solvena Hey, I consider hosting the mastodon intance for myself also. How much diskspace usage did you observed?

Solvena,

I had 10GB assigned for Lemmy and Mastodon (both single user instances) and the disk space filled up in a couple of days. I have implemented some of the tips given here now, so we will see.

lml,

My kbin instance's data (text data, that is) probably takes up less than 8 GB right now, and I've had it running about two weeks. Media storage (which I do through S3) is around 5 GB so far. Kbin does do media mirroring different than Lemmy though (I think), so YMMV. I think Lemmy mostly links to the original instance's media object as the source.

The main thing I found eating storage on my server was a lot of old Docker images (and volumes) from me trying to get everything up and running. If you are using Docker you could try doing a docker system prune --all to get rid of unused images/build caches (anything that isn't running currently).

  • All
  • Subscribed
  • Moderated
  • Favorites
  • selfhosted@lemmy.world
  • kavyap
  • InstantRegret
  • ethstaker
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • thenastyranch
  • Youngstown
  • tacticalgear
  • slotface
  • Durango
  • khanakhh
  • rosin
  • everett
  • Leos
  • vwfavf
  • normalnudes
  • osvaldo12
  • cubers
  • GTA5RPClips
  • cisconetworking
  • ngwrru68w68
  • anitta
  • provamag3
  • tester
  • modclub
  • megavids
  • JUstTest
  • All magazines