Reading the repo
Reading the repo
How to install on macOS
Your self-hosted, globally interconnected microblogging community
Saved setup from 7 h ago
The maintainers included bin/setup. Open it to see how it's meant to be run: bin/setup on GitHub.
Will it work on my device?
docs/DEVELOPMENT.mdBefore starting local development, read the CONTRIBUTING guide to understand what changes are desirable and what general processes to use. You should also read the project's AI Contribution Policy to understand how we approach AI-assisted contributions.
The following instructions will guide you through the process of setting up a local development instance of Mastodon on your computer.
There are instructions for these environments:
Once completed, continue with the Next steps section below.
To set up macOS for native development, complete the following steps:
Install Homebrew and run:
brew install postgresql@14 redis libidn nvm vips
to install the required project dependencies
Use a Ruby version manager to activate the ruby in .ruby-version and run
nvm use to activate the node version from .nvmrc
Start the database services by running brew services start postgresql and
brew services start redis
Run RAILS_ENV=development bin/setup, which will install the required ruby gems and node
packages and prepare the database for local development
(Note: If you are on Apple Silicon and get an error related to libidn, you should be able to fix this by running gem install idn-ruby -- --with-idn-dir=$(brew --prefix libidn), then re-running the command above.)
Finally, run the bin/dev script which will launch services via overmind
(if installed) or foreman
The Mastodon documentation has a guide on installing Mastodon from source on Linux.
For production hosting and deployment with Docker, use the Dockerfile and
docker-compose.yml in the project root directory.
For local development, install and launch Docker, and run:
docker compose -f .devcontainer/compose.yaml up -d
docker compose -f .devcontainer/compose.yaml exec app bin/setup
docker compose -f .devcontainer/compose.yaml exec app bin/dev
Within IDEs that support the Development Containers specification, start the
"Mastodon on local machine" container from the editor. The necessary docker compose commands to build and setup the container should run automatically. For
Visual Studio Code this requires installing the Dev Container extension.
GitHub Codespaces provides a web-based version of VS Code and a cloud hosted development environment configured with the software needed for this project.
bin/dev in the terminaladmin@mastodon.local or admin@localhost (depending on your setup) and the password mastodonadmin.bin/rails dev:populate_sample_data. This will create a @showcase_account account with various types of contents.Then run bash setup.sh. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
Needs Git: xcode-select --install
git clone https://github.com/mastodon/mastodon.git cd mastodon
Node.js 26.13, Ruby 4.0.9
# needs nvm: brew install nvm (or https://github.com/nvm-sh/nvm) nvm install nvm use brew install rbenv ruby-build rbenv install --skip-existing
Fill in secrets: DB_PASS, SECRET_KEY_BASE, VAPID_PRIVATE_KEY, VAPID_PUBLIC_KEY, SMTP_PASSWORD
cp .env.production.sample .env
Needs: PostgreSQL, Redis
brew install --cask docker # Docker Desktop docker compose -f docker-compose.yml up -d
corepack enable yarn install bundle install
bin/rails db:prepare
bin/dev
yarn test bin/rails test
No reports for macOS yet.
Opens a chat with this manual already filled in, for macOS. It uses your own account; gitmanual sends nothing.