Self-Hosted Alternatives to GitHub Codespaces

Why Replace GitHub Codespaces?

Cost. GitHub Codespaces gives you 120 core-hours/month free (60 hours on a 2-core machine). After that, it’s $0.18/hour for 2 cores or $0.36/hour for 4 cores. A developer using Codespaces 8 hours/day on 4 cores pays ~$58/month. Self-hosted alternatives cost nothing beyond the server you already run.

Compute limits. Codespaces caps at 32 cores and 64 GB RAM. Your own server has whatever you put in it. Run builds on a 128 GB RAM machine if you want — no tier limits.

Privacy. Your code lives on GitHub’s infrastructure during active Codespace sessions. While GitHub’s security is solid, self-hosting means your source code never leaves your network. For proprietary code or regulated industries, this matters.

Latency. Codespaces runs in Azure data centers. If you’re not near one, every keystroke has noticeable lag. A self-hosted IDE on your LAN has zero perceptible latency. Even over Tailscale from across the country, it’s faster than Codespaces.

Always available. Codespaces instances stop after inactivity and have cold start times. Self-hosted IDEs run 24/7. Open your browser and start coding — no waiting.

Best Alternatives

code-server — Most Mature Option

code-server has been the default self-hosted VS Code since 2019. Built by Coder, it adds server-side features like password authentication, a YAML config file, and proxy domain support. Uses the Open VSX extension marketplace — most popular extensions are available, though some Microsoft-exclusive ones (Copilot, Python extension) may be missing.

What you get: Full VS Code in the browser, password authentication, persistent workspace, all your extensions and settings, terminal access, Git integration.

Best for: Developers who want the most battle-tested self-hosted VS Code with the most configuration options.

[Read our full guide: How to Self-Host code-server]

OpenVSCode Server — Closest to VS Code

OpenVSCode Server is built by Gitpod and is the thinnest wrapper around upstream VS Code. It connects to the official Microsoft marketplace, so every extension — including GitHub Copilot, the Python extension, and Remote Development Pack — works out of the box.

What you get: Full VS Code in the browser with the official extension marketplace. Token-based authentication. Faster upstream version updates than code-server.

Best for: Developers who need specific Microsoft marketplace extensions or want the experience closest to desktop VS Code.

[Read our full guide: How to Self-Host OpenVSCode Server]

Migration from Codespaces

Step 1: Set Up Your Self-Hosted IDE

Deploy either code-server or OpenVSCode Server on your server using Docker Compose. Both guides take under 10 minutes.

Step 2: Clone Your Repos

From the terminal inside your new IDE:

git clone [email protected]:your-org/your-repo.git

Use SSH keys for authentication. Mount your SSH keys into the container:

volumes:
  - ~/.ssh:/home/.ssh:ro

Step 3: Install Your Extensions

Open the Extensions sidebar and install the same extensions you use in Codespaces. If switching to code-server, check that your extensions exist on Open VSX first.

Step 4: Copy Settings

Export your VS Code settings from Codespaces (Settings → Profiles → Export Profile) and import them in your self-hosted instance.

Step 5: Set Up Dev Containers (Optional)

If you use Codespaces’ devcontainer feature, you can replicate it with Docker-in-Docker. Mount the Docker socket into your IDE container:

volumes:
  - /var/run/docker.sock:/var/run/docker.sock

Then use the Dev Containers extension to open projects in containerized environments — same as Codespaces.

Cost Comparison

GitHub Codespaces (4-core, 8h/day)Self-Hosted (existing server)
Monthly cost~$58/month$0
Annual cost~$696/year$0
3-year cost~$2,088$0
Compute4 cores, 16 GB RAM (tier limit)Whatever your server has
Storage32 GB default (per instance)Your disk
Cold start30–90 secondsInstant (always running)
ExtensionsFull marketplacecode-server: Open VSX; OpenVSCode: Full marketplace
Data locationAzure (GitHub’s servers)Your hardware

If you need a dedicated server: a Hetzner CPX21 VPS costs €5.39/month (~$6). That’s a 3-core, 4 GB RAM machine that runs your IDE 24/7 for one-tenth of Codespaces’ cost.

What You Give Up

Prebuilt dev environments. Codespaces reads .devcontainer/devcontainer.json and builds a ready-to-code environment automatically. Self-hosted IDEs require you to set up the environment yourself (though Docker-in-Docker with the Dev Containers extension gets you close).

GitHub integration. Codespaces has deep GitHub integration — create a Codespace directly from a PR, branch, or issue. Self-hosted IDEs require manual git clone and branch checkout.

Collaboration. Codespaces supports Live Share for real-time collaborative editing. This works in OpenVSCode Server (through the marketplace extension) but may be limited in code-server.

Automatic scaling. Codespaces adjusts resources per-project. Self-hosted IDEs share your server’s fixed resources.