Coder is an open-source platform for remote development environments. Instead of every developer configuring tools on their own laptop, you define workspaces as code (with Terraform templates), and Coder creates them on your infrastructure: Docker containers on a VPS, VMs, or Kubernetes pods. Developers connect with VS Code, JetBrains IDEs, a browser IDE or SSH. A powerful VPS becomes a shared, consistent dev machine for a whole team.

Why remote dev environments?

  • Fast onboarding: a new developer gets a ready workspace in minutes.
  • Consistency: everyone uses the same tool versions and dependencies.
  • Power: builds and tests run on a server with more CPU and RAM than a laptop, close to your staging databases.
  • Security: source code stays on your server instead of on laptops.
  • Work from anywhere: a browser or thin client is enough.

Coder vs code-server

code-server Coder
What it is VS Code in the browser, one instance Platform that provisions many workspaces
Users Usually one Teams, with accounts, roles and SSO
Environments One machine Templates: containers, VMs, Kubernetes
IDEs Browser VS Code VS Code desktop, JetBrains, browser IDE, SSH

For a single developer, code-server is simpler. See code-server: VS Code in the browser. For a team, Coder adds management.

Requirements

  • A VPS with 4+ vCPU and 8+ GB RAM for a few active workspaces (Coder itself is light; workspaces need the resources). Plan about 2 vCPU and 4 GB RAM per active developer for typical web development.
  • Docker. See installing Docker on Ubuntu.
  • A domain name, with a wildcard DNS record if you want subdomain-based app forwarding (*.coder.example.com).

Install with Docker Compose

# /opt/coder/compose.yaml
services:
  coder:
    image: ghcr.io/coder/coder:latest
    restart: unless-stopped
    ports:
      - "127.0.0.1:7080:7080"
    environment:
      CODER_PG_CONNECTION_URL: "postgresql://coder:${POSTGRES_PASSWORD}@database/coder?sslmode=disable"
      CODER_HTTP_ADDRESS: "0.0.0.0:7080"
      CODER_ACCESS_URL: "https://coder.example.com"
      CODER_WILDCARD_ACCESS_URL: "*.coder.example.com"
    group_add:
      - "${DOCKER_GID}"               # lets Coder create workspace containers
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    depends_on:
      database:
        condition: service_healthy
  database:
    image: postgres:16
    restart: unless-stopped
    environment:
      POSTGRES_USER: coder
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: coder
    volumes:
      - coder_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U coder -d coder"]
      interval: 5s
      retries: 5
volumes:
  coder_data:
cd /opt/coder
echo "POSTGRES_PASSWORD=$(openssl rand -hex 16)" > .env
echo "DOCKER_GID=$(getent group docker | cut -d: -f3)" >> .env
docker compose up -d
docker compose logs -f coder

Mounting the Docker socket gives Coder control of Docker on the host, which is required for the Docker template. Only trusted administrators should manage templates. Pin a version tag in production.

HTTPS with Nginx

server {
    server_name coder.example.com *.coder.example.com;
    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-Forwarded-Proto $scheme;
        proxy_read_timeout 86400;
    }
}

WebSockets are essential: terminals, IDE connections and port forwarding use them. A wildcard certificate needs the DNS challenge. See Certbot wildcard certificates.

First login and a workspace template

  1. Open https://coder.example.com and create the first (admin) user.
  2. Go to Templates → Create template, and pick the Docker starter.
  3. Customize the template’s Terraform: base image (your own dev image with Node, Python, Go…), CPU and memory limits, persistent home volume, and installed IDEs (code-server for the browser, or connections from VS Code desktop).
  4. Developers click Create workspace, choose the template, and start working.

From a laptop, the CLI connects your local tools:

curl -L https://coder.com/install.sh | sh
coder login https://coder.example.com
coder config-ssh             # then: ssh coder.my-workspace

VS Code users can install the Coder extension to open workspaces directly.

Resource control

  • Set CPU and memory limits in templates, so one workspace can’t starve the others.
  • Use auto-stop schedules (e.g. stop after 2 hours idle) to free resources overnight.
  • Keep the home directory in a persistent volume, and treat the rest of the workspace as disposable.

See Docker Compose in production.

Security

  • Disable open signup; add users manually, or configure OIDC/SSO.
  • Keep Coder and workspace images updated.
  • Back up the PostgreSQL database (users, templates, workspace metadata) and the workspace volumes. See Docker volume backups.
  • Restrict SSH and firewall to 80/443 publicly. See UFW firewall.

Quick reference

Task Command / place
Start docker compose up -d
Access URL CODER_ACCESS_URL
Create template Web UI → Templates (Docker starter)
CLI login coder login https://…
SSH into workspace coder config-ssh, then ssh coder.<name>
Update docker compose pull && docker compose up -d

Related: VPS for developers and Docker VPS hosting.

  • Self-Hosting
  • Development
  • Docker