Updating Mastodon Instance (Docker Version)
This approach makes updating to the latest version a real breeze.
TLDR version
git fetch
git stash
git checkout TAG_NAME
git stash pop
docker-compose build
docker-compose run --rm web rake db:migrate
docker-compose run --rm web rake assets:precompile
docker-compose up -d
Full version
git fetch
to download updates from the repository.- Now you need to tell git to use those updates. You have probably changed your
docker-compose.yml
file. Check with git status. - If the
docker-compose.yml
file is modified, rungit stash
to stash your changes. git checkout TAG_NAME
to use the tag code. (If you have committed changes, usegit merge TAG_NAME
instead, though this isn't likely.)- Only if you ran
git stash
, now rungit stash pop
to redo your changes toocker-compose.yml
. Double check the contents of this file. - Build the updated Mastodon image.
- If you are using a prebuilt image: First, edit the image:
tootsuite/mastodon
lines indocker-compose.yml
to include the tag for the new version. E.g. image:tootsuite/mastodon:v2.3.0
- To pull the prebuilt image, or build your own from the updated code:
docker-compose build
- If you are using a prebuilt image: First, edit the image:
- (optional)
docker-compose run --rm web rake db:migrate
to perform database migrations. Does nothing if your database is up to date. - (optional)
docker-compose run --rm web rake assets:precompile
to compile new JS and CSS assets. - Follow any other special instructions in the release notes.
docker-compose up -d
to re-create (restart) containers and pick up the changes.
Source: https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Docker-Guide.md#updating