Coder with Docker: Your Own Dev Environments in Containers, Opened from the Browser (Linux, Windows, Mac)
Before you start
- 24 min read
Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#
Coder is a free, open-source server (AGPL-3.0) that builds development workspaces from Terraform templates. Its Docker template runs each workspace in a container, opened through a browser, VS Code Desktop or JetBrains.
Logo: Coder project (offlinedocs/public/logo.svg in github.com/coder/coder, AGPL-3.0; shown only to identify the tool)
We keep code and tools on a home server and connect from a laptop. One strong machine can serve a small team, and we can rebuild broken environments.
| What | Value (official sources, read 5 December 2026) |
|---|---|
| Current version | Coder v2.39.5, published 24 November 2026, marked Stable since 1 December 2026. The newer v2.40.0 (1 December) is Mainline |
| Image to pin | ghcr.io/coder/coder:v2.39.5 (tag checked on ghcr.io; linux amd64, arm64, arm). Note the v |
| Database pin | postgres:17.12; both Stable v2.39.5 and Mainline v2.40.0 use PostgreSQL 17 in their official Compose files, checked 5 December 2026 |
| Time needed | About 45 minutes (our estimate) |
| Ports | 7080 (our Compose file), 3000 (standalone coder server) |
| Licence | AGPL-3.0 for the open-source code; the enterprise folder has its own licence; Premium is a paid plan |
| Official docs | coder.com/docs |

Image: the official Coder docs (Quickstart, file docs/images/screenshots/workspace-running-with-topbar.png at tag v2.39.5). Buttons depend on the template.
At a glance:
- Template: a Terraform recipe. Workspace: an environment built from it. Agent: the program inside it connecting to Coder.
- Access URL: the address your browser and your workspaces use to reach Coder. The number one source of trouble.
- Needs the Docker socket: root-level power on the host (see "Security and testing").
- Not code-server: code-server is only the editor. Coder manages the machines it runs in.
- Related: our Forgejo guide for your own Git server, and the Kubernetes introduction for pods.
How it fits together#
You reach Coder through an HTTPS address. The server keeps its data in PostgreSQL, runs Terraform, and asks Docker (through the socket) to start a workspace container, whose agent calls Coder back at the same address.
Diagram based on the official docs. The dashed arrow shows the workspace reaching the access URL.
Before you start#
Note: every domain, password and address on this page is a dummy example (
example.com,change-me,<server-ip>). Replace it with your own and keep real secrets out of Git.
The official Docker guide is for a Linux host only; its socket patterns "do not translate cleanly to macOS Docker runtimes". So the full setup runs on Linux. On Windows and Mac we show the official quickstart route (the coder program with a built-in database, for trying it out), and every system gets the client steps.
| System | What to have |
|---|---|
| Linux (server) | Docker Engine and the Compose plugin, 2 CPU cores and 4 GB RAM free (the official Docker guide's figures), your user in the docker group |
| Windows | A container runtime (the docs suggest Podman Desktop; Docker Desktop is also listed), PowerShell, and the Visual C++ runtime for the built-in database |
| Mac | Homebrew and Colima (the docs' free Docker runtime), Intel or Apple Silicon |
docker --version docker compose version
Checklist:
- [ ] Both commands print a version
- [ ] For HTTPS: a domain, DNS pointing at your server, ports 80 and 443 open
- [ ] A password manager
Tested by DIY Lab Hub: not yet. Commands come from the official docs and source at v2.39.5, read on 5 December 2026. We did not run them on a real machine.
Tip: Use a separate machine or VM for the server, not your main PC. The official quickstart advises it too.
LLM Guide: let your AI assistant set it up#
Prefer to let an AI do the typing? Copy the block below into ChatGPT, Claude, Gemini or a local model. It first asks about our setup, then follows only the path that fits.
You are my assistant for installing Coder v2.39.5 with PostgreSQL 17.12 on Linux, or trying the standalone program on Windows or Mac.
Follow https://diylabhub.com/coder/ (checked 5 December 2026).
Work one step at a time. Say what each command does. Wait for my OK before deleting data, stopping services, changing a router or opening ports.
STEP 0 - FIND OUT MY SETUP:
1. Linux (which distribution), Windows or Mac? The Compose server needs Linux. Windows/Mac use the standalone evaluation route; every system can be a client.
2. Are Docker and Compose installed? Run docker --version and docker compose version. Windows needs a running container runtime and the Visual C++ runtime for the built-in database. Mac needs Homebrew and Colima.
3. Is 7080 free for Linux, or 3000 for the standalone program? For public HTTPS, is DNS configured and are 80/443 available?
4. Is Traefik already running, or should we use Caddy? Do I want public HTTPS, home-only HTTPS or the guide's LAN HTTP route?
5. Can both the server and workspace containers resolve and reach the access URL? Ask for the address, never assume localhost works.
6. Is this a fresh installation? Where are existing database backups and workspace files? Does the Linux server have 2 CPU cores and 4 GB RAM free?
THEN FOLLOW THE MATCHING PATH:
- Linux server: follow Step 1 for Docker and the docker group. Create ~/docker_volumes/coder/{data/postgres,config,logs,backups}; use getent group docker | cut -d: -f3 to find DOCKER_GID.
- Windows evaluation: install a container runtime first, then winget install Coder.Coder --version 2.39.5 and coder version. Run coder server and open http://localhost:3000. It uses a built-in database and, without an access URL, opens a public try.coder.app tunnel. Take any setup token from the terminal, never this chat.
- Mac evaluation: brew install colima docker; colima start; export DOCKER_HOST="unix://${HOME}/.colima/default/docker.sock"; curl -fsSL https://coder.com/install.sh | sh -s -- --version 2.39.5; coder version; coder server. Keep DOCKER_HOST set in that terminal. Setup matches Windows.
- Linux LAN HTTP: use http://<server-ip>:7080 for CODER_ACCESS_URL; it must work inside workspace containers too.
- Existing Traefik: set CODER_ACCESS_URL=https://coder.example.com, remove Coder's ports block, join default and external proxy networks. Use docker network create proxy only if missing. Add the guide's labels:
traefik.enable=true
traefik.docker.network=proxy
traefik.http.routers.coder.rule=Host(`coder.example.com`)
traefik.http.routers.coder.entrypoints=https
traefik.http.routers.coder.tls=true
traefik.http.routers.coder.tls.certresolver=le
traefik.http.services.coder.loadbalancer.server.port=7080
- Caddy: use the guide's separate caddy:2.11.9 Compose file in ~/docker_volumes/caddy with conf, data and config folders. Join Coder to default and external proxy networks, remove its published port, and set its access URL to the chosen HTTPS name. Use this Caddyfile, then start both Compose projects:
coder.example.com {
reverse_proxy coder:7080
}
- Home-only Caddy: use coder.home.arpa with tls internal and reverse_proxy coder:7080. Follow the guide's root-certificate trust instructions for Linux/Windows/Mac. Coder and workspace images must trust it too; the guide has no tested recipe for that. Do not bypass certificate checks.
LINUX FILES (in ~/docker_volumes/coder):
Create .env with POSTGRES_USER=coder, POSTGRES_DB=coder, POSTGRES_PASSWORD=change-me-use-letters-and-digits-only, CODER_ACCESS_URL=http://<server-ip>:7080 and DOCKER_GID=<number-from-step-1>, each on its own line. Replace the dummy password locally with openssl rand -hex 24 and run chmod 600 .env. Never paste secrets here.
Save compose.yaml:
services:
coder:
image: ghcr.io/coder/coder:v2.39.5
container_name: coder
restart: unless-stopped
ports:
- "7080:7080"
environment:
CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database/${POSTGRES_DB}?sslmode=disable"
CODER_HTTP_ADDRESS: "0.0.0.0:7080"
CODER_ACCESS_URL: "${CODER_ACCESS_URL}"
group_add:
- "${DOCKER_GID}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
database:
condition: service_healthy
database:
image: postgres:17.12
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- ./data/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
Run docker compose config -q, then docker compose up -d. Do not share expanded Compose configuration: it reveals passwords.
FIRST USE: open the chosen URL and create the owner account. Create a Docker template from Templates > New Template, optionally add code-server, then create a workspace. Only trusted administrators may edit templates: the Docker socket gives root-level power.
CHECK IT WORKED:
docker compose ps should show coder running and database healthy.
docker compose logs --tail=100 coder should show no errors.
curl -fsS https://coder.example.com/healthz should print OK after HTTPS setup.
curl -fsS https://coder.example.com/api/v2/buildinfo should show v2.39.5.
The workspace should show Running and its Terminal should open. With the matching CLI installed and logged in, coder ssh my-docker-workspace -- echo ready should print ready.
RULES FOR YOU:
- Keep these pinned versions; never switch to latest or invent settings. Keep PostgreSQL 17.12: Coder's official Compose still uses major 17. A future major upgrade needs dump/restore, never a tag swap over existing data.
- On error, show it and read https://coder.com/docs and the guide's tagged Docker docs before guessing.
- Never publish the database or Docker socket. After HTTPS setup remove the direct Coder port. Never chmod 666 the socket.
- Domains, names, passwords and <placeholders> are dummy values to replace. Never ask me to paste passwords, keys or tokens into chat.
Step 1: Get Docker and the Coder program ready#
Linux#
If Docker is missing, the Coder quickstart uses Docker's own script. Then add your user to the docker group:
curl -sSL https://get.docker.com | sh sudo usermod -aG docker $USER newgrp docker
Create the folders and note the group number of your Docker socket:
mkdir -p ~/docker_volumes/coder/{data/postgres,config,logs,backups}
cd ~/docker_volumes/coder
getent group docker | cut -d: -f3
Keep the printed group number for Step 2.
Windows (PowerShell)#
The Compose route is Linux only, so on Windows we follow the official quickstart. Install and start a container runtime first (the docs name Podman Desktop; with WSL 2 they ask for WSL 2.5.1 or newer, see their Quickstart). Then install the pinned program:
winget install Coder.Coder --version 2.39.5 coder version
Open a new PowerShell window if coder is not found. The 2.39.5 manifest exists in the winget package list; we did not run the install.
Mac (Terminal)#
brew install colima docker
colima start
export DOCKER_HOST="unix://${HOME}/.colima/default/docker.sock"
curl -fsSL https://coder.com/install.sh | sh -s -- --version 2.39.5
coder version
Colima keeps its socket in ~/.colima/default/docker.sock, so Coder needs DOCKER_HOST (official Quickstart). Set it in the terminal where you run coder server. For a pinned version the install script downloads a standalone binary, because the Homebrew tap follows Mainline (install.sh source).
Check it worked. Linux: a version and a group number. Windows and Mac: coder version shows v2.39.5.
Step 2: Write the settings and the Compose file#
Linux#
Secrets go into a .env file. Use only letters and digits in the database password: it sits inside a connection URL, and symbols would need URL escaping.
cd ~/docker_volumes/coder cat > .env << 'EOF' POSTGRES_USER=coder POSTGRES_PASSWORD=change-me-use-letters-and-digits-only POSTGRES_DB=coder CODER_ACCESS_URL=http://<server-ip>:7080 DOCKER_GID=<number-from-step-1> EOF chmod 600 .env
This is a dummy password. Replace it (openssl rand -hex 24 makes a good one), put your server's LAN address into CODER_ACCESS_URL and the number from Step 1 into DOCKER_GID. The plain http:// address is the official LAN example; HTTPS comes later.
cat > compose.yaml << 'EOF'
services:
coder:
image: ghcr.io/coder/coder:v2.39.5
container_name: coder
restart: unless-stopped
ports:
- "7080:7080"
environment:
CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database/${POSTGRES_DB}?sslmode=disable"
CODER_HTTP_ADDRESS: "0.0.0.0:7080"
CODER_ACCESS_URL: "${CODER_ACCESS_URL}"
group_add:
- "${DOCKER_GID}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
database:
condition: service_healthy
database:
image: postgres:17.12
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- ./data/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
EOF
We adapt the official compose.yaml with pinned images, restart: unless-stopped, data under ~/docker_volumes and no optional coder_home volume.
| Line | Why |
|---|---|
CODER_ACCESS_URL | The address people and workspaces use. The official file says it cannot be localhost or 127.0.0.1 for non-Docker templates |
group_add | Lets the container's coder user write to the Docker socket (may not work if the socket is not group-writable, per the official guide) |
postgres:17.12 | Coder needs PostgreSQL 13 or newer; the official file uses postgres:17. The port is not published |
We keep 17.12 because Coder Mainline's Compose still uses 17. PostgreSQL images 18+ change the data mount to /var/lib/postgresql. A future move to 19 needs dump/restore into a fresh database (migration notes), never a tag swap over this folder.
Check it worked. docker compose config -q prints nothing when the file is fine. Do not share docker compose config output: it shows the password.
Tip:
CODER_ACCESS_URLmust work from inside a container, not only from your browser. A name that exists only in your laptop's hosts file leaves every workspace at "Connecting...".
Windows (PowerShell)#
Nothing to write: coder server uses its built-in database and listens on 127.0.0.1:3000 (the default). With no access URL it also opens a public try.coder.app tunnel, so treat it as public.
Mac (Terminal)#
Same as Windows: no files. Make sure DOCKER_HOST from Step 1 is still set in this terminal.
Step 3: Start Coder and read the log#
Linux#
cd ~/docker_volumes/coder docker compose up -d docker compose ps docker compose logs --tail=50 coder
Windows (PowerShell)#
coder server
Leave the window open; Ctrl+C stops it. The setup page is at http://localhost:3000.
Mac (Terminal)#
coder server
Same as Windows. Leave the terminal open.
We did not run this, so we show no real output. The docs say the web address (and on a tunnel a Setup token: line) appears near the top of the coder server output.
Check it worked. Linux: docker compose ps shows coder and database running, the database healthy. The log has no ERR line. On Linux you can also ask for the version:
curl -fsS http://<server-ip>:7080/api/v2/buildinfo
The JSON should contain a version starting with v2.39.5 (the field is in the API docs; we saw no real answer).
Step 4: Create the first admin user#
Linux#
Open http://<server-ip>:7080 and fill in the setup page: an email, a username and a strong password (dummy examples: [email protected], admin). The first user becomes the owner. With an access URL set, the source asks for no setup token (cli/setuptoken.go at v2.39.5 requires it only on a try.coder.app tunnel). If your page asks anyway, take it from docker compose logs coder.
Windows (PowerShell)#
Open http://localhost:3000. The page asks for the setup token: copy it from the line starting Setup token: in the coder server window, then create the admin account.
Mac (Terminal)#
Same as Windows.
Check it worked. You see the dashboard (Workspaces, Templates). Save the password in a password manager.
Tip: Locked out?
coder reset-passwordtalks to the database, not the web API. Run it whereCODER_PG_CONNECTION_URLis set:docker compose exec coder /opt/coder reset-password <username>(not run by us). The docs also namecoder server create-admin-userfor recovery.
Step 5: Create a Docker template and your first workspace#
The template builder writes the Terraform for you. These clicks come from the official Quickstart at v2.39.5:
- Templates > New Template, pick the Docker base template.
- Skip the parameters. Add the code-server module if you want VS Code in the browser.
- Name it
my-docker-templateand select Create Template. - Select + Create Workspace, give it a name, and select Create workspace.
The Quickstart says a workspace starts in 10 to 15 seconds (the first may take longer while Docker pulls images). You then see buttons for the template's apps, such as code-server, Terminal and VS Code Desktop.
Linux#
If template creation fails with a permission error, re-check DOCKER_GID against getent group docker | cut -d: -f3. Do not chmod 666 the socket.
Windows (PowerShell)#
Docker or Podman must be running before you create the template.
Mac (Terminal)#
Colima must be running and DOCKER_HOST set in the terminal where coder server runs, or you get "Cannot connect to the Docker daemon".
Check it worked. The workspace shows Running, and Terminal opens a shell inside the container. If it stays at "Connecting...", the container cannot reach the access URL: see Common mistakes.
Tip: Persistence is the template author's decision. The official tutorial keeps the home folder in a Docker volume, but we did not check the builder's Docker base template. Keep your code in Git (Forgejo works well).
Step 6: Connect from your laptop with the coder CLI and VS Code#
The browser is enough, but the command line and VS Code Desktop are handy. Install the CLI at the same version as the server.
Linux#
curl -fsSL https://coder.com/install.sh | sh -s -- --version 2.39.5 coder login https://coder.example.com coder list coder ssh my-docker-workspace
Use your own address and workspace name. coder login prints a link to /cli-auth on your server. Open it, sign in, copy the session token and paste it into the terminal. On Linux the token is kept in a plain text file (login docs).
Windows (PowerShell)#
winget install Coder.Coder --version 2.39.5 coder login https://coder.example.com coder list coder ssh my-docker-workspace
The session token goes into the system keyring on Windows and macOS (login docs).
Mac (Terminal)#
Same commands as Linux. For a pinned version the script installs a standalone binary, as explained in Step 1.
For SSH-based tools run coder config-ssh (preview with --dry-run). If a tool such as JetBrains Gateway does not list your workspaces, run coder config-ssh --no-wildcard. The dashboard button VS Code Desktop installs the Coder Remote extension (by hand: ext install coder.coder-remote).
To clone from your own Git server, print your Coder public key and add it in your Forgejo account's SSH keys:
coder publickey
Check it worked. coder ssh my-docker-workspace -- echo ready prints ready.
Put it behind HTTPS (with or without Traefik)#
This is for a server with a domain; local-only users can stay on the http:// address from Step 2. The address matters more than usual here, because the Coder container and every workspace use it too (Coder calls ${CODER_ACCESS_URL}/healthz itself and expects 200 OK, per the health docs).
Both routes need an A record for coder.example.com (a dummy name), CODER_ACCESS_URL=https://coder.example.com in .env, and no published port 7080.
With Traefik#
On a server that already runs Traefik v3 with the Docker provider, add labels and join the proxy network. Our Traefik guide sets up the https entrypoint, the le resolver and the proxy network. If you have no network yet, run docker network create proxy. In compose.yaml replace the ports: block of the coder service with this (the database stays on the default network):
networks:
- default
- proxy
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.coder.rule=Host(`coder.example.com`)"
- "traefik.http.routers.coder.entrypoints=https"
- "traefik.http.routers.coder.tls=true"
- "traefik.http.routers.coder.tls.certresolver=le"
- "traefik.http.services.coder.loadbalancer.server.port=7080"
Add this at the end of the file, then run docker compose up -d:
networks:
proxy:
external: true
Check it worked. curl -I https://coder.example.com/ returns an HTTP status line over HTTPS, and curl -fsS https://coder.example.com/healthz prints OK (the expected body per the health docs). On Windows use curl.exe.
Optional: wildcard apps. CODER_WILDCARD_ACCESS_URL is for dashboard port forwarding and apps that need their own subdomain (Vite, JupyterLab). A path-based code-server app works without it (the template tutorial uses subdomain = false). The value is a host pattern, not a URL:
CODER_WILDCARD_ACCESS_URL=*.apps.example.com
You need a wildcard DNS record and a wildcard certificate, which needs the DNS challenge. The le resolver in our Traefik guide uses the HTTP challenge and cannot issue one, so add a second resolver (the name le-dns is ours) with --certificatesresolvers.le-dns.acme.dnschallenge=true and ...dnschallenge.provider=<your-dns-provider> plus the provider's token. Then change the labels (from Traefik's v3.8 docs; not run by us):
- "traefik.http.routers.coder.rule=Host(`coder.example.com`) || Host(`*.apps.example.com`)"
- "traefik.http.routers.coder.tls.certresolver=le-dns"
- "traefik.http.routers.coder.tls.domains[0].main=coder.example.com"
- "traefik.http.routers.coder.tls.domains[0].sans=*.apps.example.com"
Without Traefik: Caddy#
Choose this if you have no Traefik. Caddy gets and renews its own certificates and reverse_proxy passes WebSockets. Coder has its own Caddy tutorial; our Caddy guide has the details.
docker network create proxy
mkdir -p ~/docker_volumes/caddy/{conf,data,config}
Save as ~/docker_volumes/caddy/docker-compose.yml (caddy:2.11.9 is the latest Caddy release we checked 5 December 2026):
services:
caddy:
image: caddy:2.11.9
container_name: caddy
restart: unless-stopped
ports:
- "80:80/tcp"
- "443:443/tcp"
- "443:443/udp"
volumes:
- ./conf:/etc/caddy:ro
- ./data:/data
- ./config:/config
networks:
- proxy
networks:
proxy:
external: true
Save as ~/docker_volumes/caddy/conf/Caddyfile for a public domain (Let's Encrypt, ports 80 and 443 open):
coder.example.com {
reverse_proxy coder:7080
}
For a home-only name use Caddy's own certificate:
coder.home.arpa {
tls internal
reverse_proxy coder:7080
}
In Coder's compose.yaml remove ports:, add networks: [default, proxy] to the coder service and the proxy network block shown above, then run docker compose up -d there and in the Caddy folder.
For tls internal, trust Caddy's root on each device you browse from (commands adapted from Caddy's docs). Copy it with docker cp caddy:/data/caddy/pki/authorities/local/root.crt ./caddy-root.crt, then: Linux (Debian style) copy to /usr/local/share/ca-certificates/caddy-local-root.crt and run sudo update-ca-certificates; Windows (administrator PowerShell) certutil -addstore -f "ROOT" caddy-root.crt; Mac sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain caddy-root.crt.
The catch with a private root. The browser is not the only client: the Coder container checks its own access URL and every workspace downloads its agent from it, so both fail until they trust the same root (see Common mistakes). We did not test a fix; a maintainer wrote that curl and the agent use the system trust store on Linux, so the root belongs in your workspace image and the Coder container. A public domain with Let's Encrypt avoids all this.
Check it worked. curl -I https://coder.example.com/ answers over HTTPS. For a home-only name the padlock appears once the root is trusted.
Security and testing#
| Control | How |
|---|---|
| Docker socket | The Coder container can start any container on the host. The socket is root-level power: a container that mounts the host's / can read everything. Our reading: whoever can push or edit a template runs Terraform with that power, so give the template admin and owner roles only to people you trust like root. A socket proxy can narrow the socket; we did not try one with Coder |
| Ports | After HTTPS remove 7080:7080. Only the proxy (80, 443) should be reachable. The database port is never published |
| Secrets | .env with chmod 600, never in Git. docker inspect coder shows the connection URL |
| Sign-in | The official security guide recommends OIDC single sign-on and two-factor authentication (see our authentik guide) |
| Path apps | Once the wildcard works, set CODER_DISABLE_PATH_APPS=true: path-based apps share the origin of the Coder API (docs) |
Quick tests on the server:
cd ~/docker_volumes/coder docker compose ps docker compose logs --tail=100 coder curl -fsS https://coder.example.com/healthz curl -fsS https://coder.example.com/api/v2/buildinfo
Common mistakes#
| Mistake | Why it happens | Do this instead |
|---|---|---|
permission denied while trying to connect to the Docker daemon socket when adding a template (issue 20088, closed as stale on 16 November 2026 without a fix) | The coder user in the container is not in the socket's group | Put the host's docker group number in group_add (getent group docker | cut -d: -f3), as the official guide says. Never chmod 666 the socket |
Cannot connect to the Docker daemon at unix:///var/run/docker.sock (issue 15035, official docs) | Docker is stopped, or uses another socket (rootless, Colima, Podman) | Start Docker, or set DOCKER_HOST and restart Coder |
Workspace never connects: curl: (6) Could not resolve host (issue 20759) | The workspace container could not resolve the access URL name behind Traefik | The name must resolve inside containers. The reporter attached the workspace to the Traefik network and the default bridge in the template (networks_advanced) |
EACS03: get healthz endpoint: ... x509: certificate signed by unknown authority (issue 17979) | A private CA (such as Caddy's tls internal) is trusted by your browser, not by Coder | Install the root in the Coder container, or use a public certificate |
curl: (60) SSL certificate problem: self-signed certificate while the agent downloads (issue 9863) | The workspace image does not trust the certificate; some base images lack the default CAs | Install ca-certificates and your private root in the image |
ping postgres: dial tcp 127.0.0.1:5432: connect: connection refused from coder reset-password (issue 6399) | The command connects straight to PostgreSQL, never to the API | Run it where CODER_PG_CONNECTION_URL is set, or pass --postgres-url |
A redirect middleware on Coder's router gave URLs like https://wss:// (issue 9035, a Kubernetes report) | The middleware broke WebSocket addresses | Keep the router on the https entrypoint; let the http entrypoint redirect, as in our Traefik guide |
CODER_WILDCARD_ACCESS_URL=https://*.example.com | It is a host pattern with one * at the start, not a URL | Write *.apps.example.com on a real domain (not a bare *.workspaces: the docs say browsers may refuse its cookies) |
AI assistants: ghcr.io/coder/coder:2.39.5, or "run the codercom/code-server image to get Coder" | The tag needs the v (the registry answered 404 for 2.39.5 on 5 December 2026), and code-server is only the editor | Use ghcr.io/coder/coder:v2.39.5 and the Compose file above |
| AI assistants: "copy the Setup token from the log" for every install | The Quickstart says every URL asks for it, but the v2.39.5 source requires it only on a try.coder.app tunnel | With an access URL set, just create the admin. If asked, the token is in docker compose logs coder |
AI assistants: CODER_ACCESS_URL=http://localhost:7080 | The docs say the access URL "should not be localhost". The Docker template tutorial rewrites it to host.docker.internal, but a remote browser, a laptop CLI or another template cannot use it | Use the server's real address or domain |
Tip: Run
docker compose logs coderright after a template fails. Terraform's real error (a socket, a DNS name, a certificate) is in there.
Tip: Stay on Stable (2.39.x) and read the release notes before you jump. The plain
install.shand the officialcompose.yamldefault to Mainline orlatest; v2.40.0 redacts agent environment values and no longer passes the session token to workspace apps.
Troubleshooting#
| Problem | Solution |
|---|---|
coder container restarts | docker compose logs --tail=100 coder. Check the database is healthy and the password has only letters and digits |
| Workspace stuck at "Connecting..." | The agent cannot reach the access URL. In the workspace container read /tmp/coder-agent.log and run curl -v <access-url>/healthz |
| Apps or port forwarding fail | Needs CODER_WILDCARD_ACCESS_URL, wildcard DNS and a wildcard certificate. Behind a proxy, check that WebSockets pass, and open /health |
| Template import fails | Check DOCKER_GID or DOCKER_HOST and read the Terraform error in the log. After changing .env, run docker compose up -d |
Exact error texts#
Error: Error pinging Docker server: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?(official docs): Docker is stopped or its socket is elsewhere.A setup token is required to create the first user. Find it in the output of coder server.(source,coderd/setuptoken.go): you are on a tunnel; take the token from the log.
Known bugs (December 2026)#
Issue 20338 is open: a VS Code Desktop connection dropped every few minutes and the workspace showed as unhealthy; we did not reproduce it. Issue 20088 was closed as stale without a fix. We found nothing that stops a normal Docker install.
Updates and backups#
Update. Read the release notes and Coder's upgrade docs, back up (below), change the tag, then:
cd ~/docker_volumes/coder docker compose pull docker compose up -d docker compose exec coder /opt/coder version
Update your laptop's coder CLI to the same version. Our Diun guide tells you when a new image appears.
What to back up. The PostgreSQL database, .env and compose.yaml. Workspace files live in Docker volumes made by the template; see our docker-volume-backup guide.
Linux and Mac#
Save as ~/docker_volumes/coder/backup.sh (on a Mac the server is usually a Linux box, so run it there):
#!/usr/bin/env bash set -euo pipefail base="$HOME/docker_volumes/coder" cd "$base" day="$(date +%F)" docker compose exec -T database sh -c 'pg_dump -U "$POSTGRES_USER" "$POSTGRES_DB"' | gzip > "backups/coder-db-$day.sql.gz" tar -czf "backups/coder-config-$day.tar.gz" .env compose.yaml chmod 600 backups/coder-*
Run chmod 700 on it and add this with crontab -e:
0 3 * * * /home/<your-user>/docker_volumes/coder/backup.sh
Windows (PowerShell)#
The Compose server runs on Linux, so the script runs there. The evaluation server on Windows is for trying Coder out; move to the Compose route to keep your work.
Restore test#
Restore into a scratch database, never over the live one:
cd ~/docker_volumes/coder docker compose exec -T database sh -c 'createdb -U "$POSTGRES_USER" restore_test' gunzip -c backups/coder-db-<date>.sql.gz | docker compose exec -T database sh -c 'psql -U "$POSTGRES_USER" -d restore_test' docker compose exec -T database sh -c 'psql -U "$POSTGRES_USER" -d restore_test -c "\dt"' docker compose exec -T database sh -c 'dropdb -U "$POSTGRES_USER" restore_test'
The table list should show Coder's tables. We did not run these plain PostgreSQL commands.
Performance and resources#
The official Docker guide asks for 2 CPU cores and 4 GB of memory free on the host. That covers the server, not your workspaces: a workspace is a container and uses what you run in it (builds, language servers, databases). We measured nothing; run docker stats. Coder's large sizing examples are for big teams.
FAQ#
Is Coder really free? The open-source code is AGPL-3.0 and this guide uses only that. The enterprise folder has its own licence and Premium is a paid plan. We needed nothing from it here.
Is this the same as code-server? No. code-server is an editor in a browser. Coder creates and manages the workspaces and can show code-server as one app in them.
Do I need the wildcard address? Not for SSH, the terminal or a path-based code-server app; yes for port forwarding and subdomain apps.
Stable or Mainline? Stable is one release behind Mainline. v2.40.0 (Mainline, 1 December 2026) has breaking changes, so we pin Stable v2.39.5.
Sources#
- Coder repository github.com/coder/coder, release v2.39.5 (24 November 2026, Stable), release v2.40.0 (1 December 2026), LICENSE (AGPL-3.0) and LICENSE.enterprise
- Release channels (table dated 4 December 2026) and install.sh
- Docs at tag v2.39.5 (all under github.com/coder/coder/blob/v2.39.5/docs):
install/server/docker.md,get-started/index.md,install/cli.md,admin/setup/index.md,admin/networking/wildcard-access-url.md,tutorials/reverse-proxy-caddy.md,tutorials/template-from-scratch.md,user-guides/workspace-access/,admin/monitoring/health-check.md,admin/templates/troubleshooting.md,tutorials/best-practices/security-best-practices.md,reference/cli/loginandserver; plus compose.yaml and the source files cli/setuptoken.go and coderd/setuptoken.go - Image tags: ghcr.io/coder/coder (tag
v2.39.5checked through the registry API), postgres 17.12, caddy 2.11.9; winget manifest 2.39.5 - PostgreSQL review, read 5 December 2026: release archive, 18 migration notes, 19 migration notes; Coder Mainline v2.40.0 Compose still pins major 17.
- Traefik v3.8 docs: rules, ACME; Caddy docs
- Issues read: 6399, 9035, 9863, 15035, 17979, 20088, 20338, 20759
Checked against the official docs on 2026-12-05. Nothing was run on a real machine by DIY Lab Hub; the commands come from the docs, the source and the issues above.