English
Get started

← All templates · Developer tools

Deploy Coder in one click

Remote development environments from Terraform templates, opened in VS Code, JetBrains, a browser or over SSH

A self-hosted alternative to GitHub Codespaces and Gitpod.

What is Coder?

Coder is an open-source platform for cloud development environments, a self-hosted alternative to GitHub Codespaces. An admin writes a template in Terraform, and each developer gets a workspace from it: a Kubernetes pod, a cloud VM or a Docker container. Workspaces can start on a schedule in the morning and shut down when nobody uses them, so idle machines stop costing money. AI coding agents such as Claude Code and Codex can run in workspaces too.

Teams run Coder to keep source code on infrastructure they operate, with any Git provider. It is free and open source with no cap on users or workspaces, and its makers suggest the free edition for teams of about 50 or fewer. The catch: it is a control plane and runs no workspaces itself. Workspaces need compute of their own, such as a cloud account, a Kubernetes cluster or a Docker host, and anything past the starter templates takes some Terraform.

Hosting Coder on Pethost

  1. You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
  2. New project opens at Coder. You fill in what it asks for and click Create project: Email, Admin password.
  3. In a minute or two Coder is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
  4. It is a project like any other: you or your agent can change it, roll it back or restore it.

Questions about Coder

Is Coder free and open source?

Yes. Coder's Community edition is free and open source under the AGPL-3.0. Premium, billed per user each year, adds audit logging, quotas, multi-organization access control and high availability.

Coder vs GitHub Codespaces: what is the difference?

Codespaces runs in GitHub's cloud and works with GitHub-hosted repositories. Coder runs on infrastructure you operate, with any Git provider, and its workspaces come from Terraform templates your team keeps under version control.

What is the difference between Coder and code-server?

code-server is VS Code in the browser, built for one person. Coder, from the same company, is built for teams: it provisions workspaces from Terraform templates, and a workspace can include code-server as one of its apps.

Which IDEs work with Coder?

Desktop VS Code, Cursor and JetBrains IDEs such as IntelliJ IDEA, GoLand and PyCharm connect to a workspace. In the browser there is a web terminal, a template can add code-server or JupyterLab, and SSH works too.

Can Coder on Pethost run workspaces as Docker containers?

No. Coder's Docker starter template needs a Docker socket, and this project's containers have none. Use a template that provisions workspaces on Kubernetes or on a cloud you have an account with, such as AWS.

How much memory and disk does Coder need?

Coder is light: about 350 MB with its Postgres, since the workspaces run on the cloud or cluster you connect. On Pethost the Starter plan is enough for it, with room for other apps beside it.

Coder Docker Compose file

The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.

Containers: coder (ghcr.io/coder/coder:v2.37.4), database (postgres:17-alpine).

Volumes, in the nightly backup: db.

services:
  coder:
    image: ghcr.io/coder/coder:v2.37.4
    restart: unless-stopped
    environment:
      CODER_PG_CONNECTION_URL: postgresql://coder:${POSTGRES_PASSWORD}@database/coder?sslmode=disable
      CODER_HTTP_ADDRESS: 0.0.0.0:7080
      CODER_ACCESS_URL: ${URL}
      CODER_TELEMETRY_ENABLE: "false"
      ADMIN_EMAIL: ${ADMIN_EMAIL}
      ADMIN_PASSWORD: ${ADMIN_PASSWORD}
    # A new Coder lets its first visitor create the owner account. So, before it answers on its
    # own port, it is started on one nobody reaches and the email and password asked become the
    # owner, the first time only.
    entrypoint: ["/bin/sh", "-c"]
    command:
      - |
        CODER_HTTP_ADDRESS=127.0.0.1:3001 /opt/coder server &
        setup=$$!
        tries=0
        until wget -q -O /dev/null http://127.0.0.1:3001/healthz; do
          tries=$$((tries + 1))
          [ $$tries -lt 300 ] || exit 1
          sleep 1
        done
        if ! wget -q -O /dev/null http://127.0.0.1:3001/api/v2/users/first; then
          /opt/coder login http://127.0.0.1:3001 \
            --first-user-username admin --first-user-full-name Admin \
            --first-user-email "$$ADMIN_EMAIL" --first-user-password "$$ADMIN_PASSWORD" \
            --first-user-trial=false || exit 1
        fi
        kill $$setup
        wait $$setup
        exec /opt/coder server
    depends_on:
      database:
        condition: service_healthy

  database:
    image: postgres:17-alpine
    restart: unless-stopped
    environment:
      POSTGRES_DB: coder
      POSTGRES_USER: coder
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U coder -d coder"]
      interval: 5s
      timeout: 5s
      retries: 10
      start_period: 30s

volumes:
  db:

More in Developer tools