−25%

on annual Windows plans, until 31 Oct. See plans

EQVPS

VPS for Mastodon: run your own small instance

Host a small Mastodon instance on a VPS: honest RAM and disk sizing, Docker setup, email via an SMTP relay, and media cleanup so the disk doesn't fill.

Owning your social account is a nice idea until you realise the account lives on someone else's server, under their rules and uptime. Running your own Mastodon instance fixes that: your handle is @you@your-domain, and nobody can shut it down but you. The catch is that Mastodon is not a small app. It's worth knowing what you're signing up for.

Who this is for

For anything bigger, you're running a service with moderation duties, abuse reports and real infrastructure. That's a different conversation.

What it really needs

Mastodon runs several processes at once: the Rails web app, Sidekiq background workers, a streaming server, PostgreSQL and Redis. Federation means your server keeps fetching posts and media from other servers even when you're asleep.

InstancePlan
Single user, few followsSmall-IP — 2 vCPU, 4 GB, $16/mo
Small community, active federationMedium-IP — 4 vCPU, 6 GB, $20/mo

4 GB works but runs tight; Sidekiq queues back up when a popular post you follow gets thousands of replies. 6 GB gives you room to breathe. Disk is the other constraint — see the media section below.

You also need a domain and a dedicated IP: other servers deliver to yours on port 443.

Setup with Docker

The official repository ships a docker-compose.yml. On a fresh Ubuntu 24.04 server with Docker installed:

git clone https://github.com/mastodon/mastodon.git
cd mastodon
git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)
touch .env.production
docker compose run --rm -v $(pwd)/.env.production:/opt/mastodon/.env.production \
  web bundle exec rake mastodon:setup
docker compose up -d

The setup task asks for your domain, database and Redis settings (the defaults match the compose file), email settings and the first admin account. It writes everything to .env.production. Read the release notes of the tag you checked out — the steps occasionally change between major versions.

Mastodon includes an nginx template at dist/nginx.conf. Copy it to /etc/nginx/sites-available/, replace the domain, and get a certificate with certbot. Our reverse proxy guide and domain guide cover both.

Email: use a relay

Mastodon sends confirmation and password-reset emails. Ports 25 and 465 are closed on our servers, so point Mastodon at an external transactional email provider over port 587:

SMTP_SERVER=smtp.your-provider.example
SMTP_PORT=587
SMTP_LOGIN=apikey
SMTP_PASSWORD=your-smtp-password
SMTP_FROM_ADDRESS=notifications@your-domain.example

Honestly, you'd want a relay anyway. Mail from a brand-new server IP tends to land in spam; a relay has the reputation you don't.

Media: the disk eater

Every image and video from accounts your server sees gets cached locally. On a busy instance that's gigabytes a week. Clean up old remote media on a schedule:

docker compose exec web tootctl media remove --days 7
docker compose exec web tootctl preview_cards remove --days 30

Put those in a daily cron job. If your instance grows, move media to S3-compatible object storage using the S3_* settings in .env.production — then the VPS disk only holds the database.

Upkeep

Want something lighter for a team chat instead? A Matrix server might fit better.

Ready to deploy? Pay with crypto, no KYC — live in about a minute.

Deploy now →

FAQ

How much RAM does a Mastodon instance need?

For a single-user or small instance, 4 GB is the realistic minimum and 6 GB is comfortable. Mastodon runs a web process, Sidekiq workers, PostgreSQL and Redis at the same time, and federation keeps Sidekiq busy even when nobody is posting.

Why does Mastodon need a dedicated IP?

Other servers deliver posts to yours over HTTPS on port 443, and people open your instance in a browser. That needs inbound 443 on your own IP, which NAT plans don't have.

How do I send email from Mastodon?

Use an external transactional email provider over SMTP submission on port 587. Ports 25 and 465 are closed on our servers, and a relay also gives you far better deliverability than a fresh IP would.

Why is my disk filling up so fast?

Your server caches media from every account it sees. Run 'tootctl media remove --days 7' on a schedule, or move media to S3-compatible object storage.

Can I change the domain later?

No. Your domain is part of every account's identity across the fediverse. Choose it carefully before the first account is created.

Comments

No comments yet. Be the first.

Leave a comment

Comments are moderated before they appear.