Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion setup/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,45 @@ For example:
docker run --rm -it -p 7080:7080 -v /var/run/docker.sock:/var/run/docker.sock -v ~/.coder:/var/run/coder -e DEVURL_HOST="*.mycompany.com" codercom/coder:1.27.0
```

## Use an external PostgreSQL database

If you'd like to use an external database, you must:

1. Disable the embedded database by setting the `DB_EMBEDDED` environment
variable (see the next code snippet for an example)
1. Provide the connection information to the external PostgreSQL database:

```console
docker run --rm -it -p 7080:7080 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.coder:/var/run/coder \
# Disable using the embedded DB
-e DB_EMBEDDED="" \
# Change these values to match those for your database
-e DB_HOST=127.0.0.1 \
-e DB_PORT=5432 \
-e DB_USER=postgres \
-e DB_PASSWORD="" \
-e DB_NAME=postgres \
-e DB_SSL_MODE=disable \
codercom/coder:1.27.0
```

Coder supports client TLS certificates using `DB_SSL_MODE=verify-full`. Ensure
that you mount the certs into the container (and add the flag
`-v <local_certs>:/certs`). Then, specify the certificate path using environment
variables:

<!-- markdownlint-disable -->

| **Flag/environment variable** | **Description** |
| --------------------------------- | -------------------------------------------- |
| `-e DB_CERT=/certs/client.crt` | The path to the client cert signed by the CA |
| `-e DB_KEY=/certs/client.key` | The path to the client secret |
| `-e DB_ROOT_CERT=/certs/myCA.crt` | The path to the trusted CA cert |

<!-- markdownlint-enable -->

## Admin password

If you want to set (or reset) your admin password, use the
Expand All @@ -108,7 +147,6 @@ For organizations, we recommend one Docker host per team of 5-10 developers.

Currently, Coder for Docker does not support:

- External PostgreSQL databases
- The use of your own TLS certificates. If you'd like to use TLS with Coder for
Docker, you'll need to run Coder behind a reverse proxy (e.g., Caddy or NGINX)
and terminate TLS at that point. See
Expand Down