How to Host Your Own Mastodon Server: Step-by-Step (2026 Edition)

Running your own Mastodon instance gives you complete control over your social media experience: your data, your rules, your community. It also comes with real responsibilities. This guide walks through the complete process of setting up and maintaining a Mastodon server in 2026, from initial planning to ongoing operations.

What You’ll Know by the End

  • Hardware and infrastructure requirements for a Mastodon instance
  • Step-by-step server setup process
  • Database, media storage, and email configuration
  • Federation, moderation, and administration basics
  • Ongoing maintenance costs and responsibilities

Before You Start: Is Self-Hosting Right for You?

Self-hosting a Mastodon instance is a commitment. Be honest about these questions:

Technical skill: You need comfort with Linux system administration, Docker or bare-metal deployments, and basic networking.

Time commitment: Ongoing maintenance (updates, moderation, user support) takes consistent effort. Even a single-user instance needs occasional attention.

Cost: Expect to spend at least a moderate amount monthly on hosting, and more as your instance grows. Media storage is often the largest ongoing cost.

Legal responsibility: As an instance operator, you may be subject to regulations (GDPR, DSA, local laws) depending on your jurisdiction and who uses your server.

If any of these give you pause, consider joining an existing well-run instance instead. Our FAQ has guidance on choosing an instance.

Infrastructure Planning

Server Requirements

For a small instance (1–50 users):

  • CPU: 2+ cores
  • RAM: 4 GB minimum, 8 GB recommended
  • Storage: 40 GB for the application, plus object storage for media
  • Bandwidth: Moderate; federation generates steady traffic

For a medium instance (50–500 users):

  • CPU: 4+ cores
  • RAM: 8–16 GB
  • Storage: Object storage essential (S3-compatible)
  • Bandwidth: Higher; expect significant federation and media traffic

Hosting Options

VPS providers: DigitalOcean, Hetzner, Linode, and similar providers offer appropriate instances. Choose a provider with good networking and reasonable bandwidth pricing.

Managed Mastodon hosting: Services like Masto.host and Fedi.Monster handle the infrastructure for you. This is a middle ground between self-hosting and joining someone else’s instance.

Home server: Possible for single-user instances but requires a static IP, good upstream bandwidth, and UPS backup. Not recommended for multi-user instances.

Setup Process Overview

The high-level process for deploying Mastodon:

1. Domain and DNS

Choose your domain (this becomes your instance’s identity in the fediverse). Set up DNS records:

  • An A record pointing to your server’s IP
  • Optionally, a CNAME for media subdomains if using a CDN

2. Server Preparation

Start with a fresh Ubuntu LTS or Debian server:

  • Update system packages
  • Configure firewall (allow HTTP/HTTPS and SSH)
  • Set up a non-root user with sudo
  • Install required dependencies (Node.js, Ruby, PostgreSQL, Redis, Nginx)

3. Mastodon Installation

Mastodon can be installed via Docker or bare-metal. Docker is simpler for most operators:

Docker approach:

  • Clone the Mastodon repository
  • Configure the environment file (.env.production)
  • Run the database setup
  • Start the services

Bare-metal approach:

  • Install Ruby and Node.js
  • Clone and build Mastodon
  • Set up Systemd services for web, streaming, and Sidekiq workers

4. Configure Core Services

PostgreSQL: Mastodon’s primary database. Ensure regular backups and appropriate connection limits.

Redis: Used for caching and background job queues. Default configuration is usually sufficient for small instances.

Sidekiq: Background job processor that handles federation, email, and scheduled tasks. Monitor queue depth to ensure it keeps up.

Nginx: Reverse proxy that handles TLS termination and static asset serving.

5. Email Configuration

Mastodon requires email for account confirmation and notifications. Configure an SMTP provider (Mailgun, Postmark, or similar). Self-hosted email is possible but more complex to maintain.

6. Object Storage for Media

Media files (images, videos, avatars) grow quickly. S3-compatible object storage (AWS S3, Backblaze B2, MinIO) is strongly recommended over local disk storage. This keeps your server’s disk manageable and enables CDN integration.

7. TLS Certificate

Use Let’s Encrypt with Certbot for free, automated TLS certificates. Ensure automatic renewal is configured.

Post-Installation Configuration

Federation Settings

Once your instance is running:

  • It will begin federating automatically as users follow accounts on other instances
  • Consider subscribing to relays to improve your federated timeline
  • Review and set your federation policies (which instances to block or limit)

Moderation Setup

  • Configure server rules that users agree to on signup
  • Set up moderation reports and response workflows
  • Decide on registration policy (open, approval-required, or invite-only)
  • Review trending content settings

Customization

  • Upload your instance’s branding (logo, banner)
  • Write an about page that clearly describes your community
  • Configure custom emoji if desired
  • Set up announcements for important updates

Ongoing Maintenance

Self-hosting is not a “set and forget” proposition:

Updates: Mastodon releases updates regularly. Stay current for security patches and new features. Test updates on a staging environment if possible.

Backups: Automate daily database backups. Test restores periodically. Media backup depends on your storage setup.

Monitoring: Track server resources (CPU, RAM, disk, bandwidth), Sidekiq queue depth, and error logs. Set up alerts for critical issues.

Moderation: Review reports, handle user issues, and update federation policies as needed. This is often the most time-consuming ongoing task.

Cost management: Monitor your hosting and object storage costs monthly. Media storage tends to grow faster than expected.

See our developer notes for more on operational patterns for fediverse applications.

Common Mistakes

  • Underestimating media storage growth: Media is the primary cost driver for most instances; plan for object storage from day one
  • Neglecting backups: Database corruption or server failure without backups means losing your community
  • Running outdated versions: Security vulnerabilities in old versions can compromise your instance and federation partners
  • Ignoring moderation: Even small instances need clear rules and active moderation to maintain a healthy community
  • Over-provisioning initially: Start small and scale up as needed; you can always upgrade your server

Frequently Asked Questions

How much does it cost to run a Mastodon instance? Costs vary widely. A single-user instance can run on a minimal VPS. A multi-user instance with active federation costs more, primarily for compute and media storage. Managed hosting services publish their pricing tiers.

Can I run Mastodon on a Raspberry Pi? Technically possible for a single-user instance, but not recommended for performance reasons. A low-end VPS is more reliable.

How do I migrate from one server to another? Mastodon has migration tools for both user accounts and full instance moves. Database and media migration require careful planning. Document your process and test before migrating a live instance.

What happens if my instance goes down? Federation queues on other instances will retry delivery. Short outages are handled gracefully. Extended outages may cause other instances to stop trying to deliver content, which recovers once your instance comes back.

Do I need to moderate if it is just me? A single-user instance has minimal moderation needs, but you still need to keep the software updated and handle any abuse reports from other instances about your content. Check our tools page for administration resources.

Can I later open my single-user instance to others? Yes. You can change registration settings at any time. Be prepared for the additional moderation and infrastructure needs that come with more users. See our articles hub for community management guides.