glitch-soc is a feature-rich fork of Mastodon. Its installation process mirrors Mastodon's closely, with a few key differences when checking out the source code and deploying.
- A machine running Ubuntu 24.04 or Debian 13 with root access
- A domain name (or subdomain) for your server, e.g.
example.com - An email delivery service or other SMTP server
The examples below use example.com as the domain — replace it with your own before running any commands.
Run all commands as root. If you aren't already root, switch: sudo -i
Make sure curl, wget, gnupg, lsb-release, and ca-certificates are installed first:
apt install -y curl wget gnupg lsb-release ca-certificatescurl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.listwget -O /usr/share/keyrings/postgresql.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc
echo "deb [signed-by=/usr/share/keyrings/postgresql.asc] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/postgresql.listapt update
apt install -y \
imagemagick ffmpeg libvips-tools libpq-dev libxslt1-dev file git \
protobuf-compiler pkg-config autoconf bison build-essential \
libssl-dev libyaml-dev libreadline-dev zlib1g-dev libffi-dev \
libgdbm-dev nginx nodejs redis-server postgresql certbot \
python3-certbot-nginx libidn-dev libicu-dev libjemalloc-devEnable corepack so that the correct version of Yarn is installed automatically:
corepack enableadduser --disabled-password mastodonFor optimal performance, use pgTune to generate an appropriate configuration:
- Select the appropriate PG version and OS Type
- Select Web application for DB Type
- Fill in your server's specs for the remaining values
Apply the generated values to /etc/postgresql/18/main/postgresql.conf, then restart:
systemctl restart postgresqlsudo -u postgres psqlIn the prompt:
CREATE USER mastodon CREATEDB;
\qSwitch to the mastodon user:
su - mastodonUnlike mainline Mastodon, glitch-soc tracks the main branch of its own repository rather than tagged releases. Clone the glitch-soc repository:
git clone https://github.com/glitch-soc/mastodon.git live && cd live
git checkout mainUse rbenv to manage Ruby versions:
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-buildThen install the correct Ruby version:
RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv installbundle config deployment 'true'
bundle config without 'development test'
bundle install
yarn installNote: The two
bundle configcommands are only needed on first install. For future updates,bundle installalone is sufficient.
Note: Because glitch-soc ships with two front-end flavours, asset precompilation requires more time and resources than it does on mainline Mastodon. Plan accordingly.
Run the interactive setup wizard:
RAILS_ENV=production bin/rails mastodon:setupThis will:
- Create a configuration file (
.env.production) - Run asset precompilation
- Create the database schema
Review and edit .env.production as needed before proceeding.
Switch back to root when done:
exitcertbot certonly --nginx -d example.comThe certificate will be saved to /etc/letsencrypt/live/example.com/.
cp /home/mastodon/live/dist/nginx.conf /etc/nginx/sites-available/mastodon
ln -s /etc/nginx/sites-available/mastodon /etc/nginx/sites-enabled/mastodon
rm /etc/nginx/sites-enabled/defaultEdit /etc/nginx/sites-available/mastodon to:
- Replace
example.comwith your domain - Uncomment the SSL certificate lines:
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;- Make any other adjustments needed.
Allow nginx's www-data user to access asset files:
chmod o+x /home/mastodonRestart nginx:
systemctl restart nginxAt this point, visiting your domain should show the Mastodon error page — this is expected, as the Mastodon/glitch-soc processes haven't started yet.
cp /home/mastodon/live/dist/mastodon-*.service /etc/systemd/system/Verify the username and paths are correct:
$EDITOR /etc/systemd/system/mastodon-*.serviceStart and enable the services:
systemctl daemon-reload
systemctl enable --now mastodon-web mastodon-sidekiq mastodon-streamingThe services will now start automatically on boot. Visit your domain in the browser — your glitch-soc instance should be live.
Since glitch-soc tracks main rather than tagged releases, updates are pulled directly from the repository. Run the following steps as the mastodon user from the ~/live directory:
-
Pull the latest source:
git pull
-
Install dependencies:
bundle install && yarn install -
Run pre-deployment database migrations:
RAILS_ENV=production SKIP_POST_DEPLOYMENT_MIGRATIONS=true bundle exec rails db:migrate -
Pre-compile static assets:
RAILS_ENV=production bundle exec rails assets:precompile -
Restart services (run as root):
systemctl reload mastodon-web && systemctl restart mastodon-{sidekiq,streaming} -
Clear the Rails cache:
RAILS_ENV=production bin/tootctl cache clear
-
Run post-deployment database migrations:
RAILS_ENV=production bundle exec rails db:migrate
If you're switching an existing Mastodon instance to glitch-soc, add the glitch-soc remote and switch branches before following the update steps above:
git remote add glitch-soc https://github.com/glitch-soc/mastodon
git fetch glitch-soc
git checkout glitch-soc/mainThen proceed from step 2 of the update process.