Mastodon Self-Hosted Instance Storage Costs: Real-World Numbers
🔍 WiseChecker

Mastodon Self-Hosted Instance Storage Costs: Real-World Numbers

Running a self-hosted Mastodon instance requires a clear understanding of storage costs. Many administrators underestimate how quickly media files from federated posts consume disk space. Without proper planning, a small community instance can exceed 100 GB in months, leading to unexpected hosting bills. This article breaks down real-world storage usage for instances of different sizes and explains the cost per user.

Key Takeaways: Mastodon Storage Costs for Self-Hosted Instances

  • Media file retention policy in Admin > Server Settings > Media Retention: Reducing the retention period from forever to 30 days cuts storage by up to 70%.
  • Object storage migration to S3-compatible services: Moving media to Amazon S3 or Backblaze B2 reduces server disk pressure and scales storage cost per GB.
  • Average storage per active user per month: A typical active user generates 150–300 MB of media and database data per month on a federated instance.

How Mastodon Storage Usage Accumulates on Self-Hosted Instances

Mastodon stores two main categories of data: the PostgreSQL database and media files. The database contains accounts, toots, and relationships. Media files include images, videos, and custom emoji from both local users and federated posts. Media files account for 80–90% of total disk usage on a typical instance.

The federation model causes storage to grow faster than the number of local users. When a local user follows a remote account, Mastodon downloads that account’s recent posts and media. If 100 local users follow 100 remote accounts each, the instance caches up to 10,000 remote profiles. This amplification effect means storage costs correlate more with the number of followed remote accounts than with local user count.

Database Growth Patterns

The PostgreSQL database grows by about 10–20 MB per active user per month. This growth comes from toot text, favorites, boosts, and follow relationships. Database size rarely exceeds 10 GB unless the instance has thousands of active users. Most administrators find database costs negligible compared to media storage.

Media File Growth Patterns

Media files accumulate at 100–300 MB per active user per month. The variation depends on user behavior. Users who post many images or videos generate more data. Users who follow image-heavy accounts cause the instance to download large media files. A single video post from a federated account can be 50–100 MB.

Mastodon does not re-encode media by default. It stores the original file as posted by the remote server. This means a 4K video uploaded to a remote instance will be stored at full size on your instance after the first user views it.

Real-World Storage Numbers by Instance Size

The following numbers are based on public data from Mastodon instances and reports from administrators. Actual usage varies based on federation patterns and user activity.

Small Instance: 10 Active Users

A small instance with 10 active users and default settings typically uses 15–30 GB of storage after six months. Media files account for 12–25 GB. The database is 1–2 GB. Monthly growth is about 2–5 GB.

Medium Instance: 100 Active Users

A medium instance with 100 active users and default settings uses 150–300 GB after six months. Media files account for 120–260 GB. The database is 5–10 GB. Monthly growth is about 20–50 GB.

Large Instance: 1,000 Active Users

A large instance with 1,000 active users and default settings uses 1.5–3 TB after six months. Media files account for 1.2–2.6 TB. The database is 30–60 GB. Monthly growth is about 200–500 GB.

These numbers assume default media retention settings, which keep all media indefinitely. Reducing the retention period to 30 days can reduce storage by 60–70% after the initial 30-day period.

Steps to Estimate and Control Storage Costs

Use these steps to measure your instance’s current storage and apply cost controls.

  1. Check current storage usage from the admin dashboard
    Go to Admin > Server Settings > Media Retention. The dashboard shows total media storage, number of media attachments, and the date of the oldest cached media.
  2. Calculate cost per GB from your hosting provider
    Check your VPS or dedicated server pricing. Typical prices are $0.02–$0.10 per GB per month for block storage. Object storage from Backblaze B2 costs $0.006 per GB per month. Amazon S3 standard storage costs $0.023 per GB per month.
  3. Set a media retention policy
    In Admin > Server Settings > Media Retention, set the number of days to keep cached media. A 30-day retention period balances user experience with storage cost. Change the field labeled “Remove cached media after” to 30.
  4. Move media to object storage
    Edit the .env.production file to enable S3-compatible storage. Set the S3_ENABLED=true variable and provide your bucket name, access key, and secret key. Run RAILS_ENV=production bin/tootctl media refresh to move existing media to the new storage.
  5. Run periodic media cleanup tasks
    Use the tootctl media remove command to delete cached media older than a specified number of days. Example: RAILS_ENV=production bin/tootctl media remove --days=30 removes media cached more than 30 days ago.
  6. Monitor storage growth weekly
    Set up a cron job that runs du -sh /path/to/mastodon/public/system and emails the output to you. Compare the value each week to detect abnormal growth.

Common Mistakes That Increase Storage Costs

Keeping Default Retention Settings Indefinitely

The default Mastodon installation keeps all cached media forever. This causes storage to grow without bound. Change the retention period to 30 or 60 days immediately after setup.

Not Using Object Storage for Media

Storing media on the server’s local disk fills up the root partition quickly. Object storage scales independently and costs less per GB for large volumes. Migrate to S3 or Backblaze B2 before the instance reaches 50 GB of media.

Ignoring Federation Amplification

A single user following 500 remote accounts can cause your instance to download 500 profile images and the latest posts from each account. Limit the number of remote accounts a new user can follow during the first week.

Not Removing Local Media Attachments

Local users’ media attachments are never automatically removed unless you run the tootctl media remove command with the --include-media flag. Run this command weekly to keep local media under control.

Item Local Disk Storage Object Storage (S3/B2)
Cost per GB per month $0.02–$0.10 $0.006–$0.023
Scalability limit Server disk capacity (typically 50–500 GB) Unlimited (pay per GB)
Setup complexity None (default) Requires .env.production changes and bucket creation
Media retention control Manual cleanup via tootctl Automatic lifecycle policies can delete old objects
Backup method Server snapshot or rsync Cross-region replication or versioning

Self-hosting a Mastodon instance requires active storage management. Set a media retention policy of 30 days, migrate media to object storage, and run weekly cleanup tasks. These three actions keep storage costs predictable and prevent unexpected hosting bills. For a 100-user instance, this reduces monthly storage costs from approximately $15–$30 on local disk to $1–$3 on Backblaze B2.