@@ -9,7 +9,11 @@ Docker is required. See the
9
9
> Note that the below steps are only supported on a Linux distribution. If on
10
10
> macOS, please[ run Coder via the standalone binary] ( ./index.md#manual ) .
11
11
12
- ##Run Coder with the built-in database (quick)
12
+ <div class =" tabs " >
13
+
14
+ ##docker run
15
+
16
+ ** Built-in database (quick)**
13
17
14
18
For proof-of-concept deployments, you can run a complete Coder instance with the
15
19
following command.
@@ -25,78 +29,69 @@ docker run --rm -it \
25
29
ghcr.io/coder/coder:latest
26
30
```
27
31
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**
39
33
40
34
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.
43
37
44
38
``` shell
39
+ export DOCKER_GROUP=$( getent group docker| cut -d: -f3)
45
40
docker run --rm -it \
46
41
-e CODER_ACCESS_URL=" https://coder.example.com" \
47
42
-e CODER_PG_CONNECTION_URL=" postgresql://username:password@database/coder" \
48
43
-v /var/run/docker.sock:/var/run/docker.sock \
44
+ --group-add$DOCKER_GROUP \
49
45
ghcr.io/coder/coder:latest
50
46
```
51
47
52
- Coder configuration is defined via environment variables. Learn more about
53
- Coder's[ configuration options] ( ../admin/configure.md ) .
54
-
55
48
##docker compose
56
49
57
50
Coder's publishes a
58
51
[ docker-compose example] ( https://github.com/coder/coder/blob/main/docker-compose.yaml )
59
52
which includes an PostgreSQL container and volume.
60
53
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.
70
56
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.
73
60
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 :
76
63
77
64
``` shell
78
- cd coder
79
-
80
- docker compose up
65
+ getent group docker| cut -d: -f3
81
66
```
82
67
83
- For production deployments, we recommend setting an
84
- [ access URL] ( ../admin/configure.md#access-url ) :
68
+ 4 . Start Coder with` docker compose up `
85
69
86
- ``` shell
87
- cd coder
70
+ 5 . Visit the web ui via the configured url.
88
71
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
96
73
workspace
97
74
98
75
</div >
99
76
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
+
100
95
##Troubleshooting
101
96
102
97
###Docker-based workspace is stuck in "Connecting..."