I know there are quite some struggling with the disk space usage of the mastodon instance they maintain. The issue is not acknowledged enough and there are very few ways you can mitigate this using the official mastodon tools etc. Even better, often the proposed 'solution' is to 'get more disk space lol'.

Here's a compilation of recipes on how we try to deal with this for as we learn by doing.

In general we document many parts of on that wiki so that other collectives can use that information:

@rra Glad my little script was able to help others here haha. My tiny little server was being consumed by Mastodon.

@rra Thanks for sharing your tips! Cleaning the yarn cache is a helpful one for me (especially since I run multiple instances on one server).

Also: switching from local media storage to an S3-compatible server was a big help for me. Disk doesn't grow nearly as fast now (just the Postgres database, not the media files).

I'm also curious how other #MastoAdmins are dealing with the memory growth. I have to restart every month or so, or it reaches my server's max of 8GB (running 3 instances).

@nolan @rra Can't we remove everything but the local toots and media, and the global toots that are boosted and liked (and say the last few days of toots)?

@rra Or just use Pleroma and avoid all those hassles.

Might be worth making your media attachments script a bit more robust?


if [[ -n $1 ]]; then

if [[ $(whoami) != "mastodon" ]]; then
echo "Must run as 'mastodon' user..."
exit 2
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export RAILS_ENV=production

"${MASTOHOME}/live/bin/tootctl" statuses remove
"${MASTOHOME}/live/bin/tootctl" media remove --days="${DAYS}"

@rra Otherwise, for someone hosting a small instance, this is great!

Sign in to participate in the conversation

Welcome to, an instance for discussions around cultural freedom, experimental, new media art, net and computational culture, and things like that. This is part of a family of services that include mailing lists, group chat, and XMPP.