LAN TEST INSTALLATION (NOT FOR PRODUCTION!)
- CPU: 2 vCores
- RAM: 4 GiB (+ 1 GiB Swap)
- HDD/SSD: minimum 40 GiB (recommended 80 GiB)
https://docs.joinmastodon.org/admin/install/ (Git Log & Wayback Machine)
See file Update.md for upgrade notes!
Caution
EOL warning: This version is end of life and not supported anymore. Scroll down for newer instructions.
TODO (extract from old commits!)
Caution
EOL warning: This version is end of life and not supported anymore. Scroll down for newer instructions.
TODO (extract from old commits!)
Caution
EOL warning: This version is end of life and not supported anymore. Scroll down for newer instructions.
- Re-tested at 2025-04-06
- Debian Bookworm (12.10.0; amd64)
- rbenv: Commit
cd29bcc6e0ef8b04ff0abbc8d27ccf48a720f4f2 - ruby-build: Commit
bc1a47dac2a611a276ec705923bd16e0385e8f28 - bundler: Version
2.5.23 - mastodon: Tag
v4.1.25
# ln -s /usr/bin/yarnpkg /usr/local/bin/yarn
# apt install imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev \
git g++ libprotobuf-dev protobuf-compiler pkg-config \
nodejs gcc autoconf bison build-essential libssl-dev \
libyaml-dev libreadline-dev zlib1g-dev libncurses5-dev \
libffi-dev libgdbm-dev nginx redis-server redis-tools \
postgresql postgresql-contrib libidn11-dev libicu-dev \
libjemalloc-dev yarnpkg curl gnupg postfix bsd-mailx
# su -c psql postgres
> CREATE USER mastodon CREATEDB;
> \q
# useradd -m -s /bin/bash -u 7007 -U mastodon
# su -l mastodon
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ exec bash
$ git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
$ RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.0.6
$ rbenv global 3.0.6
$ gem install bundler --no-document
$ git clone https://github.com/mastodon/mastodon.git ~/live && cd ~/live
$ git checkout "$(git tag -l | grep -v 'rc[0-9]*$' | grep '^v4\.1\.' | sort -V | tail -n 1)"
$ bundle config deployment 'true'
$ bundle config without 'development test'
$ bundle install -j"$(nproc)"
$ yarnpkg set version 1
$ yarnpkg install --pure-lockfile
$ RAILS_ENV=production bundle exec rake mastodon:setup
$ NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=production bundle exec rails assets:precompile
$ exit
# cp ~mastodon/live/dist/nginx.conf /etc/nginx/sites-available/mastodon
# ln -s ../sites-available/mastodon /etc/nginx/sites-enabled/mastodon
# editor /etc/nginx/sites-available/mastodon
> Replace example.com and disable HSTS header!
> ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
> ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
# service nginx reload
# cp ~mastodon/live/dist/mastodon-*.service /etc/systemd/system/
# systemctl daemon-reload
# systemctl enable --now mastodon-web mastodon-sidekiq mastodon-streaming
Tip
This is the recommended and tested version.
- Re-tested at 2025-04-06
- Debian Bookworm (12.10.0; amd64)
- rbenv: Commit
cd29bcc6e0ef8b04ff0abbc8d27ccf48a720f4f2 - ruby-build: Commit
bc1a47dac2a611a276ec705923bd16e0385e8f28 - bundler: Version
2.6.7 - mastodon: Tag
v4.3.7
# apt install imagemagick ffmpeg libvips-tools libpq-dev libxml2-dev libxslt1-dev git \
g++ libprotobuf-dev protobuf-compiler pkg-config gcc autoconf \
bison build-essential libssl-dev libyaml-dev libreadline-dev \
zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev \
nginx nodejs redis-server redis-tools postgresql postgresql-contrib \
libidn11-dev libicu-dev libjemalloc-dev \
npm curl gnupg postfix bsd-mailx
# su -c psql postgres
> CREATE USER mastodon CREATEDB;
> \q
# useradd -m -s /bin/bash -u 7007 -U mastodon
# su -l mastodon
$ npm install corepack
$ echo 'export PATH="$HOME/node_modules/.bin:$PATH"' >> ~/.bashrc
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ exec bash
$ git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
$ RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.3.5
$ rbenv global 3.3.5
$ gem install bundler --no-document
$ git clone https://github.com/mastodon/mastodon.git ~/live && cd ~/live
$ git checkout "$(git tag -l | grep -v 'rc[0-9]*$' | grep '^v4\.3\.' | sort -V | tail -n 1)"
$ corepack enable
$ corepack prepare
$ bundle config deployment 'true'
$ bundle config without 'development test'
$ bundle install -j"$(nproc)"
$ yarn config set --home enableTelemetry 0
$ yarn install --immutable
$ RAILS_ENV=production bundle exec rake mastodon:setup
$ echo -e '\nMASTODON_USE_LIBVIPS=true' >> .env.production
$ exit
# cp ~mastodon/live/dist/nginx.conf /etc/nginx/sites-available/mastodon
# ln -s ../sites-available/mastodon /etc/nginx/sites-enabled/mastodon
# editor /etc/nginx/sites-available/mastodon
> Replace example.com and disable HSTS header!
> ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
> ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
# service nginx reload
# cp ~mastodon/live/dist/mastodon-*.service /etc/systemd/system/
# systemctl daemon-reload
# systemctl enable --now mastodon-web mastodon-sidekiq mastodon-streamingWarning
Abandoned! Don't use this version.
- ✅ Redis (≥ v6.2)
- ✅ PostgreSQL (≥ v13)
- ❓ Node.js (≥ v20)
- ✅ Ruby (≥ v3.2)
Warning
Abandoned! Don't use this version.
- ✅ Redis (≥ v6.2)
- ✅ PostgreSQL (≥ v13)
- ✅ Node.js (≥ v20)
- ✅ Ruby (≥ v3.2)
Note
Work in progress! Don't use this version.
- ✅ Redis (≥ v7.0)
- ✅ PostgreSQL (≥ v14)
- ✅ Node.js (≥ v20.19)
- ✅ Ruby (≥ v3.2)
TODO