In one paragraph
Workspace access is three questions: where does the code run, who can reach it, and what happens when a laptop is lost. Every layer has a mature open-source answer. This guide builds a workspace that a contractor can use on day one and lose on day thirty without a security incident.
What you end up with
- A browser-reachable development environment with no local setup required
- Identity with per-person accounts and scoped access, not a shared password
- A private network for services with no public ports
- An offboarding procedure that is a script, and can be proven with a log
The reference stack
Every project below is open source and self-hostable. Licences are the ones the project publishes today; check them against your own distribution model before you ship, because a licence can change and an AGPL project has obligations a MIT project does not.
| Layer | Open-source project | Licence | What it does for you |
|---|---|---|---|
| Remote IDE | code-server | MIT | VS Code in the browser, one container per person, with the workspace on a mounted volume. |
| Full cloud dev env | Eclipse Che or DevWorkspace | EPL-2.0 / Apache-2.0 | Kubernetes-native dev environments defined as code, when you need many ephemeral workspaces. |
| Identity | Keycloak | Apache-2.0 | OIDC/SAML SSO, groups, MFA, and one place to disable a person across every tool. |
| Private network | Headscale (Tailscale-compatible control server) | BSD-3-Clause | WireGuard mesh so services are reachable by device identity and not exposed to the internet. |
| Remote desktop (if needed) | Apache Guacamole | Apache-2.0 | Browser-based RDP/VNC/SSH with session recording, for machines that cannot be containerised. |
| Secrets | OpenBao (Vault-compatible) or SOPS + age | MPL-2.0 / MPL-2.0 | Short-lived credentials issued per session, instead of a .env file in a shared drive. |
| Audit | Loki + Grafana | AGPL-3.0 | Auth, session and command logs in one place, queryable during an incident. |
Build it
1. Put identity in front of everything first
One OIDC provider in front of the IDE, the git host, the dashboards and the internal tools. Offboarding then means disabling one account, and every access decision has a named human behind it instead of a shared token.
# per-person workspace (code-server)
docker run -d --name ws-alice
-e PASSWORD="$(openssl rand -hex 16)"
-v /srv/ws/alice:/home/coder/project
--network internal --label traefik.enable=false
codercom/code-server:latest
# reachable only through the private mesh + OIDC proxy, never a public port
2. One workspace per person, on a volume with a backup
Shared workspaces create permission problems and secrets leakage. Isolate per person, back up the volume nightly, and make the restore path a tested procedure rather than an assumption.
3. Keep services off the public internet
The mesh network, not a port forward. An internal dashboard on a public IP with a login screen is one vulnerability away from being somebody else’s dashboard.
4. Issue secrets per session
Short-lived credentials from a secrets service, or encrypted files in the repo with a per-person key. The goal is that a lost laptop exposes nothing durable. Rotate on offboarding as a matter of routine, not as a scramble.
5. Log the things you would need in an incident
Authentication events, workspace start and stop, privileged command execution, and secret access. Retain for a stated period. Logging nothing is common and it is why most small-team incidents are unattributable.
6. Write the offboarding script and run it once as a drill
Disable the identity, revoke the mesh key, stop the workspace, rotate shared secrets, export the volume. Rehearse it before you need it; an untested offboarding procedure is a wish.
Acceptance checks
If you cannot verify a claim, it is not a finding. These are the checks that close the work; each one can be run by somebody who did not build it.
| Acceptance check | How to verify it |
|---|---|
| Every workspace is behind OIDC | Attempt to reach the IDE without a session; expect a redirect, not a login form from the IDE itself. |
| No service has a public listener | External port scan of the host; only the mesh and the reverse proxy answer. |
| Volume backups run and restore has been tested | A restore into a scratch workspace, dated in the runbook. |
| Secrets are short-lived or per-person encrypted | Grep the volumes and the repositories for long-lived tokens. |
| Auth logs exist for the last 30 days | Query Loki for login events per user. |
| Offboarding completes in one script run | Drill on a dummy account; every access path confirmed closed. |
Effort and cost
| Estimate | |
|---|---|
| Skill needed | Advanced: containers, OIDC, and networking you can reason about |
| Build time | 1 day for code-server + proxy, 1–2 days for Keycloak, 1 day for the mesh, 1 day for secrets |
| Running cost | An hour a month plus the host; Guacamole and Kubernetes add real maintenance |
| What you must host | One 8 GB host for a small team; more for per-person workspaces with heavy builds. |
What open source does not give you
The honest half of the comparison. Each of these is a reason somebody buys the service instead of building it, and pretending otherwise would make the rest of this page worthless.
- Browser IDEs are slower than a local editor on large repositories, and extensions with native binaries may not work. This is a real productivity cost, not a detail.
- Latency decides whether a remote workspace is usable. If your team is on the other side of an ocean from the host, typing will feel it.
- Tailscale’s control plane is proprietary; Headscale is the open reimplementation and it tracks, rather than leads, the client. Expect occasional version friction.
- Self-hosting identity means you are the identity provider. A Keycloak outage is a company-wide login outage, and its backup is now business-critical.
- Compliance certifications (SOC 2 and similar) come from an audit of your process, not from the software you install.
What the service adds
Scope only, stated so you can compare it with the build above.
- The access model designed against your team structure, contractors and client data
- A rehearsed offboarding drill with the evidence that every path closed
- Ongoing patch and upgrade discipline for the identity and secrets layer
Sources and further reading
- code-server docs
- Keycloak — securing apps
- Headscale documentation
- Guacamole manual
- OpenBao documentation
Related guides
What this page does not include. This guide documents an open-source implementation of the same outcome. It deliberately leaves out 5 Kings’ internal playbooks, client data, vendor terms and unpublished method: we publish what any competent team can reproduce, and we do not publish what belongs to a client or to a contract. Where a step depends on a decision only your business can make, the guide says so instead of guessing.
Take it with you
Give a distributed team a workspace on open source
The full guide as an A4 PDF: the reference stack with licences, the build steps, the acceptance checks and the honest limits — in one file you can hand to an engineer or print for a planning session.