When you self-host Coder on a managed VPS, you give your team development environments that are ready in seconds, on a machine of your own, which our teams keep up to date and monitor day and night. Coder is free software under the AGPL-3.0 license. This guide follows its official documentation: the stable release, resources, installing with Docker Compose and PostgreSQL, the access URL and wildcard domain, HTTPS, the Docker template, email, backups and updates.
By Simon Vasconcelos Lee
Published on 23 November 202616-minute read
compose.yaml: Coder and PostgreSQL 17, port 7080 published on 127.0.0.1 behind an HTTPS reverse proxy.CODER_ACCESS_URL, the public address, and CODER_WILDCARD_ACCESS_URL, the wildcard domain for workspace apps: it needs a wildcard DNS record and a wildcard certificate./home/coder volumes, and take a database copy before every update: Coder cannot roll back without one.Coder is a self-hosted platform for cloud development environments and AI coding agents. A developer picks a template, and Coder creates a workspace for them: a container or virtual machine with its tools, its editor and its code, which they open from their browser or their own computer.
The control plane, the coderd process, serves the dashboard and the API, and runs workspace builds through its provisioners. PostgreSQL stores users, templates and workspace state.
Coder is published under the GNU AGPL version 3 license. You can use it, at work too, for your own team as well as your clients’ teams, with no license to buy. The documentation’s glossary calls this edition Community: the free, open source tier of Coder.
Section 13 adds a condition specific to the AGPL: if you modify the program, your version must prominently offer everyone who uses it remotely, over a network, the chance to obtain its source code at no charge. If you distribute copies, the license’s source-sharing obligations apply as well. Running Coder unmodified does not trigger this section.
The Premium edition is the paid enterprise tier. It adds, among other things, multiple organizations, high availability, workspace proxies, audit logs, quotas, custom roles, SCIM, IdP sync with your identity provider and AI governance. Its code lives in the repository’s enterprise directory, under a separate license that reserves production use to those who have agreed to Coder’s terms of service.
These features are unlocked by a license key, added with an Owner account under “Admin settings”, “Deployment”, “Licenses”. The key is a signed JWT, validated on your server, with no connection to Coder’s servers. The documentation offers a trial, to request on coder.com.
Coder cuts a release on the first Tuesday of each month, across several channels. As of 22 November 2026:
| Channel | Version | What the documentation says |
|---|---|---|
| Stable | v2.38.10, stable since 16 November 2026 | The safest installation and upgrade path; all bug fixes and security patches |
| Mainline | v2.39.4 | New features first, for those with a staging environment |
| Security Support | The release before stable | Security fixes only |
A release spends one month as mainline before it is promoted to stable. The v2.39.4 release note itself advises teams without a staging environment to install the latest stable release: v2.38.10 is the one this guide follows. In Docker Compose, pin the image tag to that version rather than latest: the version change stays your decision, and Coder cannot go back to an earlier version without restoring its database.
The Docker installation page asks for a Linux host, Docker, and 2 CPU cores and 4 GB of free memory for Coder. For larger teams, its reference architectures give these figures:
| Component, up to 1,000 users | vCPU | Memory | Instances |
|---|---|---|---|
Control plane, coderd | 2 | 8 GB | 3 |
| Provisioner | 1 | 1 GB | 60 |
| PostgreSQL database | 8 | 30 GB | 1 |
coderd hosts three by default. For a small deployment, around 100 users and 10 concurrent builds, the documentation accepts keeping them on the control plane.On a VPS, workspaces weigh the most: count them in vCPU and memory, on top of Coder. On a managed VPS, tell us about your team, how many workspaces run at the same time and their tools, and we will recommend the right size.
Coder relies on two addresses, to decide before you install:
CODER_ACCESS_URL: the public address users and workspaces use to reach Coder, such as https://coder.example.com. It cannot be localhost: each workspace’s agent connects to it.CODER_WILDCARD_ACCESS_URL: a wildcard hostname that resolves to Coder, such as *.coder.example.com. Each workspace app then gets its own subdomain, for example 8080--main--myworkspace--john.coder.example.com.The wildcard domain is needed for port forwarding from the dashboard and for apps served at the root of a hostname. The documentation lists the Vite, React and Next.js development servers, JupyterLab and RStudio among the tools that need it. It also isolates each app in its own browser security context, away from the Coder API.
The value contains exactly one *, at the start of the hostname. Coder accepts two patterns, and both DNS and the certificate must cover the wildcard that follows from it:
| Pattern | Example generated hostname | Required DNS and TLS wildcard |
|---|---|---|
*.coder.example.com | 8080--main--myworkspace--john.coder.example.com | *.coder.example.com |
*-coder.example.com | 8080--main--myworkspace--john-coder.example.com | *.example.com |
The first pattern is the simplest. At your DNS provider, create two records pointing to the server’s address: one for Coder’s name, one for the wildcard, as an A record or a CNAME to the first.
coder.example.com A 203.0.113.10
*.coder.example.com CNAME coder.example.com
example.com: DNS providers and certificate authorities do not read *-coder.example.com as a wildcard. Make sure it does not conflict with your other services.*.workspaces, even on a private network: some browsers then refuse Coder’s cookies, which this feature depends on.*.coder.example.com, it must include coder.example.com and *.coder.example.com. A Let’s Encrypt wildcard certificate is obtained through a DNS challenge, which the HTTPS section covers.The repository publishes a compose.yaml that runs Coder and PostgreSQL 17, with a volume for the database. On a Linux server with Docker installed, create a coder folder and first put a .env file in it, which Docker Compose reads on its own:
CODER_VERSION=v2.38.10
CODER_ACCESS_URL=https://coder.example.com
CODER_WILDCARD_ACCESS_URL=*.coder.example.com
POSTGRES_USER=coder
POSTGRES_PASSWORD=
POSTGRES_DB=coder
DOCKER_GID=
Fill in the two empty values. The password goes into the database connection URL: a hexadecimal password avoids any character that would need encoding. The host’s docker group gives Coder access to the Docker socket, covered further down.
openssl rand -hex 24
getent group docker | cut -d: -f3
chmod 600 .env
Then place this compose.yaml next to it, the repository’s file at v2.38.10, with the changes listed below:
services:
coder:
image: ${CODER_REPO:-ghcr.io/coder/coder}:${CODER_VERSION:-latest}
restart: unless-stopped
ports:
- "127.0.0.1:7080:7080"
environment:
CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER:-username}:${POSTGRES_PASSWORD:-password}@database/${POSTGRES_DB:-coder}?sslmode=disable"
CODER_HTTP_ADDRESS: "0.0.0.0:7080"
CODER_ACCESS_URL: "${CODER_ACCESS_URL}"
CODER_WILDCARD_ACCESS_URL: "${CODER_WILDCARD_ACCESS_URL}"
group_add:
- "${DOCKER_GID}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- coder_home:/home/coder
depends_on:
database:
condition: service_healthy
database:
image: "postgres:17"
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-username}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_DB:-coder}
volumes:
- coder_data:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-username} -d ${POSTGRES_DB:-coder}",
]
interval: 5s
timeout: 5s
retries: 5
volumes:
coder_data:
coder_home:
docker compose up -d
docker compose logs -f coder
127.0.0.1: the repository’s file publishes it on all of the server’s addresses. Here, the interface is reached only through the reverse proxy, over HTTPS.CODER_WILDCARD_ACCESS_URL line comes from the Docker Compose example in the documentation’s Caddy tutorial.group_add block, commented out in the repository, adds the host’s docker group to the container’s coder user, which does not run as root. Without it, Coder cannot create Docker workspaces.restart: unless-stopped lines bring both services back after a server reboot.CODER_VERSION, and the database credentials, which replace the sample values username and password.coder_home volume is not required in production, according to the repository’s comment: Coder recreates the files it needs. The data lives in coder_data, the database.On first start, Coder shows a page to create the admin account: an email and a password. This first account gets the Owner role, with full rights over the deployment. Create it before you configure the reverse proxy, through an SSH tunnel: the server’s port 7080 shows up on your computer, at http://localhost:7080. Add -p and the SSH port shown in your customer area.
ssh -L 7080:127.0.0.1:7080 user@coder.example.com
coder users create. Password sign-in is enabled by default.CODER_OAUTH2_GITHUB_DEFAULT_PROVIDER_ENABLE=false turns Coder’s app off. Single sign-on through OpenID Connect is available too, with Okta or Keycloak for example.docker compose exec coder coder reset-password followed by the username. Once email is configured, each user can also reset it themselves from the sign-in screen.CODER_TELEMETRY_ENABLE=false turns it off.The first account created becomes the deployment’s owner: until it exists, the creation page is open to anyone who can reach Coder. Create it through the tunnel, then open the public address.
Coder can handle TLS itself, but the documentation readily places it behind a reverse proxy, which obtains the Let’s Encrypt certificates. The proxy listens on ports 80 and 443 and forwards to Coder on 127.0.0.1:7080.
coder.example.com and *.coder.example.com, with a certificate that covers both.X-Forwarded-For, set CODER_PROXY_TRUSTED_HEADERS and, in CODER_PROXY_TRUSTED_ORIGINS, the address your proxy connects from.For production, the documentation recommends a wildcard certificate, obtained through a DNS challenge. It needs a Caddy build that includes the caddy-dns module for your DNS provider: a custom Docker image, or a build downloaded from the Caddy website, which the Debian or Ubuntu package can use. With Cloudflare, the documentation’s example, and an API token passed to Caddy through an environment variable:
coder.example.com, *.coder.example.com {
reverse_proxy 127.0.0.1:7080
tls {
dns cloudflare {env.CF_API_TOKEN}
}
}
Without a DNS module, the documentation also describes Caddy’s on-demand TLS, which obtains one certificate per subdomain on first access: each new app then waits 5 to 30 seconds, and the on_demand_tls block must point, through ask, to an address of yours that validates each hostname before the certificate request.
With Nginx, Certbot obtains the wildcard certificate through your DNS provider’s DNS plugin. The documentation’s example uses Cloudflare and a token allowed to edit the DNS zone, written on the dns_cloudflare_api_token line of the ~/.secrets/certbot/cloudflare.ini file, readable by its owner only:
chmod 600 ~/.secrets/certbot/cloudflare.ini
sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials ~/.secrets/certbot/cloudflare.ini -d coder.example.com -d *.coder.example.com
This server block follows the documentation’s, which forwards WebSocket through the Upgrade and Connection headers. Only the port changes: 7080, the one in compose.yaml.
server {
server_name coder.example.com *.coder.example.com;
listen 80;
listen [::]:80;
if ($scheme != "https") {
return 301 https://$host$request_uri;
}
listen [::]:443 ssl ipv6only=on;
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/coder.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/coder.example.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:7080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
}
}
sudo ln -s /etc/nginx/sites-available/coder.example.com /etc/nginx/sites-enabled/coder.example.com
sudo nginx -t
sudo systemctl restart nginx
The documentation renews the certificate with a weekly job that runs certbot renew -q.
Once the wildcard domain is live, the documentation recommends disabling path-based apps, which share the origin of the Coder API: a malicious workspace could reuse its cookies. Add this line under environment in the coder service, then restart:
CODER_DISABLE_PATH_APPS: "true"
docker compose up -d
After the first account, Coder opens the template builder. It composes a valid Terraform configuration without you writing any:
/home/coder, named coder- followed by the workspace ID and -home. When the workspace restarts, only the home folder is kept: tools are preinstalled in the template’s image.The compose.yaml mounts /var/run/docker.sock into Coder’s container: that is how Coder creates workspaces. As the Docker documentation points out, the docker group grants root-level privileges on the host. Coder therefore has control over the server’s whole Docker engine.
The Coder documentation adds that templates can run arbitrary code on provisioners. A template admin therefore has control over the server: it is a trusted role, to grant with care, and the documentation recommends routing template changes through a Git repository and a review.
Coder sends notifications for workspace events: creation, deletion, dormancy, automatic update, out of memory or out of disk. The dashboard inbox is enabled by default; for email, Coder does not ship with an SMTP server and uses the one you configure. From a Simafri VPS, configure an authenticated SMTP server, with STARTTLS on port 587 or TLS on port 465. Add these lines under environment in the coder service, and their values in .env:
CODER_EMAIL_FROM: "${CODER_EMAIL_FROM}"
CODER_EMAIL_SMARTHOST: "${CODER_EMAIL_SMARTHOST}"
CODER_EMAIL_HELLO: "coder.example.com"
CODER_EMAIL_TLS_STARTTLS: "true"
CODER_EMAIL_AUTH_USERNAME: "${CODER_EMAIL_AUTH_USERNAME}"
CODER_EMAIL_AUTH_PASSWORD: "${CODER_EMAIL_AUTH_PASSWORD}"
CODER_EMAIL_SMARTHOST is written host:port, such as smtp.example.com:587.CODER_EMAIL_TLS_STARTTLS line.CODER_EMAIL_FROM takes an address on your domain, such as Coder <coder@example.com>, one your SMTP server allows you to send from.Notification delivery is then configured on your deployment’s /settings/notifications page.
The documentation asks you to prepare scripts that dump and restore the database, and to schedule them, especially before every update. Here is what a Docker deployment keeps:
| Item | What it keeps | To back up |
|---|---|---|
PostgreSQL database, coder_data volume | Users, templates, workspace state and metadata | Yes, with pg_dump |
coder-…-home volumes | Each workspace’s /home/coder folder: the developers’ code and files | Yes |
.env and compose.yaml | The version, the addresses and the secrets | Yes, kept safe |
coder_home volume | Files Coder recreates on start | No |
docker compose exec -T database pg_dump -U coder coder > coder-$(date +%F).sql
docker volume ls --filter name=-home
For each volume listed, Docker’s method uses a temporary container that archives it, preferably with the workspace stopped:
docker run --rm -v VOLUME:/data:ro -v "$PWD":/backup ubuntu tar -czf /backup/VOLUME.tar.gz -C /data .
Schedule these copies to match your team’s pace, and send them off the server. Stored on its disk, these archives are also included in its nightly backups.
Restore with the Coder version that produced the copy. With Coder stopped, recreate the empty database, load the copy, then restart:
docker compose stop coder
docker compose exec -T database dropdb -U coder coder
docker compose exec -T database createdb -U coder coder
docker compose exec -T database psql -U coder -d coder < coder-YYYY-MM-DD.sql
docker compose start coder
The documentation says it at the top of its page: take a database copy before upgrading, because Coder does not support rollbacks. With Docker Compose, change CODER_VERSION in .env, then:
docker compose exec -T database pg_dump -U coder coder > coder-before-upgrade.sql
docker compose pull coder
docker compose up -d coder
coder version.To follow the stable channel, wait for a release to be promoted there, one month after it ships as mainline, then run these three commands again.
Self-hosting means running the server on top of the application. On a managed VPS, our teams take charge of the server and proactively monitor your instance; Coder remains your software, with its templates, its accounts and its workspaces.
| Topic | Our teams | You |
|---|---|---|
| The server | System and security updates, server interventions included | The timing that suits your business |
| Monitoring | Server monitored 24/7, with intervention without waiting for your call | Reading your instance’s logs |
| Coder | Proactive monitoring: errors, slowdowns, memory and disk space spotted, fix recommended | Its installation, updates and settings, which you apply, yourself or through your AI assistant |
| Templates and accounts | The server that runs the workspaces, monitored and backed up | Templates, roles, authentication and your team’s access |
| Backups | Every night, encrypted and kept off the machine; restores included | Your database copy before each update, and the restore request, when you need one |
| Migration | Your current server migrated, free of charge | The timing of the switch |
If you would rather have our teams work inside the application itself, that service is billed by the hour or at a fixed rate, with an estimate shared before the work starts.
With a Simafri Managed VPS, our teams keep your Coder instance’s server up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is complimentary.
Yes. The Community edition is under the AGPL-3.0 license: you can use it at work with no license to buy. If you modify it, your remote users must be able to obtain the source code of your version. The paid Premium edition adds, through a license key, high availability, auditing, quotas and sync with your identity provider.
The stable release: v2.38.10 as of 22 November 2026. v2.39.4 is the mainline release, advised for teams with a staging environment. In Docker Compose, pin the image to ghcr.io/coder/coder:v2.38.10, because Coder cannot go back to an earlier version without restoring its database.
The documentation asks for 2 CPU cores and 4 GB of free memory for Coder installed with Docker. The Docker template’s workspaces run on the same server and add their own needs, depending on your team’s tools.
Take the repository’s compose.yaml, set the version, the access URL, the wildcard domain and the database password in a .env file, publish port 7080 on 127.0.0.1, add the host’s docker group, then run docker compose up -d. Then put an HTTPS reverse proxy in front of port 7080.
It is the wildcard domain, such as *.coder.example.com, that gives each workspace app its own subdomain. It is needed for port forwarding from the dashboard and for tools such as Vite, Next.js or JupyterLab, and it isolates each app from the Coder API.
Yes, for the wildcard domain: DNS and the certificate must cover *.coder.example.com, and the certificate coder.example.com as well. With Let’s Encrypt, a wildcard certificate is obtained through a DNS challenge, with Caddy and its caddy-dns module or with a Certbot DNS plugin.
Dump the PostgreSQL database with pg_dump, and copy the workspaces’ /home/coder volumes, which hold the developers’ code. Keep the .env file safe too. Take a database copy before every update: Coder cannot roll back without one.
A managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your instance and recommend useful fixes, which you apply. Work inside the application is billed by the hour or at a fixed rate.
Simafri
Let's talk about your website
Tell us about your project in a few words: we will get back to you quickly.
Thank you! Your request has been sent. We'll get back to you shortly.
Prefer email? Write to us at support@simafri.com.