Mastodon: Installation

Created on 6 Oct 2016  路  5Comments  路  Source: tootsuite/mastodon

Are there somewhere instructions on how to get Mastodon running without Docker? Thanks!

Most helpful comment

I'd like to add something here to help anyone who may be having trouble setting up the SSL proxy. This had me racking my brains for 3 days.

If you are using Apache as the proxy to wrap the app in SSL and you have set LOCAL_HTTPS=true within your .env.production file, the application enters a redirect loop because Mastodon thinks a normal HTTP is being used and so returns a 301 redirect to the HTTPS url (which you just came from).

You need to tell Mastodon (in fact Rails) that you are in fact using HTTPS by setting the X-Forwarded-Proto header in your Apache configuration like so.

RequestHeader set X-Forwarded-Proto "https"

I finally have my instance running smoothly and federated with mastodon.social =)

All 5 comments

You need:

  • PostgreSQL (database)
  • Redis (timelines, background queue and ActionCable)
  • Ruby (preferably 2.2.4 as that's what I tested everything on, installation with rbenv or rvm is easiest)
  • Node.js/npm (for the front-end JS but it's only needed during assets:precompile)
  • ffmpeg (for WebM uploads)

Pretty standard Rails deployment... Clone the repository, then:

bundle install --deployment --without test development
npm install

Create an .env.production file with the configuration parameters from the .env.production.sample. To initialize the database:

RAILS_ENV=production bundle exec rails db:setup

To pre-compile the assets:

RAILS_ENV=production bundle exec rails assets:precompile

Then there's the web process you'd wanna run like:

RAILS_ENV=production bundle exec rails s -p 3000

And the background workers:

RAILS_ENV=production bundle exec sidekiq -q default -q mailers

And then there's the rake tasks you may want to run periodically from a cronjob described in the main README. You'll also want to run an nginx or haproxy server in front of that localhost:3000 of the app and handling the domain name and SSL in there.

I also recommend getting a SSL certificate for your domain via Let's Encrypt. Now this is sort of a rough sketch of a guide, if anyone does a full deployment it'd be great if they wrote down their exact steps somewhere, or I might do it myself later.

Another dependency is ImageMagick.

I'd like to add something here to help anyone who may be having trouble setting up the SSL proxy. This had me racking my brains for 3 days.

If you are using Apache as the proxy to wrap the app in SSL and you have set LOCAL_HTTPS=true within your .env.production file, the application enters a redirect loop because Mastodon thinks a normal HTTP is being used and so returns a 301 redirect to the HTTPS url (which you just came from).

You need to tell Mastodon (in fact Rails) that you are in fact using HTTPS by setting the X-Forwarded-Proto header in your Apache configuration like so.

RequestHeader set X-Forwarded-Proto "https"

I finally have my instance running smoothly and federated with mastodon.social =)

I have added a production guide to the wiki

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thomaskuntzz picture thomaskuntzz  路  3Comments

psychicteeth picture psychicteeth  路  3Comments

hugogameiro picture hugogameiro  路  3Comments

ccoenen picture ccoenen  路  3Comments

marrus-sh picture marrus-sh  路  3Comments