How can we help?
< All Topics

Deploying Mastodon on ServerStadium


Mastodon offers a unique approach to social media, providing a decentralized, open-source platform that respects user privacy. By hosting Mastodon on ServerStadium’s infrastructure (VM Pricing, Dedicated Servers), you can create a social network that aligns with your community’s values and needs, free from the constraints of mainstream platforms.

Deploying Mastodon on ServerStadium


  • A ServerStadium VM or dedicated server (VM Pricing, Dedicated Servers), chosen based on your expected user base and traffic.
  • Basic knowledge of Linux server administration.

Step 1: Select and Prepare Your ServerStadium Server

  1. Choose a Server: Select a ServerStadium server that meets Mastodon’s requirements in terms of CPU, RAM, and storage.
  2. Server Setup: Update and upgrade your server:

    sudo apt update
    sudo apt upgrade

Step 2: Install Dependencies

Mastodon requires various dependencies, including Ruby, Node.js, PostgreSQL, and Redis:

  1. Install Ruby, Node.js, and Yarn:

    sudo apt install ruby-full nodejs yarn

  2. Install PostgreSQL and Redis:

    sudo apt install postgresql redis-server

Step 3: Install and Configure Mastodon

  1. Clone Mastodon’s Repository:

    git clone
    cd mastodon

  2. Install Ruby and JavaScript Dependencies:

    bundle install
    yarn install

  3. Setup Configuration Files:

    cp .env.production.sample .env.production
    nano .env.production

    Edit .env.production to match your environment.

  4. Setup the Database:

    RAILS_ENV=production bundle exec rails db:setup

Step 4: Precompile Assets

Compile all the assets for production:

RAILS_ENV=production bundle exec rails assets:precompile

Step 5: Set Up Web Server and Run Mastodon

  1. Configure Nginx or Apache to serve Mastodon:

    sudo nano /etc/nginx/sites-available/mastodon

    Add the Nginx configuration for Mastodon. Enable the site and restart Nginx.

  2. Run Mastodon:

    RAILS_ENV=production bundle exec rails s

Step 6: Accessing Mastodon

  1. Access Mastodon: Navigate to your Mastodon instance’s URL to access the platform.
  2. Initial Configuration: Complete the setup process, creating an admin account and configuring your instance.

Step 7: Finalizing and Testing

  1. Finalize Setup: Ensure all configurations are correct.
  2. Test Your Mastodon Instance: Verify that all functionalities are working as expected.


Your Mastodon instance is now operational on a ServerStadium server, offering a robust and privacy-focused social media platform. For additional assistance or resources, visit our knowledge base or contact our support team.

Table of Contents