Mastodon

Mastodon - Self-hosted social networking service

3000
Default Port
6
Services
50.0/20
Complexity
High
Memory Usage
Configuration

Installation Command

blastdock init mastodon

Template Overview

Everything you need to deploy Mastodon with BlastDock

Quick Deploy

One command deployment

Secure

Production-ready security

Configurable

Customizable settings

Scalable

Ready to scale up

What's Included

Mastodon-web
tootsuite/mastodon:latest
Mastodon-streaming
tootsuite/mastodon:latest
Mastodon-sidekiq
tootsuite/mastodon:latest
Postgres
postgres:14
Redis
redis:6
Elasticsearch
docker.elastic.co/elasticsearch/elasticsearch:7.10.1
Categories
Database
Security Features
Password Protection, Admin User
Resource Requirements
CPU: High, Memory: High , Storage Required

Quick Commands

blastdock init Initialize new project
blastdock deploy Deploy the application
blastdock status Check deployment status
blastdock logs View application logs

Quick Installation

Get Mastodon up and running in minutes with our one-click installation.

BlastDock Installation

First, install BlastDock using pip (recommended):

Terminal
pip install blastdock

Then deploy Mastodon with:

Terminal
blastdock init mastodon

Interactive mode:

Terminal
blastdock init mastodon -i

What's Included

Mastodon-web
Container service
Mastodon-streaming
Container service
Mastodon-sidekiq
Container service
Postgres
Container service
Redis
Container service
Elasticsearch
Container service

BlastDock Commands

blastdock templates List available templates
blastdock status project Check deployment status
blastdock logs project View application logs
blastdock stop project Stop deployment

Configuration Options

Customize your Mastodon installation with these configuration options.

7
Required Fields
0
Optional Fields
3
Auto-Generated Passwords

Web Port

Web interface port

port
Default: 3000
Required: Yes

Streaming Port

Streaming port

port
Default: 4000
Required: Yes

Db Password

Database password

password
Default: ••••••••••••
Required: Yes
Security: Auto-generated

Secret Key Base

Secret key base

password
Default: ••••••••••••
Required: Yes
Security: Auto-generated

Otp Secret

OTP secret

password
Default: ••••••••••••
Required: Yes
Security: Auto-generated

Domain

Domain name

domain
Default: localhost
Required: Yes

Admin Email

Admin email

string
Required: Yes

Docker Compose

Complete Docker Compose configuration for Mastodon deployment.

6
Services
3
Volumes
1
Networks
2
Exposed Ports
docker-compose.yml
version: '3.8'

services:
  postgres:
    image: postgres:14
    container_name: {{ project_name }}_postgres
    restart: unless-stopped
    environment:
      0: POSTGRES_PASSWORD={{ db_password }}
      1: POSTGRES_USER=mastodon
      2: POSTGRES_DB=mastodon
    volumes:
      - /var/lib/postgresql/data
    networks:
      - mastodon_network

  redis:
    image: redis:6
    container_name: {{ project_name }}_redis
    restart: unless-stopped
    networks:
      - mastodon_network

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1
    container_name: {{ project_name }}_elasticsearch
    restart: unless-stopped
    environment:
      0: discovery.type=single-node
      1: bootstrap.memory_lock=true
      2: ES_JAVA_OPTS=-Xms512m -Xmx512m
    volumes:
      - /usr/share/elasticsearch/data
    networks:
      - mastodon_network

  mastodon-web:
    image: tootsuite/mastodon:latest
    container_name: {{ project_name }}_mastodon_web
    restart: unless-stopped
    depends_on:
      - postgres
      - redis
      - elasticsearch
    ports:
      - "3000"
    environment:
      0: LOCAL_DOMAIN={{ domain }}
      1: RAILS_ENV=production
      2: DB_HOST=postgres
      3: DB_PORT=5432
      4: DB_NAME=mastodon
      5: DB_USER=mastodon
      6: DB_PASS={{ db_password }}
      7: REDIS_HOST=redis
      8: REDIS_PORT=6379
      9: ES_ENABLED=true
      10: ES_HOST=elasticsearch
      11: ES_PORT=9200
      12: SECRET_KEY_BASE={{ secret_key_base }}
      13: OTP_SECRET={{ otp_secret }}
      14: SMTP_SERVER=smtp.example.com
      15: SMTP_PORT=587
      16: SMTP_LOGIN=
      17: SMTP_PASSWORD=
      18: [email protected]
      19: WEB_DOMAIN={{ domain }}
      - STREAMING_API_BASE_URL=http: //localhost:{{ streaming_port }}
      20: SINGLE_USER_MODE=false
      21: ADMIN_EMAIL={{ admin_email }}
    volumes:
      - /mastodon/public/system
    networks:
      - mastodon_network

  mastodon-streaming:
    image: tootsuite/mastodon:latest
    container_name: {{ project_name }}_mastodon_streaming
    restart: unless-stopped
    depends_on:
      - postgres
      - redis
    ports:
      - "4000"
    environment:
      0: LOCAL_DOMAIN={{ domain }}
      1: RAILS_ENV=production
      2: DB_HOST=postgres
      3: DB_PORT=5432
      4: DB_NAME=mastodon
      5: DB_USER=mastodon
      6: DB_PASS={{ db_password }}
      7: REDIS_HOST=redis
      8: REDIS_PORT=6379
      9: SECRET_KEY_BASE={{ secret_key_base }}
      10: OTP_SECRET={{ otp_secret }}
    networks:
      - mastodon_network

  mastodon-sidekiq:
    image: tootsuite/mastodon:latest
    container_name: {{ project_name }}_mastodon_sidekiq
    restart: unless-stopped
    depends_on:
      - postgres
      - redis
    environment:
      0: LOCAL_DOMAIN={{ domain }}
      1: RAILS_ENV=production
      2: DB_HOST=postgres
      3: DB_PORT=5432
      4: DB_NAME=mastodon
      5: DB_USER=mastodon
      6: DB_PASS={{ db_password }}
      7: REDIS_HOST=redis
      8: REDIS_PORT=6379
      9: ES_ENABLED=true
      10: ES_HOST=elasticsearch
      11: ES_PORT=9200
      12: SECRET_KEY_BASE={{ secret_key_base }}
      13: OTP_SECRET={{ otp_secret }}
    volumes:
      - /mastodon/public/system
    networks:
      - mastodon_network

volumes:
  postgres_data:
    driver: local

  elasticsearch_data:
    driver: local

  mastodon_system:
    driver: local

networks:
  mastodon_network:
    driver: bridge