← Back

How To Reset Your Mastodon Database

Hey, up to something wild that makes you wanna erase your entire database?

Written on November 02, 2023 · 1 min read

How To Reset Your Mastodon Database

I'm not sure what's going on with your Mastodon instance, but if you're aiming to start fresh with an empty Mastodon database, I've got a way for you to do it!

Heads up: This move’s gonna wipe your entire Mastodon database clean. All users, toots, and pretty much everything will vanish. Do it at your own risk.

  1. Login to your Mastodon instance server using SSH.

  2. Change user to mastodon (if you're not logged in as mastodon user) by running:

su - mastodon
  1. Change the directory to your Mastodon directory:
cd ~/live
  1. Run this irreversible and destructive command:
DISABLE_DATABASE_ENVIRONMENT_CHECK=1 RAILS_ENV=production bundle exec rake mastodon:setup
  1. Answer all the questions

  2. Done! You can now login to your fresh Mastodon instance with the new credentials.


This note is written by Diky Hadna — Software Engineer & Digital Nomad Mentor. Read my story and get in touch with me!