To manage your Mastodon instance first login to your server.
Change to mastodon user:
su - mastodon
Set the environment:
export RAILS_ENV=production
Add some folders to PATH:
export PATH="$HOME/.rbenv/bin:$PATH"
Change to the folder:
cd ~/live
All next commands are in the right folder, with the right environment.
Remove orphaned media files:
tootctl media remove-orphans
Show media storage usage:
tootctl media usage
Fix duplicates (offline):
tootctl maintenance fix-duplicates