Files
MajorWiki/02-selfhosting/services/mastodon-instance-tuning.md
MajorLinux 6592eb4fea wiki: audit fixes — broken links, wikilinks, frontmatter, stale content (66 files)
- Fixed 4 broken markdown links (bad relative paths in See Also sections)
- Corrected n8n port binding to 127.0.0.1:5678 (matches actual deployment)
- Updated SnapRAID article with actual majorhome paths (/majorRAID, disk1-3)
- Converted 67 Obsidian wikilinks to relative markdown links or plain text
- Added YAML frontmatter to 35 articles missing it entirely
- Completed frontmatter on 8 articles with missing fields

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 11:16:29 -04:00

3.1 KiB

title, domain, category, tags, status, created, updated
title domain category tags status created updated
Mastodon Instance Tuning selfhosting services
mastodon
fediverse
self-hosting
majortoot
docker
published 2026-04-02 2026-04-02

Mastodon Instance Tuning

Running your own Mastodon instance means you control the rules — including limits the upstream project imposes by default. These are the tweaks applied to majortoot (MajorsHouse's Mastodon instance).

Increase Character Limit

Mastodon's default 500-character post limit is low for longer-form thoughts. You can raise it, but it requires modifying the source — there's no config toggle.

The process depends on your deployment method (Docker vs bare metal) and Mastodon version. The community-maintained guide covers the approaches:

Key points:

  • The limit is enforced in both the backend (Ruby) and frontend (React). Both must be changed or the UI will reject posts the API would accept.
  • After changing, you need to rebuild assets and restart services.
  • Other instances will still display the full post — the character limit is per-instance, not a federation constraint.
  • Some Mastodon forks (Glitch, Hometown) expose this as a config option without source patches.

Media Cache Management

Federated content (avatars, headers, media from remote posts) gets cached locally. On a small instance this grows slowly, but over months it adds up — especially if you follow active accounts on large instances.

Reference: Fedicache — Understanding Mastodon's media cache

Clean up cached remote media:

# Preview what would be removed (older than 7 days)
tootctl media remove --days 7 --dry-run

# Actually remove it
tootctl media remove --days 7

# For Docker deployments
docker exec mastodon-web tootctl media remove --days 7

Automate with cron or systemd timer:

# Weekly cache cleanup — crontab
0 3 * * 0 docker exec mastodon-web tootctl media remove --days 7

What gets removed: Only cached copies of remote media. Local uploads (your posts, your users' posts) are never touched. Remote media will be re-fetched on demand if someone views the post again.

Storage impact: On a single-user instance, remote media cache can still reach several GB over a few months of active federation. Regular cleanup keeps disk usage predictable.

Gotchas & Notes

  • Character limit changes break on upgrades. Any source patch gets overwritten when you pull a new Mastodon release. Track your changes and reapply after updates.
  • tootctl is your admin CLI. It handles media cleanup, user management, federation diagnostics, and more. Run tootctl --help for the full list.
  • Monitor disk usage. Even with cache cleanup, the PostgreSQL database and local media uploads grow over time. Keep an eye on it.

See Also