Skip to content

Commit 799d71f

Browse files
authored
docs: simplify docker installation docs (#12187)
1 parent be1edc3 commit 799d71f

File tree

1 file changed

+39
-44
lines changed

1 file changed

+39
-44
lines changed

docs/install/docker.md

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ Docker is required. See the
99
> Note that the below steps are only supported on a Linux distribution. If on
1010
> macOS, please [run Coder via the standalone binary](./index.md#manual).
1111
12-
## Run Coder with the built-in database (quick)
12+
<div class="tabs">
13+
14+
## docker run
15+
16+
**Built-in database (quick)**
1317

1418
For proof-of-concept deployments, you can run a complete Coder instance with the
1519
following command.
@@ -25,78 +29,69 @@ docker run --rm -it \
2529
ghcr.io/coder/coder:latest
2630
```
2731

28-
**<sup>Note:</sup>** <sup>Coder runs as a non-root user, we use `--group-add` to
29-
ensure Coder has permissions to manage Docker via `docker.sock`. If the host
30-
systems `/var/run/docker.sock` is not group writeable or does not belong to the
31-
`docker` group, the above may not work as-is.</sup>
32-
33-
Coder configuration is defined via environment variables. Learn more about
34-
Coder's [configuration options](../admin/configure.md).
35-
36-
<div class="tabs">
37-
38-
## docker run
32+
**External database**
3933

4034
For production deployments, we recommend using an external PostgreSQL database
41-
(version 13 or higher). Set `ACCESS_URL` to the external URL that users and
42-
workspaces will use to connect to Coder.
35+
(version 13 or higher). Set `CODER_ACCESS_URL` to the external URL that users
36+
and workspaces will use to connect to Coder.
4337

4438
```shell
39+
export DOCKER_GROUP=$(getent group docker | cut -d: -f3)
4540
docker run --rm -it \
4641
-e CODER_ACCESS_URL="https://coder.example.com" \
4742
-e CODER_PG_CONNECTION_URL="postgresql://username:password@database/coder" \
4843
-v /var/run/docker.sock:/var/run/docker.sock \
44+
--group-add $DOCKER_GROUP \
4945
ghcr.io/coder/coder:latest
5046
```
5147

52-
Coder configuration is defined via environment variables. Learn more about
53-
Coder's [configuration options](../admin/configure.md).
54-
5548
## docker compose
5649

5750
Coder's publishes a
5851
[docker-compose example](https://github.com/coder/coder/blob/main/docker-compose.yaml)
5952
which includes an PostgreSQL container and volume.
6053

61-
1. Install [Docker Compose](https://docs.docker.com/compose/install/)
62-
63-
2. Clone the `coder` repository:
64-
65-
```shell
66-
git clone https://github.com/coder/coder.git
67-
```
68-
69-
3. Start Coder with `docker compose up`:
54+
1. Make sure you have [Docker Compose](https://docs.docker.com/compose/install/)
55+
installed.
7056

71-
In order to use cloud-based templates (e.g. Kubernetes, AWS), you must have
72-
an external URL that users and workspaces will use to connect to Coder.
57+
2. Download the
58+
[`docker-compose.yaml`](https://github.com/coder/coder/blob/main/docker-compose.yaml)
59+
file.
7360

74-
For proof-of-concept deployments, you can use
75-
[Coder's tunnel](../admin/configure.md#tunnel):
61+
3. Update `group_add:` in `docker-compose.yaml` with the `gid` of `docker`
62+
group. You can get the `docker` group `gid` by running the below command:
7663

7764
```shell
78-
cd coder
79-
80-
docker compose up
65+
getent group docker | cut -d: -f3
8166
```
8267

83-
For production deployments, we recommend setting an
84-
[access URL](../admin/configure.md#access-url):
68+
4. Start Coder with `docker compose up`
8569

86-
```shell
87-
cd coder
70+
5. Visit the web ui via the configured url.
8871

89-
CODER_ACCESS_URL=https://coder.example.com docker compose up
90-
```
91-
92-
4. Visit the web ui via the configured url. You can add `/login` to the base url
93-
to create the first user via the ui.
94-
95-
5. Follow the on-screen instructions log in and create your first template and
72+
6. Follow the on-screen instructions log in and create your first template and
9673
workspace
9774

9875
</div>
9976

77+
Coder configuration is defined via environment variables. Learn more about
78+
Coder's [configuration options](../admin/configure.md).
79+
80+
> **Note:** In order to use cloud-based templates (e.g. Kubernetes, AWS), you
81+
> must have an external URL that users and workspaces will use to connect to
82+
> Coder.
83+
>
84+
> > For proof-of-concept deployments, you can use
85+
> > [Coder's tunnel](../admin/configure.md#tunnel).
86+
> >
87+
> > For production deployments, we recommend setting an
88+
> > [access URL](../admin/configure.md#access-url)
89+
90+
> **Note:** Coder runs as a non-root user, we use `--group-add` to ensure Coder
91+
> has permissions to manage Docker via `docker.sock`. If the host systems
92+
> `/var/run/docker.sock` is not group writeable or does not belong to the
93+
> `docker` group, the above may not work as-is.
94+
10095
## Troubleshooting
10196

10297
### Docker-based workspace is stuck in "Connecting..."

0 commit comments

Comments
 (0)