Mastodon - Self-hosted social networking service
Everything you need to deploy Mastodon with BlastDock
One command deployment
Production-ready security
Customizable settings
Ready to scale up
blastdock init
Initialize new project
blastdock deploy
Deploy the application
blastdock status
Check deployment status
blastdock logs
View application logs
Get Mastodon up and running in minutes with our one-click installation.
First, install BlastDock using pip (recommended):
pip install blastdock
Then deploy Mastodon with:
blastdock init mastodon
Interactive mode:
blastdock init mastodon -i
blastdock templates
List available templates
blastdock status project
Check deployment status
blastdock logs project
View application logs
blastdock stop project
Stop deployment
Customize your Mastodon installation with these configuration options.
Web interface port
Streaming port
Database password
Secret key base
OTP secret
Domain name
Admin email
Complete Docker Compose configuration for Mastodon deployment.
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