mastodon

v4.7.3-ls218

mastodon is a free, open-source social network server based on ActivityPub where users can follow friends and discover new ones..

docker pull lscr.io/linuxserver/mastodon:latest

Quick start

Generated from the image's own configuration. Replace the /path/to folders with real paths on your host.

---
services:
  mastodon:
    image: lscr.io/linuxserver/mastodon:latest
    container_name: mastodon
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - LOCAL_DOMAIN=example.com
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - DB_HOST=db
      - DB_USER=mastodon
      - DB_NAME=mastodon
      - DB_PASS=mastodon
      - DB_PORT=5432
      - ES_ENABLED=false
      - ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=
      - ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=
      - ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=
      - SECRET_KEY_BASE=
      - OTP_SECRET=
      - VAPID_PRIVATE_KEY=
      - VAPID_PUBLIC_KEY=
      - SMTP_SERVER=mail.example.com
      - SMTP_PORT=25
      - SMTP_LOGIN=
      - SMTP_PASSWORD=
      - SMTP_FROM_ADDRESS=notifications@example.com
      - S3_ENABLED=false
      - WEB_DOMAIN=mastodon.example.com # optional
      - ES_HOST=es # optional
      - ES_PORT=9200 # optional
      - ES_USER=elastic # optional
      - ES_PASS=elastic # optional
      - S3_BUCKET= # optional
      - AWS_ACCESS_KEY_ID= # optional
      - AWS_SECRET_ACCESS_KEY= # optional
      - S3_ALIAS_HOST= # optional
      - SIDEKIQ_ONLY=false # optional
      - SIDEKIQ_QUEUE= # optional
      - SIDEKIQ_DEFAULT=false # optional
      - SIDEKIQ_THREADS=5 # optional
      - DB_POOL=5 # optional
      - NO_CHOWN= # optional
      - MASTODON_PROMETHEUS_EXPORTER_ENABLED= # optional
    volumes:
      - /path/to/mastodon/config:/config
    ports:
      - 80:80
      - 443:443
      - 9394:9394 # optional
    restart: unless-stopped

Parameters

Ports
PortFunctionRequired
80:80Port for web frontendrequired
443:443Port for web frontendrequired
9394:9394Port for Prometheus metricsoptional
Environment variables
VariableFunctionRequired
PUID=1000User IDrequired
PGID=1000Group IDrequired
TZ=Etc/UTCTimezonerequired
LOCAL_DOMAIN=example.comThis is the unique identifier of your server in the network. It cannot be safely changed later.required
REDIS_HOST=redisRedis server hostnamerequired
REDIS_PORT=6379Redis portrequired
DB_HOST=dbPostgres database hostnamerequired
DB_USER=mastodonPostgres usernamerequired
DB_NAME=mastodonPostgres db namerequired
DB_PASS=mastodonPostgres passwordrequired
DB_PORT=5432Postgres portrequired
ES_ENABLED=falseEnable or disable Elasticsearch (requires a separate ES instance)required
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=Primary key for [Active Record Encryption](https://github.com/mastodon/mastodon/pull/29831/files).required
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=Deterministic key for [Active Record Encryption](https://github.com/mastodon/mastodon/pull/29831/files).required
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=Derivation salt for [Active Record Encryption](https://github.com/mastodon/mastodon/pull/29831/files).required
SECRET_KEY_BASE=Browser session secret. Changing it will break all active browser sessions.required
OTP_SECRET=MFA secret. Changing it after initial setup will break two-factor authentication.required
VAPID_PRIVATE_KEY=Push notification private key. Changing it after initial setup will break push notifications.required
VAPID_PUBLIC_KEY=Push notification public key. Changing it after initial setup will break push notifications.required
SMTP_SERVER=mail.example.comSMTP server for email notificationsrequired
SMTP_PORT=25SMTP server portrequired
SMTP_LOGIN=SMTP usernamerequired
SMTP_PASSWORD=SMTP passwordrequired
SMTP_FROM_ADDRESS=notifications@example.comFrom address for emails send from Mastodonrequired
S3_ENABLED=falseEnable or disable S3 storage of uploaded filesrequired
WEB_DOMAIN=mastodon.example.comThis can be set if you want your server identifier to be different to the subdomain hosting Mastodon. See [https://docs.joinmastodon.org/admin/config/#basic](https://docs.joinmastodon.org/admin/config/#basic)optional
ES_HOST=esElasticsearch server hostnameoptional
ES_PORT=9200Elasticsearch portoptional
ES_USER=elasticElasticsearch usernameoptional
ES_PASS=elasticElasticsearch passwordoptional
S3_BUCKET=S3 bucket hostnameoptional
AWS_ACCESS_KEY_ID=S3 bucket access key IDoptional
AWS_SECRET_ACCESS_KEY=S3 bucket secret access keyoptional
S3_ALIAS_HOST=Alternate hostname for object fetching if you are front the S3 connections.optional
SIDEKIQ_ONLY=falseOnly run the sidekiq service in this container instance. For large scale instances that need better queue handling.optional
SIDEKIQ_QUEUE=The name of the sidekiq queue to run in this container. See [notes](https://docs.joinmastodon.org/admin/scaling/#sidekiq-queues).optional
SIDEKIQ_DEFAULT=falseSet to `true` on the main container if you're running additional sidekiq instances. It will run the `default` queue.optional
SIDEKIQ_THREADS=5The number of threads for sidekiq to use. See [notes](https://docs.joinmastodon.org/admin/scaling/#sidekiq-threads).optional
DB_POOL=5The size of the DB connection pool, must be *at least* the same as `SIDEKIQ_THREADS`. See [notes](https://docs.joinmastodon.org/admin/scaling/#sidekiq-threads).optional
NO_CHOWN=Set to `true` to skip chown of /config on init. *READ THE APPLICATION NOTES BEFORE SETTING THIS*.optional
MASTODON_PROMETHEUS_EXPORTER_ENABLED=If set to `true`, Mastodon’s Ruby processes (web & Sidekiq) will enable the Prometheus instrumentation.optional
Volumes
PathFunctionRequired
/configContains all relevant configuration files.required

Architectures

Pulling :latest picks the right one for your host automatically.

  • x86_64amd64-latest
  • arm64arm64v8-latest

Tags

  • :latestStable releases.
  • :developPre-releases *only*.
  • :glitch[glitch-soc](https://github.com/glitch-soc/mastodon) fork releases.

Changelog

  1. Rebase to Alpine 3.24.

  2. Add prometheus exporter support.

  3. Add vips-heif.

Related

Browse all

ferdium

v7.2.3-ls164

Ferdium is a desktop app that helps you organize how you use your favourite apps by combining them into one application.

7.2K pulls per month13 GitHub starsarm64