Where Does a Mastodon Server Store Data?
Mastodon keeps media in public/system under the install, secrets in .env.production, and posts in PostgreSQL plus Redis.
Last updated
A Mastodon server is four stores pretending to be one. Uploaded media lands in public/system inside the install (usually /home/mastodon/live). Secrets and endpoints live in .env.production. Posts live in PostgreSQL. Queues live in Redis under /var/lib/redis.
Migrations copy all four plus the nginx and systemd files. The systemd sandbox is the recurring trap: moved media paths need explicit ReadWritePaths entries, or uploads fail with read only errors while everything else looks healthy.
Where Mastodon stores this, by platform
/home/mastodon/live
Source install home. Media in public/system, secrets in .env.production, units copied from dist to /etc/systemd/system. Back up DB, env, system tree, and redis dump as a set.
Frequently asked questions
What must a Mastodon backup include?
Archive the Postgres dump, .env.production, the public/system tree, and the Redis dump together. Any one missing means broken images, lost logins, or dropped queues.
How do I move uploads to a bigger disk?
Set PAPERCLIP_ROOT_PATH in .env.production, serve it from nginx, and extend ReadWritePaths in the systemd units. The sandbox blocks unlisted paths silently.
Why is public/system using tens of gigabytes?
Run tootctl media remove to prune cached remote media first. The system folder balloons with remote copies, and pruning beats buying disk.
Notice an outdated path? Let us know.