Self-host Coder on a managed VPS: your own remote development environments

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.

Simon Vasconcelos Lee By Published on 23 November 202616 minute read

All guides

In short

  1. The Community edition, under the AGPL-3.0 license, can be used freely at work; the Premium edition adds, through a license key, high availability, auditing, quotas or sync with your identity provider.
  2. Install the stable release, v2.38.10 as of 22 November 2026, with the repository’s compose.yaml: Coder and PostgreSQL 17, port 7080 published on 127.0.0.1 behind an HTTPS reverse proxy.
  3. Set 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.
  4. The first account created becomes the deployment’s owner: create it through an SSH tunnel before you open the public address.
  5. Back up the PostgreSQL database and the workspaces’ /home/coder volumes, and take a database copy before every update: Coder cannot roll back without one.

What Coder does

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.

The AGPL-3.0 license and the Community and Premium editions

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.

Which Coder version should you install?

Coder cuts a release on the first Tuesday of each month, across several channels. As of 22 November 2026:

ChannelVersionWhat the documentation says
Stablev2.38.10, stable since 16 November 2026The safest installation and upgrade path; all bug fixes and security patches
Mainlinev2.39.4New features first, for those with a staging environment
Security SupportThe release before stableSecurity 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 resources to plan for

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 usersvCPUMemoryInstances
Control plane, coderd28 GB3
Provisioner11 GB60
PostgreSQL database830 GB1

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.

The access URL and the wildcard domain

Coder relies on two addresses, to decide before you install:

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.

DNS and the certificate

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:

PatternExample generated hostnameRequired DNS and TLS wildcard
*.coder.example.com8080--main--myworkspace--john.coder.example.com*.coder.example.com
*-coder.example.com8080--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.

DNS zone
coder.example.com      A      203.0.113.10
*.coder.example.com    CNAME  coder.example.com

Installing with Docker Compose

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:

.env
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.

Terminal, in the coder folder
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:

compose.yaml
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:
Terminal
docker compose up -d
docker compose logs -f coder

The first account and access

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.

Terminal, on your computer
ssh -L 7080:127.0.0.1:7080 user@coder.example.com

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.

HTTPS: the reverse proxy and the wildcard certificate

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.

With Caddy

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:

Caddyfile
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

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:

Terminal
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.

/etc/nginx/sites-available/coder.example.com
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;
    }
}
Terminal
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.

Then, subdomain apps only

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:

compose.yaml, coder service
CODER_DISABLE_PATH_APPS: "true"
Terminal
docker compose up -d

The Docker template and the Docker socket

After the first account, Coder opens the template builder. It composes a valid Terraform configuration without you writing any:

  1. Select the Docker base template.
  2. Add modules, such as code-server for VS Code in the browser, or skip this step.
  3. Name the template, then select “Create Template”.
  4. Select “Create Workspace”, name the workspace, then “Create workspace”.

What the Docker socket grants

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.

Notification emails

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:

compose.yaml, coder service
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}"

Notification delivery is then configured on your deployment’s /settings/notifications page.

Backups

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:

ItemWhat it keepsTo back up
PostgreSQL database, coder_data volumeUsers, templates, workspace state and metadataYes, with pg_dump
coder-…-home volumesEach workspace’s /home/coder folder: the developers’ code and filesYes
.env and compose.yamlThe version, the addresses and the secretsYes, kept safe
coder_home volumeFiles Coder recreates on startNo
Terminal, in the coder folder
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:

Terminal, for one volume
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.

Restoring the database

Restore with the Coder version that produced the copy. With Coder stopped, recreate the empty database, load the copy, then restart:

Terminal, in the coder folder
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

Updates

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:

Terminal, in the coder folder
docker compose exec -T database pg_dump -U coder coder > coder-before-upgrade.sql
docker compose pull coder
docker compose up -d coder

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.

Who does what on a managed VPS

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.

TopicOur teamsYou
The serverSystem and security updates, server interventions includedThe timing that suits your business
MonitoringServer monitored 24/7, with intervention without waiting for your callReading your instance’s logs
CoderProactive monitoring: errors, slowdowns, memory and disk space spotted, fix recommendedIts installation, updates and settings, which you apply, yourself or through your AI assistant
Templates and accountsThe server that runs the workspaces, monitored and backed upTemplates, roles, authentication and your team’s access
BackupsEvery night, encrypted and kept off the machine; restores includedYour database copy before each update, and the restore request, when you need one
MigrationYour current server migrated, free of chargeThe 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.

Coder, on a server run for you

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 free.

Explore Managed VPS

Frequently asked questions

Is Coder free for a business?

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.

Which Coder version should you install?

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.

What resources does Coder need?

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.

How do you install Coder with Docker Compose?

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.

What is CODER_WILDCARD_ACCESS_URL for?

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.

Does Coder need a wildcard certificate?

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.

How do you back up Coder?

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.

Does a managed VPS cover Coder?

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.

Contact us