Deploy Coder | Open Source GitHub Codespaces Alternative
Railway

Deploy Coder | Open Source GitHub Codespaces Alternative

Self-host Coder on Railway. Remote dev environments with any IDE

Deploy Coder | Open Source GitHub Codespaces Alternative

/var/lib/postgresql/data

Just deployed

Coder dashboard

Deploy and Host Coder on Railway

Deploy on Railway

Deploy Coder on Railway to self-host your own remote development platform with zero infrastructure management. Coder lets teams provision cloud development environments on any infrastructure using Terraform templates — giving developers consistent, pre-configured workspaces accessible from VS Code, JetBrains, Cursor, or a web terminal.

Self-host Coder on Railway with this template that pre-configures the Coder control plane server alongside a PostgreSQL database for persistent state. The control plane handles user management, template definitions, workspace orchestration, and the web dashboard — while workspace compute runs on your own Docker hosts, Kubernetes clusters, or cloud VMs connected via external provisioners.

Getting Started with Coder on Railway

After deployment completes, visit your Coder URL to reach the first-time setup wizard. Create your admin account by entering a username, email, and password. Once logged in, you'll land on the Coder dashboard where you can create workspace templates.

Since Railway doesn't support Docker-in-Docker, this deployment runs as a control plane only — the web UI, API, and user management all work, but workspace provisioning requires connecting external provisioners. To start creating workspaces, install the Coder CLI on a machine with Docker or Kubernetes access and run coder provisioner start pointed at your Railway-hosted control plane. You can also use cloud-based templates (AWS EC2, GCP VMs, Azure) that don't need local Docker.

Navigate to Templates to browse the starter templates or create your own using Terraform. Invite team members under Users with role-based access controls.

About Hosting Coder

Coder is an open-source (AGPL-3.0) remote development platform that provisions reproducible cloud development environments via Terraform. Unlike GitHub Codespaces (Azure-only, GitHub-only) or the now-deprecated Gitpod Classic, Coder is fully cloud-agnostic and self-hosted.

Key features:

  • Infrastructure-as-Code — workspaces defined as Terraform templates, deployable on any cloud, on-prem, or air-gapped
  • Multi-IDE support — VS Code, JetBrains, Cursor, Windsurf, Jupyter, and web terminal
  • AI agent governance — run Claude, Copilot, and other AI agents in auditable, sandboxed workspaces via Coder Tasks
  • Coder Desktop & Connect — native desktop app with seamless remote access without port forwarding
  • Enterprise-grade security — SOC 2 Type II, RBAC, audit logging, OIDC SSO, multi-org support
  • Automatic cost optimization — auto-shutdown idle workspaces, right-size infrastructure

The Railway deployment uses two services: Coder (control plane) and PostgreSQL (state storage).

Why Deploy Coder on Railway

A single-click Railway deployment gets your Coder control plane running without managing servers:

  • Pre-configured PostgreSQL with automatic backups and failover
  • HTTPS with Railway's TLS termination — no certificate management
  • Scale the control plane independently from workspace compute
  • Centralized admin dashboard accessible from anywhere
  • Connect external provisioners for workspace creation on any infrastructure

Common Use Cases for Self-Hosted Coder

  • Enterprise developer onboarding — spin up pre-configured environments in seconds instead of days of manual setup
  • Regulated industries — banks and government agencies keeping source code off developer laptops and on compliant infrastructure
  • AI coding agent management — running and monitoring AI agents in governed, auditable workspaces with Coder Tasks
  • Remote/distributed teams — consistent development environments regardless of developer location or hardware

Dependencies for Coder on Railway

  • Coderghcr.io/coder/coder:latest (v2.32.0) — control plane server
  • PostgreSQLghcr.io/railwayapp-templates/postgres-ssl:18 — persistent state storage

Deployment Dependencies

Hardware Requirements for Self-Hosting Coder

ResourceMinimumRecommended
CPU1 vCPU2 vCPU
RAM2 GB4 GB
Storage1 GB (control plane)32 GB SSD (with PostgreSQL)
PostgreSQL13+ required16+ recommended

The control plane scales at approximately +1 vCPU and +2 GB RAM per 250 users. Workspace resources are separate and depend on the compute infrastructure connected via external provisioners.

Self-Hosting Coder with Docker

Run Coder locally with Docker Compose for development or evaluation:

services:
  coder:
    image: ghcr.io/coder/coder:latest
    ports:
      - "7080:7080"
    environment:
      CODER_ACCESS_URL: "http://localhost:7080"
      CODER_HTTP_ADDRESS: "0.0.0.0:7080"
      CODER_PG_CONNECTION_URL: "postgresql://coder:coder@database:5432/coder?sslmode=disable"
    depends_on:
      database:
        condition: service_healthy
  database:
    image: postgres:16
    environment:
      POSTGRES_USER: coder
      POSTGRES_PASSWORD: coder
      POSTGRES_DB: coder
    volumes:
      - coder_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U coder -d coder"]
      interval: 5s
      timeout: 5s
      retries: 5
volumes:
  coder_data:

Start with:

docker compose up -d
# Visit http://localhost:7080 to create your admin account

Is Coder Free to Self-Host?

Coder is fully open-source under the AGPL-3.0 license. The Community Edition is free with unlimited workspaces, templates, and users within a single organization. You pay only for your own compute infrastructure. A Premium Edition adds enterprise features like multi-org support, audit logging, HA replicas, and SLA-backed support — contact Coder for pricing. On Railway, your cost is purely infrastructure: the control plane and PostgreSQL services.

Coder vs GitHub Codespaces vs Gitpod

FeatureCoderGitHub CodespacesGitpod (now Ona)
HostingSelf-hosted anywhereAzure SaaS onlyPivoted away from CDEs (Oct 2025)
Open sourceYes (AGPL-3.0)NoN/A
Cloud supportAny cloud, on-prem, air-gappedAzure onlyWas K8s-based
Repository supportGitHub, GitLab, Bitbucket, Azure DevOpsGitHub onlyWas multi-provider
IDE supportVS Code, JetBrains, Cursor, Windsurf, JupyterVS Code (primary)Was VS Code, JetBrains
Data sovereigntyCode stays on your infraCode on Microsoft infraN/A
PricingFree (open source) + infra costsPer-hour compute billingDiscontinued

Coder is the strongest self-hosted option — especially after Gitpod's pivot to Ona left many teams looking for alternatives. GitHub Codespaces remains simpler for VS Code + GitHub-only workflows but lacks data sovereignty and multi-cloud support.

FAQ

What is Coder and why self-host it on Railway? Coder is an open-source platform for creating and managing remote cloud development environments. Self-hosting on Railway gives you a managed control plane with automatic HTTPS, PostgreSQL backups, and zero server maintenance — while keeping full control over where developer workspaces run.

What does this Railway template deploy for Coder? The template deploys two services: the Coder control plane server (ghcr.io/coder/coder:latest) and a PostgreSQL 18 database for persistent state. The control plane handles the web dashboard, API, user management, and template definitions.

Why does the Coder Railway template include PostgreSQL? Coder requires PostgreSQL 13+ to store user accounts, workspace metadata, template definitions, audit logs, and session state. Without a database, Coder cannot persist any configuration between restarts.

Can I create developer workspaces with Coder deployed on Railway? The Coder control plane works fully on Railway, but workspace provisioning requires Docker or Kubernetes — which Railway doesn't provide. Connect external provisioners running on a machine with Docker/K8s access using coder provisioner start, or use cloud-based templates (AWS EC2, GCP VMs) that provision directly via cloud APIs.

How do I connect an external provisioner to my Railway-hosted Coder instance? Install the Coder CLI on a machine with Docker or Kubernetes access. Set CODER_PROVISIONER_DAEMON_PSK as a shared secret on both the Railway Coder service and the provisioner machine, then run coder provisioner start --psk --url https://your-coder.up.railway.app. The provisioner connects to the control plane and handles workspace creation.

How do I enable SSO authentication for self-hosted Coder? Set the CODER_OIDC_ISSUER_URL, CODER_OIDC_CLIENT_ID, and CODER_OIDC_CLIENT_SECRET environment variables to connect any OpenID Connect provider (Google, Okta, Auth0, Keycloak). For GitHub OAuth specifically, use CODER_OAUTH2_GITHUB_CLIENT_ID and CODER_OAUTH2_GITHUB_CLIENT_SECRET.


Template Content

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

Shahed Nasser