This is a BastilleBSD template to bootstrap Mastodon in a FreeBSD jail. Find out more about BastilleBSD by reading the documentation.
A tutorial how to install Mastodon on FreeBSD can be found in Stefano Marinelli's Website Installing Mastodon inside a FreeBSD jail.
The rc(8)
scripts needed to start the services at boottime are taken from Stefano Marinelli's fine tutorial. Kudos!
bastille bootstrap https://codeberg.org/ddowse/mastodon
bastille template TARGET ddowse/mastodon --arg DOMAIN=mastodon.example.org --arg [email protected]
You will need access to a PostgreSQL Server.
Login to the database server and create the user for your Mastodon instance as described in Mastodon's Documentation here.
Add a new entry to your pg_hba.conf
host mastodon mastodon 10.0.0.10/32 trust
In case you don't have a running PostgreSQL then just create a new Jail and bootstrap this yaazkal/bastille-postgres BastilleBSD template.
bastille create postges 13.1-RELEASE 10.0.0.10
bastille bootstrap https://github.com/yaazkal/bastille-postgres
bastille template yaazkal/bastille-postgres
bastille cmd postgres su - postgres -c "psql -c 'CREATE USER mastodon CREATEDB;'"
bastille cmd postgres sh -c 'echo "host mastodon mastodon 10.0.0.10/32 trust" >> /var/db/postgres/data14/pg_hba.conf'
Mastodon needs access to a Redis server. Redis Server is installed as a dependency anyway so to simplify things for beginners the redis daemon will run in unprotected mode. Please check the Bastillefile
for more details.
In the mastodon setup process enter the jails IP instead of localhost.
Make sure Port 80/443
are open. Port 80 is only needed to get a TLS certificate from Let's Encrypt.
bastille bootstrap https://codeberg.org/ddowse/mastodon
This nextstep will run the commands found in the Bastillefile It is wise to create a zfs snapshot of the jail before applying it. In case something goes wrong you can easily rollback. Read more about ZFS snapshots on the FreeBSD Documentation
bastille template TARGET ddowse/mastodon --arg DOMAIN=mastodon.example.org --arg [email protected]