Update: On 2017-09-15 the FreeBSD Mastodon port, net-im/mastodon, was overhauled with version 1.6.0 to handle installation of Mastodon's node modules and assets. This installation guide has been updated to reflect those changes.

Update: On 2017-09-15 the FreeBSD Mastodon port, net-im/mastodon, was overhauled with version 1.6.0 to handle installation of Mastodon's node modules and assets. This installation guide has been updated to reflect those changes.

Enable and start required services

The Mastodon port ships with two sample nginx configuration files, a complete nginx.conf and nginx-include.conf, which mostly just includes the server block. If the web server is going to be dedicated to Mastodon, you can create a new nginx profile.

If you prefer to continue using your current nginx.conf, you can add the line below to it. Make sure you put it inside the http block.

include /usr/local/www/mastodon/nginx-include.conf;

In either case, you need to customize nginx-include.conf. At minimum, you will have to change all instances of example.com. Once you are satisfied with its configuration, start nginx.

# sysrc nginx_enable="YES"
# service nginx start

Create mastodon database user

# psql -d template1 -U pgsql -c "CREATE USER mastodon CREATEDB;"

Switch to the mastodon user

# su - mastodon

Customize .env.production

Customize .env.production to suit your needs, but you must at least set values for LOCAL_DOMAIN and SMTP_FROM_ADDRESS. You also have to generate secrets for PAPERCLIP_SECRET, SECRET_KEY_BASE, and OTP_SECRET. Generate a different secret for each of these fields by running the command below three time. Save .env.production before moving on to the next step.

% RAILS_ENV=production rake secret

If you are installing version 1.5.0 or later, to enable Web Push notifications, you need to generate a few extra secrets and put them in .env.production.