Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ services:
# Alternatively, you can enable CODER_TUNNEL for
# proof-of-concept deployments.
CODER_TUNNEL: "${CODER_TUNNEL:-false}"
# If the coder user does not have write permissions on
# the docker socket, you can uncomment the following
# lines and set the group ID to one that has write
# permissions on the docker socket.
#group_add:
# - "998" # docker group on host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
Expand Down
11 changes: 9 additions & 2 deletions docs/install/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@ the following command:

```sh
export CODER_DATA=$HOME/.config/coderv2-docker
export DOCKER_GROUP=$(getent group docker | cut -d: -f3)
mkdir -p $CODER_DATA
docker run --rm -it \
-e CODER_TUNNEL=true \
-v $CODER_DATA:/home/coder/.config \
-v /var/run/docker.sock:/var/run/docker.sock \
--group-add $DOCKER_GROUP \
ghcr.io/coder/coder:latest
```

**<sup>Note:</sup>** <sup>Coder runs as a non-root user, we use `--group-add` to
ensure Coder has permissions to manage Docker via `docker.sock`. If the host
systems `/var/run/docker.sock` is not group writeable or does not belong to the
`docker` group, the above may not work as-is.</sup>

Coder configuration is defined via environment variables.
Learn more about Coder's [configuration options](../admin/configure.md).

Expand Down Expand Up @@ -55,7 +62,7 @@ an PostgreSQL container and volume.
3. Start Coder with `docker-compose up`:

In order to use cloud-based templates (e.g. Kubernetes, AWS), you must have an external URL that users and workspaces will use to connect to Coder.

For proof-of-concept deployments, you can use [Coder's tunnel](../admin/configure.md#tunnel):

```sh
Expand All @@ -74,7 +81,7 @@ an PostgreSQL container and volume.

> Without `CODER_ACCESS_URL` or `CODER_TUNNEL` set, Coder will bind to `localhost:7080`. This will only work for Docker-based templates.

4. Visit the web ui via the configured url. You can add `/login` to the base url to create the first user via the ui.
4. Visit the web ui via the configured url. You can add `/login` to the base url to create the first user via the ui.

5. Follow the on-screen instructions log in and create your first template and workspace

Expand Down