Is a VPS really enough?
For a small server, yes. Mastodon's guide to running your own server names a VPS as the machine to start on, and a handful of people posting, following and replying is a light job. You can keep it to yourself as a personal microblog, make it invite-only for family and friends, or open sign-ups later; the software is the same either way.
What grows the load is not mainly how many of you there are but how much of the wider network you follow. Every post, boost and picture from accounts your people follow is delivered to your server, processed in the background and often copied to your disk. A family of five following a few hundred accounts is a very different job from a club of five hundred following the whole fediverse.
What your server will be running
- The web app, which serves the pages and the API your phone apps talk to.
- Sidekiq, the background worker that sends your posts to other servers, takes in theirs and sends your emails.
- The streaming server, which pushes new posts to open apps as they arrive.
- PostgreSQL, the database that holds every account, post and follow. Lose it and you lose the server.
- Redis, a fast store for home feeds and the background job queue.
- nginx in front, with a free Let's Encrypt certificate for HTTPS.
Mastodon's documentation does not publish a minimum amount of memory or number of processors, so nobody can honestly promise you one number. All six of those share one machine, and memory is what they compete for. On our Cloud VPS support can move you to a bigger size whenever you ask; it reboots a single time, and your files and IP addresses stay as they were. Sizes only ever grow, because a disk cannot be made smaller, so start where you are comfortable and ask support for a bigger size when the server starts to feel cramped.
Email: sort it out before you install
Mastodon emails confirmation links, password resets and notifications, and its guide is blunt that running your own mail server reliably is much harder than signing up with an email delivery provider. So pick a provider that offers SMTP, and have its server name, username and password ready when the setup wizard asks.
One detail matters on our Cloud VPS. Outgoing port 25 is closed on new machines, while ports 465 and 587 work from the first boot, which is all a mail provider needs. Mastodon assumes port 25 unless told otherwise, so put 587 in SMTP_PORT in .env.production (or answer 587 in the wizard), and mail goes out through your provider with no ticket to open.
Keeping the disk from filling up
Your own uploads are rarely the problem. The space goes on cached copies of pictures, videos, avatars and banners from other servers, saved so your timeline loads quickly. Left alone, that cache only grows. Three tools keep it in check:
- In Mastodon's admin area, open Administration > Content retention and set how long remote media is kept. The cleanup then runs on its own schedule.
- From the command line,
tootctl media usageshows how much space Mastodon is using, andtootctl media removeclears cached remote media older than a number of days you choose. - If you need far more room, Mastodon can store files in any S3-compatible object storage instead of on the server's own disk. It is optional, and the docs say the server's own disk is perfectly serviceable for a small server.
How the traffic adds up
Each Cloud VPS size comes with a monthly allowance for the traffic it sends, and everything it receives is free and never counted. For a Mastodon server that split works in your favour: the posts and pictures flowing in from accounts you follow cost nothing. What counts is what goes out, such as your pages, the media your followers' servers fetch from you and your posts delivered to them. If a month runs over, the server keeps running and keeps receiving at full speed; it sends at 10 Mbit/s until the next month, unless you add more traffic from the Virtual Machines tab.
Up and running in an evening
- Choose your domain. It becomes part of everyone's handle, and Mastodon cannot safely change it once the server has started. Using the word Mastodon in it needs written permission from Mastodon GmbH under their trademark policy.
- Order a Cloud VPS with Ubuntu 24.04, add your SSH key, and point the domain's DNS at its address.
- Lock it down as Mastodon's guide suggests: SSH with keys only, fail2ban, and a firewall that lets in only SSH, HTTP and HTTPS.
- Follow the official install guide: system packages, a
mastodonuser, the code, then the interactive setup wizard (themastodon:setuptask), which asks for the domain, database and email details. - Get the certificate with certbot, set up nginx from the file Mastodon ships, and start the three Mastodon services.
- Create your own owner account from the command line, because sign-ups in the browser start switched off.
RAILS_ENV=production bin/tootctl accounts create \
alice \
--email alice@example.com \
--confirmed \
--role Owner
RAILS_ENV=production bin/tootctl accounts modify alice --approve
Then fill in the server's contact and description under Administration > Site settings. It is not technically required, but people deciding whether to trust your server look for it.
Backups you will be glad of
Mastodon's backup guide puts the database first, then the .env.production file with its secrets, then uploaded files, then Redis. Dump the database with pg_dump on a schedule and copy it somewhere other than the server, along with .env.production. Lose that file and everyone is logged out and two-factor sign-in stops working; lose Redis and you lose little more than queued jobs.
When it is time for a whole server
A small server can stay small for years. These are the signs it has outgrown a shared virtual machine: the processor is busy all day because background jobs never catch up, the database needs more disk operations than the size allows, or the traffic it sends outgrows the allowance month after month. That is the point to move to a dedicated server, a whole physical machine with nobody else on it and an unmetered port nobody counts. Our Linux servers run the same Ubuntu and Debian releases, and the migration guide walks through moving a live server with only a short cutover.
Questions people ask
- How big a VPS do I need for a personal Mastodon server?
- Mastodon does not publish a minimum, so size by what you will do. A single user or a family following a modest number of accounts is a light job; a big follow list or many members means more background work and more cached media. Start on a size you are comfortable with: a Cloud VPS can be moved up later, with one restart and nothing lost.
- Can my Mastodon server send email from a Cloud VPS?
- Yes, through a mail provider on port 465 or 587, which are open from the first boot. Outgoing port 25 is closed on new machines. Mastodon tries port 25 unless you say otherwise, so enter your provider's port in SMTP_PORT.
- Will other Mastodon users be able to follow me?
- Yes. A self-hosted server federates like any other: you can follow anyone on any server, and they can follow you, reply and boost. Your handle simply carries your own domain.
- Why is my server's disk filling up so fast?
- Almost always it is the cache of media from other servers. Set a media cache retention period under Administration > Content retention, and use tootctl media remove to clear older cached files straight away.
- Do I need object storage?
- Not for a small server. Mastodon's docs call the server's own disk perfectly serviceable at that size. Object storage helps when media outgrows the disk, and it comes with its own monthly bill.