dendrite/docs/installation/docker/1_docker.md
Cat 61e5dc47d7
Added Docker commands for Windows (#3267)
### Pull Request Checklist

* [x] I have added Go unit tests or [Complement integration
tests](https://github.com/matrix-org/complement) for this PR _or_ I have
justified why this PR doesn't need tests
* [x] Pull request includes a [sign off below using a legally
identifiable
name](https://matrix-org.github.io/dendrite/development/contributing#sign-off)
_or_ I have already signed off privately

No tests were added due to it being a small documentation addition

Signed-off-by: `Cat Catry <denperidge@gmail.com>`
2023-11-25 20:24:13 +01:00

2.2 KiB

title parent grand_parent has_toc nav_order permalink
Installation Docker Installation true 1 /installation/docker/install

Installing Dendrite using Docker Compose

Dendrite provides an example Docker compose file, which needs some preparation to start successfully. Please note that this compose file only has Postgres as a dependency, and you need to configure a reverse proxy.

Preparations

Generate a private key

First we'll generate private key, which is used to sign events, the following will create one in ./config:

mkdir -p ./config
docker run --rm --entrypoint="/usr/bin/generate-keys" \
  -v $(pwd)/config:/mnt \
  matrixdotorg/dendrite-monolith:latest \
  -private-key /mnt/matrix_key.pem

# Windows equivalent: docker run --rm --entrypoint="/usr/bin/generate-keys" -v %cd%/config:/mnt matrixdotorg/dendrite-monolith:latest -private-key /mnt/matrix_key.pem

(NOTE: This only needs to be executed once, as you otherwise overwrite the key)

Generate a config

Similar to the command above, we can generate a config to be used, which will use the correct paths as specified in the example docker-compose file. Change server to your domain and db according to your changes to the docker-compose file (services.postgres.environment values):

mkdir -p ./config
docker run --rm --entrypoint="/bin/sh" \
  -v $(pwd)/config:/mnt \
  matrixdotorg/dendrite-monolith:latest \
  -c "/usr/bin/generate-config \
    -dir /var/dendrite/ \
    -db postgres://dendrite:itsasecret@postgres/dendrite?sslmode=disable \
    -server YourDomainHere > /mnt/dendrite.yaml"

# Windows equivalent: docker run --rm --entrypoint="/bin/sh" -v %cd%/config:/mnt matrixdotorg/dendrite-monolith:latest -c "/usr/bin/generate-config -dir /var/dendrite/ -db postgres://dendrite:itsasecret@postgres/dendrite?sslmode=disable -server YourDomainHere > /mnt/dendrite.yaml"

You can then change config/dendrite.yaml to your liking.

Starting Dendrite

Once you're done changing the config, you can now start up Dendrite with

docker-compose -f docker-compose.yml up