You can run a Mastodon server on a rented VPS with Docker, PostgreSQL, Redis, and a domain you control. The practical path is: provision a suitably sized Ubuntu server, point your domain at it, install Docker Compose, deploy a pinned Mastodon release, create the database and secrets, put a TLS reverse proxy in front of the web container, and configure email and backups.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
This guide follows the commands and layout used by current community guides and the Mastodon container repository. Installation details have changed between releases, so check the instructions for the exact release you select at docs.joinmastodon.org before exposing the server to the public internet.
As an Amazon Associate I earn from qualifying purchases.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsWhat you are building
A Mastodon installation is a group of cooperating services rather than one process. The Docker Compose stack normally includes:
- Web: the Rails application that serves the website and API.
- Streaming: real-time timeline updates.
- Sidekiq: background jobs such as federation delivery, media processing, and email work.
- PostgreSQL: the permanent relational database.
- Redis: queues, cache data, and transient coordination.
- Ingress proxy: Nginx or another reverse proxy that terminates HTTPS and forwards requests to Mastodon.
The production Compose file binds the web service to 127.0.0.1:3000. That keeps the application off the public network, but it also means a reverse proxy and TLS certificate are required for a public server. Federation, browser access, and most integrations expect your domain to work over HTTPS.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Choose the VPS size before installing
There is no single authoritative hardware number in the available guidance. Treat capacity as a function of users, media, and federation activity rather than as a fixed Mastodon requirement.
| Use case | Guidance | What to expect |
|---|---|---|
| Small, single-user or private instance | At least 4 GB RAM and 2 CPU cores; third-party guides also recommend Ubuntu 22.04 LTS. | Suitable starting point for light local use, but background jobs and federation can consume the headroom quickly. |
| Federating instance | DanubeData (2026) describes 8 vCPU and 16 GB RAM as a minimum for federation. | More realistic for substantial remote traffic, media processing, and many peers. This is a third-party estimate, not an official Mastodon minimum. |
| 100 or more active federated peers | No verified universal minimum. | Monitor CPU, memory, database growth, Redis queues, and storage latency; scale before swap activity becomes normal. |
The 4 GB/2-core floor and the 8-vCPU/16-GB federation figure describe different operating goals and should not be treated as contradictory official specifications. Start with the smallest plan that matches your expected activity, but leave a straightforward upgrade path. Disk capacity matters as much as RAM because remote media can grow continuously.
Free tools Windows power users keep installed
One-click scans. No signup required.
Prerequisites and decisions
- Root or sudo access: you must be able to install packages, run Docker, configure the firewall, and manage services.
- A domain name: create an A (and, if applicable, AAAA) record pointing to the VPS address. Mastodon usernames include the server domain, so changing it later is disruptive; choose it before creating accounts.
- An operating system: Ubuntu 22.04 LTS is the version named by the third-party sizing guides. Keep the server patched.
- Docker Engine and the Compose plugin: the instructions below use the
docker composesubcommand. Older installations may expose the hyphenateddocker-composecommand instead. - DNS propagation: verify that your chosen hostname resolves to the VPS before requesting a certificate.
- Outbound email: arrange SMTP credentials if you want confirmations, password resets, and notifications to arrive reliably. SMTP is a separate configuration step.
- Backups: plan database and media backups before inviting users. A second disk or an off-server destination is safer than a backup stored beside the live database.
Install Docker and basic packages
Log in over SSH as a sudo-capable user. The package names below are used by one of the community VPS guides; Docker’s own installation method may differ by distribution image.
-
Refresh the package index and install the utilities needed to retrieve files and manage the repository:
sudo apt update sudo apt install -y curl git docker.io docker-compose-plugin -
Enable Docker and confirm that both Docker and Compose respond:
sudo systemctl enable --now docker docker --version docker compose version -
If your provider’s image uses Docker’s convenience installer instead of distribution packages, follow that installer’s current instructions, then verify the same two version commands. Do not install multiple competing Docker packages on top of one another.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Either add your login user to the
dockergroup or prefix Docker commands withsudo. Group membership normally takes effect after a new login session.
Obtain the production Compose files
Use the production docker-compose.yml and the matching .env.production.sample from the Mastodon repository. The repository’s main-branch Compose file is intended for production; do not substitute a development Compose file.
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
Some guides fetch only the raw Compose file, while others clone the repository. Either approach can work, but keep the Compose file, environment template, and image tag from the same release family. Mixing a newer template with an older image is a common source of missing variables and migration errors.
Pin a specific Mastodon release
Do not deploy an unqualified latest image. The guides consulted for this setup use different tags—v4.3.0 and v4.3.6—while the repository snapshot pins ghcr.io/mastodon/mastodon:v4.7.3. None of those values is established here as the current release.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →- Open the official Mastodon releases page and select the latest stable tag, not a development, nightly, or release-candidate build.
- Set that exact tag in every Mastodon image reference in
docker-compose.yml. - Record the tag in your change log. Pinning makes upgrades deliberate and lets you return to the previous image if a migration fails.
Before running the first migration, read the release notes for the selected tag. Required database migrations, environment variables, or asset steps can change between releases.
Create .env.production and generate secrets
-
From the directory containing the Compose file, copy the template:
cp .env.production.sample .env.production -
Edit
.env.productionand set the domain and database, Redis, storage, and SMTP values requested by the template. Keep this file private; it contains credentials and signing secrets. -
Generate a secret for each required secret value. Community instructions run the command three times and place the resulting values into the corresponding fields, including
SECRET_KEY_BASEandOTP_SECRET:The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.docker compose run --rm web rake secretRun it again for the next secret rather than reusing one value.
-
Generate Web Push VAPID keys with:
docker compose run --rm web rake mastodon:webpush:generate_vapid_keyCopy both generated VAPID values into the matching entries in
.env.production.Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
-
Check the file for accidental spaces, smart quotes, or shell comments appended to values. A malformed environment line can look like a database or Redis failure later.
Initialize PostgreSQL and assets
There are two setup patterns in community instructions. Older material presents an interactive setup wizard that creates the schema and precompiles assets; newer material commonly runs Rails setup directly. Follow the command required by the release you pinned rather than combining both workflows blindly.
The newer pattern is:
docker compose run --rm web rails db:setup
If the release’s setup process prints generated configuration, copy the requested values into .env.production before proceeding. A successful run creates the PostgreSQL schema and performs the initial asset preparation. If it fails, keep the complete error output; deleting containers and retrying without fixing the underlying variable or permission usually repeats the failure.
Start the containers
Once the environment file and database setup are complete, start the stack in the background:
docker compose up -d
On older systems the equivalent command is docker-compose up -d. Check the service state and recent logs immediately:
docker compose ps
docker compose logs --tail=100 web
docker compose logs --tail=100 sidekiq
Wait for migrations and asset compilation to finish before judging the service unhealthy. A container that repeatedly restarts needs its logs examined rather than an immediate reboot.
Create the first administrator account
Mastodon’s tootctl command creates and manages accounts from inside the web image. A community guide uses a command in this form:
docker compose run --rm web tootctl accounts create USERNAME --email EMAIL --confirmed
The exact flags can vary by release. Confirm the syntax with tootctl accounts create --help for your pinned image, set the account as an administrator using the command supported by that release, and then sign in through the browser to verify that the account can access administration settings. Use a strong, unique password and store recovery information securely.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Put Nginx and HTTPS in front of Mastodon
The Compose web service listens on localhost port 3000, so it is not directly reachable from the internet. Install and configure Nginx (or another reverse proxy) on the VPS to forward the public Mastodon hostname to 127.0.0.1:3000.
- Configure the proxy with your exact Mastodon domain as the server name.
- Allow the proxy to pass normal HTTP requests, WebSocket/streaming connections, large media uploads, and the forwarding headers Mastodon expects.
- Obtain a certificate from Let’s Encrypt after DNS resolves correctly, then redirect HTTP to HTTPS.
- Renew the certificate automatically and test renewal before the first expiry.
- Use the HTTPS hostname, not the localhost address, when testing federation and browser login.
The old production Docker guidance separates Nginx and Let’s Encrypt into their own sections because proxy and certificate configuration is outside the Mastodon containers. Do not expose port 3000 publicly as a substitute for TLS.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallFirewall and network exposure
A common VPS firewall arrangement allows SSH and web traffic while denying unsolicited access to other ports:
- 22/tcp: SSH, ideally restricted to your administration addresses where practical.
- 80/tcp: HTTP, needed for certificate issuance and redirecting to HTTPS.
- 443/tcp: HTTPS and Mastodon traffic.
Some community guides implement this with UFW. The exact rules depend on your provider’s console access and SSH port, so verify that an alternate recovery path works before enabling a deny policy. Keep PostgreSQL, Redis, and the internal Docker network off the public interface.
Make PostgreSQL and Redis data persistent
Container recreation must not erase your database or queues. An older official Docker guide warns that PostgreSQL and Redis are not persistent in the default example unless volumes are enabled. The current repository Compose snapshot mounts local directories named ./postgres14 and ./redis.
- Inspect your release’s Compose file and identify the PostgreSQL and Redis volume mappings.
- Ensure the host directories exist, have permissions that the containers can use, and are located on durable storage.
- Back up PostgreSQL with a consistent dump and include the Mastodon media directory and configuration secrets in your backup plan.
- Test restoring to a separate directory or temporary VPS. A backup that has never been restored is only an assumption.
Do not place only the database dump on the same disk as the live database; disk loss would remove both copies.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Configure SMTP and test account mail
Email is not automatically solved by starting the containers. Set the SMTP host, port, authentication, encryption mode, username, password, and sender values requested by the environment template. Then trigger a password-reset or confirmation message from a test account and inspect both the application logs and the recipient mailbox.
If mail is rejected, check the provider’s authentication requirements, outbound port restrictions, sender-domain policy, and DNS records. Keep SMTP credentials out of shell history and do not paste them into support requests.
Best Value
Verify the finished installation
- Visit the HTTPS domain in a private browser window and confirm that the certificate matches the hostname.
- Create a test post and verify that timelines load without 5xx errors.
- Open the streaming interface in browser developer tools and confirm that live updates connect.
- Send a test message or follow request to another Mastodon server to check federation.
- Upload a small image, then inspect storage growth and the media URL.
- Request a password reset to prove that SMTP works.
- Run
docker compose psafter a reboot and confirm that all required services return automatically.
Upgrade without losing the instance
Upgrades are image changes plus any release-specific database or asset work. Back up PostgreSQL and media before touching the tag.
Recommended Free Tools
- Read the release notes for the target version and note required commands or minimum supported versions.
- Update the Mastodon image tag in
docker-compose.yml. - Pull the new image:
docker compose pull
- Stop the current stack using the procedure documented for that release. Community instructions commonly use:
docker compose down
- Run any required migrations or asset commands from the release notes.
- Start the stack and watch web, Sidekiq, and database logs:
docker compose up -d
- Test login, posting, media upload, email, and federation before declaring the upgrade complete.
Keep the previous image tag and a verified backup until the new version has operated normally. Never assume that a successful container start means every migration succeeded.
Troubleshoot the failures people encounter most
Database setup fails
Check that PostgreSQL is healthy, the database hostname and credentials in .env.production match the service names in Compose, and the selected image and environment template belong to the same release family. Review the full output from rails db:setup; a generic “cannot connect” message often hides an incorrect password, an unavailable container, or a stale volume.
Public assets return permission denied
Permission errors under Mastodon’s public asset directories are a recurring community complaint. Inspect ownership and permissions on the host-mounted directories and apply the ownership correction recommended for your image and distribution. Do not solve the problem by making the entire application tree world-writable.
The site works on port 3000 but not through the domain
Confirm that the proxy targets 127.0.0.1:3000, the hostname in the proxy configuration matches the Mastodon domain, ports 80 and 443 are allowed, and the certificate covers the exact name. If the browser shows a certificate or redirect loop, fix proxy and DNS settings before changing Rails variables.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Federation or streaming does not work
Verify HTTPS, WebSocket forwarding, correct forwarding headers, and system time. Check Sidekiq and web logs for delivery failures. A locally functioning timeline does not prove that remote federation is reachable.
Containers disappear after a reboot
Check Docker’s service state, the Compose restart policies in your release file, and whether the data directories are mounted. If PostgreSQL or Redis starts empty, stop immediately and inspect the volume mapping before creating new data over the old directory.
Self-hosting versus managed hosting
| Factor | Your own VPS | Managed Mastodon service |
|---|---|---|
| Control | You choose the domain, release tag, storage, backups, and maintenance schedule. | The provider controls the platform and usually limits low-level changes. |
| Work required | You patch the OS, secure SSH, maintain Docker, renew certificates, monitor queues, and restore backups. | The provider handles much of the infrastructure maintenance, subject to its service terms. |
| Scaling | You resize the VPS and tune PostgreSQL, Redis, and workers as federation grows. | Scaling may be simpler, but depends on the provider’s plans and migration options. |
| Cost model | A recurring VPS bill plus your own time, storage, backups, and email service. | A recurring service fee that may bundle operations you would otherwise perform. |
Choose a VPS when domain control, configuration freedom, and hands-on administration matter more than convenience. Choose managed hosting when maintaining Linux, Docker, TLS, email, and backups is not a responsibility you want.
Operational checklist
- Domain DNS points to the VPS and will remain under your control.
- Ubuntu and Docker receive security updates.
- The Mastodon image is pinned to a documented stable release.
.env.productionand generated secrets are protected.- PostgreSQL, Redis, and media data use persistent storage.
- Backups run on a schedule and have been restored in a test.
- Nginx terminates HTTPS and forwards streaming traffic.
- Only required firewall ports are exposed.
- SMTP delivery, password reset, media upload, and federation have been tested.
- Upgrade notes and rollback information are recorded for the next administrator.
The Bottom Line
A reliable self-hosted Mastodon server is less about one installation command than about matching VPS capacity to federation load, pinning a known release, protecting persistent data, and operating the HTTPS, email, backup, and upgrade layers around the Docker stack.
Free tools Windows power users keep installed
One-click scans. No signup required.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




