Mastodon Server Cleanup

Overview

General commands for cleaning up resources on Mastodon servers

Setup

  1. Stop services

    sudo systemctl stop mastodon-sidekiq mastodon-streaming mastodon-web
    
  2. Restart postgresql

    sudo systemctl restart postgresql
    
  3. Log into mastodon user

    sudo su -u mastodon
    
  4. Go to live directory

    cd /home/mastodon/live
    

Check media usage

RAILS_ENV=production ./bin/tootctl media usage

Remove media

RAILS_ENV=production ./bin/tootctl media remove

Remove media headers

RAILS_ENV=production ./bin/tootctl media remove --prune-profiles

Remove preview cards

RAILS_ENV=production ./bin/tootctl preview_cards remove

Restart services

sudo systemctl restart mastodon-sidekiq mastodon-streaming mastodon-web

Resources