Mastodon
  • What is Mastodon?
  • Using Mastodon
    • Signing up for an account
    • Setting up your profile
    • Posting toots
    • Using the network features
    • Dealing with unwanted content
    • Promoting yourself and others
    • Set your preferences
    • More settings
    • Using Mastodon externally
    • Moving or leaving accounts
    • Running your own server
  • Running Mastodon
    • Preparing your machine
    • Installing from source
    • Configuring your environment
    • Installing optional features
      • Full-text search
      • Hidden services
      • Single Sign On
    • Setting up your new instance
    • Using the admin CLI
    • Upgrading to a new release
    • Backing up your server
    • Migrating to a new machine
    • Scaling up your server
    • Moderation actions
    • Troubleshooting errors
      • Database index corruption
  • Developing Mastodon apps
    • Getting started with the API
    • Playing with public data
    • Obtaining client app access
    • Logging in with an account
    • Guidelines and best practices
    • Libraries and implementations
  • Contributing to Mastodon
    • Technical overview
    • Setting up a dev environment
    • Code structure
    • Routes
    • Bug bounties and responsible disclosure
  • Spec compliance
    • ActivityPub
    • WebFinger
    • Security
    • Microformats
    • OAuth
    • Bearcaps
  • REST API
    • OAuth Scopes
    • Rate limits
  • API Methods
    • apps
      • oauth
    • accounts
      • bookmarks
      • favourites
      • mutes
      • blocks
      • domain_blocks
      • filters
      • reports
      • follow_requests
      • endorsements
      • featured_tags
      • preferences
      • suggestions
    • statuses
      • media
      • polls
      • scheduled_statuses
    • timelines
      • conversations
      • lists
      • markers
      • streaming
    • notifications
      • push
    • search
    • instance
      • trends
      • directory
      • custom_emojis
    • admin
    • announcements
    • proofs
    • oembed
  • API Entities
    • Account
    • Activity
    • Admin::Account
    • Admin::Report
    • Announcement
    • AnnouncementReaction
    • Application
    • Attachment
    • Card
    • Context
    • Conversation
    • Emoji
    • Error
    • FeaturedTag
    • Field
    • Filter
    • History
    • IdentityProof
    • Instance
    • List
    • Marker
    • Mention
    • Notification
    • Poll
    • Preferences
    • PushSubscription
    • Relationship
    • Report
    • Results
    • ScheduledStatus
    • Source
    • Status
    • Tag
    • Token

Setting up your new instance

Things to do after installing Mastodon

    • Creating an admin account
    • Filling in server information
    • Running periodic cleanup tasks

Creating an admin account

In the browser

After signing up in the browser, you will need to use the command line to give your newly created account admin privileges. Assuming your username is alice:

RAILS_ENV=production bin/tootctl accounts modify alice --role admin

From the command line

You can create a new account using the command-line interface.

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

A randomly generated password will be shown in the terminal.

Filling in server information

After logging in, navigate to the Site settings page. While there are no technical requirements for filling in this information, it is considered crucial for operating a server for humans.

SettingMeaning
Contact usernameYour username so people know who owns the server
Business e-mailAn e-mail address so people locked out of their accounts, or people without accounts, can contact you
Instance descriptionWhy did you start this server? Who is it for? What makes it different?
Custom extended informationYou can put all sorts of information in here but a code of conduct is recommended

After you fill these in, simply hit “Save changes”.

Running periodic cleanup tasks

Mastodon generates some temporary files that are worth cleaning up after a certain amount of time (e.g. to save money on hosting). In general, you want to set up cron jobs (or another mechanism) to run these periodic cleanup tasks.

Typically you want to run tootctl media remove and tootctl preview_cards remove periodically. These will clean up remote media (e.g. images, videos, audio) and preview cards (e.g. preview images for links) after a certain number of days. (Check the docs for those commands if you want to tweak how old something has to be before it's cleaned up.)

First, run crontab -e to edit the cronfile for the mastodon user. (If you get a prompt asking which editor to use, choose your favorite editor.)

Next, add something like the following to the bottom of the file:

@weekly RAILS_ENV=production /home/mastodon/live/bin/tootctl media remove
@weekly RAILS_ENV=production /home/mastodon/live/bin/tootctl preview_cards remove

This will run these two commands on a weekly basis.

Finally, save the file. You can use crontab -l to verify the configuration.

Last updated September 27, 2020 · Improve this page
Also available in: 简体中文

Sponsored by

Dotcom-Monitor LoadView

Join Mastodon · Blog · ·

View source · CC BY-SA 4.0 · Imprint