NODED.CLOUD/Blog/Mastodon Server on a VPS: Requirements, Media Storage and Sizing

Mastodon Server on a VPS: Requirements, Media Storage and Sizing

08 Nov 2026 · Mario Marin

Your own Mastodon instance on a VPS: what the stack needs (PostgreSQL, Redis, Sidekiq), install outline, ports, keeping media growth in check, mail through a relay, an estimated sizing table, backups and moderation.

A Mastodon server is your own corner of the Fediverse: accounts on your domain that follow and are followed by people on any other server. On a VPS it means running nginx, the Rails web app, the streaming API, Sidekiq, PostgreSQL and Redis together, plus a mail relay and a plan for media that keeps growing.

This post covers what a Mastodon server needs, the install path, the ports, how media storage grows and when to move it to object storage, mail through a relay, a sizing table by active users, backups and moderation. Details come from the Mastodon documentation and the v4.7.4 release of 29 October 2026, which includes a security fix, so upgrade existing servers first.

What does a Mastodon server need?

Mastodon is several processes, each with its own job:

  • Web (Puma, Rails) serves the API and web pages, on port 3000 by default.
  • Streaming API (Node.js) pushes live timeline updates, on port 4000 by default.
  • Sidekiq does the background work: delivering posts to other servers, processing incoming activity, sending mail, fetching remote media.
  • PostgreSQL holds everything that matters; Redis holds home feeds and the job queues.
  • nginx terminates TLS and serves uploaded media.

The current README sets the floor at Ruby 3.3, PostgreSQL 14, Redis 7.0 and Node.js 22. The install guide targets Ubuntu 24.04 or Debian 13, both on our image list, and asks for three things before you start: root access, a domain, and an email delivery service. The domain matters more than it looks: LOCAL_DOMAIN cannot be safely changed later, because other servers would treat your accounts as new ones. If the bare domain already hosts a website, WEB_DOMAIN lets handles read @alice@example.org while Mastodon runs on social.example.org.

How do you install Mastodon on a VPS?

The documented path is a native install as a mastodon user, in outline:

  1. Harden the box first, as the prerequisites page suggests: keys-only SSH, fail2ban, and a firewall that allows only SSH, HTTP and HTTPS.
  2. Add the Node.js and PostgreSQL repositories, then install nginx, Redis, PostgreSQL, ffmpeg, ImageMagick, libvips, certbot and the build tools.
  3. Create a PostgreSQL role for mastodon, clone the latest stable tag, install Ruby with rbenv, then run RAILS_ENV=production bin/rails mastodon:setup. The wizard writes .env.production, compiles assets and creates the database schema.
  4. Get a certificate with certbot, copy dist/nginx.conf, then enable the mastodon-web, mastodon-sidekiq and mastodon-streaming services.

Registrations are closed in the browser by default. Create your own account from the command line with the Owner role:

RAILS_ENV=production bin/tootctl accounts create alice \
  --email alice@example.org --confirmed --role Owner

For a personal server, SINGLE_USER_MODE=true redirects the front page to your profile and keeps registrations off.

Full-text search is optional. It needs a separate Elasticsearch-compatible search service, built with tootctl search deploy, and that service wants its own memory. On a small server, skip it at first; hashtag and account search work without it.

Mail through a relay

Mastodon mails sign-up confirmations, password resets and notifications, and the install guide lists a mail service as a prerequisite. Outbound SMTP on TCP 25 is blocked on every Noded VPS, so use a relay or transactional provider on submission port 587 in .env.production:

SMTP_SERVER=smtp.relay-provider.example
SMTP_PORT=587
SMTP_LOGIN=mastodon@example.org
SMTP_PASSWORD=RELAY-PASSWORD
SMTP_FROM_ADDRESS=Mastodon <notifications@example.org>
SMTP_ENABLE_STARTTLS=auto

Publish the relay's SPF and DKIM records on your domain. Our email hosting page explains why we recommend a relay for outbound mail.

Which ports does a Mastodon server need?

Only nginx faces the internet. Everything else listens on localhost.

PortServiceOpen to
22/tcpSSHYour IP, keys only
80/tcpnginx: certbot, redirect to HTTPSEveryone
443/tcpnginx: web, API, ActivityPub federation, mediaEveryone
443/udpHTTP/3, optionalEveryone, if enabled in nginx
3000/tcpPuma web processLocalhost only
4000/tcpStreaming APILocalhost only
5432/tcp, 6379/tcpPostgreSQL, RedisLocalhost only

Federation means other servers call yours constantly, and a popular post can bring bursts of requests. Every Noded VPS includes 100 Gbps of always-on Layer 3/4 DDoS protection, which filters floods upstream; application-level load is yours to tune with Puma and Sidekiq settings.

How fast does Mastodon media storage grow?

Less from what your users post than from what they follow. When someone on your server follows accounts elsewhere, Mastodon downloads copies of their images, video, avatars, headers and link preview cards. The remote cache usually dwarfs local uploads. The arithmetic is simple: as an example, if timelines pull in 1 GB of remote media a day, keeping it for 7 days holds about 7 GB, and keeping it for 30 days about 30 GB. Measure your own rate with tootctl media usage after a week.

Two tools keep it bounded. The tootctl media commands clear cached remote files, with a default age of 7 days, and preview cards have their own cleanup. Run them from cron:

RAILS_ENV=production bin/tootctl media remove --days 7
RAILS_ENV=production bin/tootctl media remove --prune-profiles --days 30
RAILS_ENV=production bin/tootctl preview_cards remove --days 30

Local uploads are permanent, and PostgreSQL grows steadily with posts and federation history. Our VPS disks go up to 270 GB (120 GB on the largest shape plus 150 GB extra). The object storage docs call the filesystem fine for small servers and S3-compatible storage the scalable option: set S3_ENABLED=true with endpoint, bucket and keys, and pick a provider with ACL support and an EU region.

Which Noded plan fits a Mastodon server?

Mastodon's docs publish no hardware table, so the active-user ranges below are our estimate for planning, not a benchmark; how much your users follow matters more than how many there are. Prices are monthly, in euros, excluding VAT, from our live catalogue.

Server, active users (estimate)PlanvCPU / RAM / SSDBucharestSofia
Single user or family, up to about 5VPS II2 / 4 GB / 40 GB€6€9
Small community, up to about 50VPS III2 / 8 GB / 60 GB€10€16
Community, up to a few hundredVPS IV4 / 16 GB / 80 GB€16€26
Larger community, more Sidekiq threadsVPS V6 / 24 GB / 100 GB€30€44
Large server before splitting rolesVPS VI8 / 32 GB / 120 GB€58€78

Extra disk is €4 a month per 50 GB, up to 150 GB. When one box gets tight, the scaling guide shows the next steps: more Puma processes (WEB_CONCURRENCY) cost RAM, more threads (MAX_THREADS) cost CPU, and Sidekiq can run as separate processes per queue so federation traffic does not delay local users. Moving PostgreSQL to its own VPS is the usual first split; see our PostgreSQL and Redis sizing posts.

Backups and moderation before you open sign-ups

The backup docs rank what to save: PostgreSQL first, since losing it ends the server; then .env.production, whose loss logs everyone out and breaks two-factor login; then uploaded files; Redis last. Keep copies off the server. Our VPS plans have no snapshots or backups, so dump the database nightly and send it, with the secrets file, to a machine in another location, as our backup target post describes.

Moderation is part of running a server, not an extra. Write server rules, decide between open, approval-required or closed sign-ups, and give at least one other person the Moderator role. Mastodon itself switches open registrations to approval-required if no moderator activity is seen for a week, to stop abandoned servers becoming spam sources. Domain blocks, reports and account actions are all in the admin interface.

Questions people ask

How much RAM does a Mastodon server need?

The docs give no fixed figure. By our estimate, 4 GB runs a single-user server with PostgreSQL and Redis on the same box, and 8 GB is a comfortable start for a small community.

Can I log in to Mastodon with my own SSO?

Yes, Mastodon supports OpenID Connect login. Our Authentik vs Keycloak guide covers running the identity provider.

Does Mastodon federate with PeerTube and Owncast?

Yes, through ActivityPub: Mastodon users can follow PeerTube channels and get notified when an Owncast stream goes live. See our PeerTube server guide.

Should I use object storage from day one?

Not for a personal or small server: the filesystem is the documented default for small servers, and media cleanup keeps it bounded. Move to S3-compatible storage when uploads and cache approach the disk you can attach, or before you split the server into several machines.

Why does my Mastodon disk keep filling up?

Usually the remote media cache. Schedule tootctl media remove and the preview card cleanup, and check tootctl media usage to see where the space goes.

Running Mastodon on Noded in the EU

Your users' accounts, posts and direct messages live in your PostgreSQL database, so the server's location is where that personal data sits. Pick Bucharest or Sofia and the VPS stays in the EU under GDPR; our data processing agreement is part of the Terms, as the GDPR hosting page explains. Start with VPS II or VPS III from the VPS hosting page, add extra disk when tootctl media usage says so, and resize to a bigger shape from the panel as the community grows.

← All posts

Related services

Run this on NODED.CLOUD.

Keep reading

More from the NOC.

Like the way we run things? Spin up a server in 60 seconds.