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 git@github.com: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 |
| Compute | 4 cores, 16 GB RAM (tier limit) | Whatever your server has |
| Storage | 32 GB default (per instance) | Your disk |
| Cold start | 30–90 seconds | Instant (always running) |
| Extensions | Full marketplace | code-server: Open VSX; OpenVSCode: Full marketplace |
| Data location | Azure (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.
FAQ
Can I use VS Code extensions with code-server and OpenVSCode Server?
OpenVSCode Server uses the official VS Code marketplace — all extensions work, including proprietary Microsoft extensions. code-server uses the Open VSX registry, which has most popular extensions but is missing some Microsoft-exclusive ones (Remote - SSH, Pylance, C# Dev Kit). For maximum extension compatibility, choose OpenVSCode Server. Both support installing extensions from .vsix files as a workaround.
How do I replicate Codespaces’ dev containers in a self-hosted setup?
Mount the Docker socket into your IDE container (/var/run/docker.sock:/var/run/docker.sock) and install the Dev Containers extension. This lets you open projects inside containerized environments using the same .devcontainer/devcontainer.json files that Codespaces uses. The main difference: Codespaces builds containers automatically on demand, while self-hosted requires the container to be pre-built or built on first use.
Is there input lag when coding remotely on a self-hosted IDE?
Over a decent internet connection (10+ Mbps), input lag is imperceptible — comparable to Codespaces. Both code-server and OpenVSCode Server are web-based and render the editor in your browser. The experience degrades on high-latency connections (>200ms). For the best experience, host on a VPS in your geographic region. A $6/month Hetzner VPS provides a responsive coding environment with no cold start delay.
Can multiple developers share a self-hosted IDE server?
Yes. code-server supports multi-user setups with separate workspaces per user (configure via Caddy or Nginx reverse proxy with authentication). OpenVSCode Server is designed for single-user use but can be deployed as multiple instances behind a reverse proxy. For team setups, run one container per developer with separate ports or subdomains. Each developer gets their own isolated workspace.
How much does it cost compared to Codespaces for a solo developer?
A Codespaces 4-core instance at 8 hours/day costs roughly $58/month. A self-hosted Hetzner CPX21 VPS (3 cores, 4 GB RAM) costs €5.39/month (~$6) and runs 24/7 — ten times cheaper with no cold start delays. If you already have a home server or NAS, the cost is $0 beyond electricity. The break-even point is less than one month of Codespaces usage.
Do self-hosted IDEs support GitHub Copilot?
Yes, in OpenVSCode Server — install the GitHub Copilot extension from the marketplace and sign in with your GitHub account. code-server doesn’t support the official Copilot extension (it’s not on Open VSX). As alternatives, Continue works with local LLMs via Ollama, or Tabby provides self-hosted code completion without sending code to external servers.
Can I access my self-hosted IDE from a tablet or phone?
Yes. Both code-server and OpenVSCode Server work in mobile browsers — Chrome and Safari on tablets provide a usable editing experience, especially with a Bluetooth keyboard. The VS Code web interface adjusts to smaller screens. It’s not as polished as a native app, but for quick edits, reviews, or debugging from an iPad, it works. For serious mobile coding, pair with a physical keyboard.
Related
Get self-hosting tips in your inbox
Get the Docker Compose configs, hardware picks, and setup shortcuts we don't put in articles. Weekly. No spam.
Comments