Cloud Dev Environments vs Local Containers
Leadership asks whether the team should "move to Codespaces", and the discussion goes in circles: one side cites a new hire who was productive in an hour, the other cites a colleague on a train who could not type without lag. Both anecdotes are true and neither answers the question. The decision between cloud development environments and local containers depends on a handful of measurable quantities, and this page shows how to collect them and read the result, as part of cloud development environments for onboarding.
The comparison assumes both options use the same devcontainer.json, which is the setup the rest of this topic recommends. Without that, you are comparing two different environments rather than two places to run one.
Diagnostic
Collect the same five numbers for each option over a two-week pilot with at least three developers, including at least one recent hire:
#!/usr/bin/env bash
set -euo pipefail
mode="${1:?usage: measure.sh local|cloud}"
t0=$(date +%s)
if [ "$mode" = local ]; then devcontainer up --workspace-folder . >/dev/null; else gh codespace create --repo acme/shop --branch main --machine standardLinux32gb >/dev/null; fi
t1=$(date +%s)
echo "$mode start_seconds=$((t1 - t0))"
ping -c 20 -q "${CDE_HOST:-github.dev}" 2>/dev/null | awk -F'/' '/^rtt|^round-trip/{print "rtt_avg_ms=" $5}' || true
Record alongside it: time from laptop unboxing to first merged pull request, self-reported input latency (a simple 1–5 score per day), monthly cost per developer, and support tickets about environment setup. A typical result from one team:
metric local containers cloud workspace
first PR (new hire) 2.5 days 0.5 days
start from scratch 14 min 1.5 min (prebuilt)
typing latency score 5.0 4.1 (office), 2.8 (train)
cost per dev per month 0 (laptop owned) 48 USD
setup tickets per month 9 2
Root cause
The two options move cost and risk to different places. Local containers are paid for once in hardware and repeatedly in setup and support time: each laptop is a slightly different host, and each difference can break the environment. Cloud workspaces remove the host variation and the setup time, and replace them with a per-hour bill and a dependency on network quality between the developer and the workspace. Which one "wins" is therefore not a technical question but a question of where your team's time currently goes. A team with frequent new hires, contractors or heavy monorepos spends a lot on setup and support, so the cloud option pays off quickly; a stable, co-located team with powerful laptops spends little there and mostly notices the new latency and cost.
Security and compliance can override the rest. If source code must not be stored on laptops, cloud workspaces (self-hosted where required) may be mandatory regardless of latency. If developers must work offline — on flights, at customer sites with restricted networks — local environments remain necessary regardless of onboarding speed.
Resolution
- Put the pilot data into a simple per-developer monthly cost model. Compare cloud spend with the value of the time it saves, using a loaded hourly rate:
#!/usr/bin/env bash
set -euo pipefail
rate=95 # loaded cost per engineer hour, USD
cloud_cost=48 # measured cloud spend per developer per month
setup_hours_local=3.0 # support and setup hours per developer per month, local
setup_hours_cloud=0.6 # same, cloud
latency_hours_cloud=1.5 # estimated productivity loss from latency per month
saved=$(echo "($setup_hours_local - $setup_hours_cloud - $latency_hours_cloud) * $rate" | bc)
echo "monthly value of time saved: $saved USD vs cloud cost: $cloud_cost USD"
With the numbers above, the cloud option saves about 85 USD of time per developer for 48 USD of spend — a modest win. For new hires in their first month, where local setup hours are far higher, the win is large.
Segment the decision rather than making one global choice. Common outcomes that match the data:
- New hires and contractors start in cloud workspaces, and move local after a few weeks if they prefer.
- Monorepos too large for laptops run in the cloud permanently.
- Developers who travel or have poor connectivity keep local environments as the default.
Keep both paths working from one definition. Build the dev container in CI and run
make doctorin both a local runner and a cloud workspace on a schedule, so neither path rots.Re-measure after six months. Prebuild improvements, laptop refreshes and team changes shift the numbers.
Expected output
A written decision with the measurements behind it, for example:
Decision (2026-09): New hires and contractors default to Codespaces (4-core, 30-min idle);
existing developers may choose. Both paths share .devcontainer/ and are checked nightly.
Evidence: first PR 2.5d -> 0.5d; setup tickets 9 -> 2 per month; cost 48 USD/dev/month.
Review: 2027-03.
The record makes the trade-off explicit and gives the next review a baseline to compare against.
It also answers the most common follow-up objection — "we tried Codespaces and it was slow" — with specifics: which machine size, which region, which prebuild state and which network the measurement came from. Many negative first impressions turn out to be an unprebuilt 2-core machine in a distant region, which is a configuration problem rather than a verdict on the approach.
Prevention
Track time-to-first-PR continuously, not only during the pilot, using the approach in measuring onboarding time in distributed teams.
Watch cost per active developer, not total cost. Total cost grows with headcount; per-developer cost growing means idle workspaces or oversized machines.
Keep the latency survey short and regular. A one-question weekly pulse ("How responsive was your editor this week?") catches regional network problems early.
Platform caveats
Apple Silicon (ARM64): local dev containers on M-series Macs run arm64 images natively and fast; cloud workspaces are usually x86_64. Multi-arch images keep the two paths equivalent; see building multi-arch images locally with buildx.
macOS (local): bind-mount performance is the main local disadvantage for large repositories; measure local numbers after applying node_modules volume optimisations, or the comparison is unfair.
WSL2 (local): keep repositories in the Linux filesystem for local measurements;
/mnt/cpaths make local performance look far worse than it needs to be.
Rollback
Because both paths share one definition, rolling back a cloud rollout is a policy change, not an engineering project: change the onboarding documentation to the local path and delete idle workspaces.
#!/usr/bin/env bash
set -euo pipefail
gh codespace list --json name,lastUsedAt --jq '.[] | select(.lastUsedAt < (now - 604800 | todate)) | .name' \
| xargs -r -n1 gh codespace delete --force -c
Frequently Asked Questions
Are cloud workspaces always faster for onboarding?
Usually, when prebuilds are configured, because setup work happens before the new hire starts. Without prebuilds, a cloud workspace can take as long as a local setup, and the advantage mostly disappears.
How much latency is acceptable?
Round-trip times under about 50 ms feel local; up to around 100 ms is workable, especially with a desktop IDE connected over SSH; above that, typing in a browser editor becomes noticeably uncomfortable. Choose the workspace region closest to the team.
Do we lose anything by keeping both options?
Some maintenance effort: both paths must be tested. Using one devcontainer.json and a nightly check in each environment keeps that effort small and preserves an offline fallback.
What about security?
Cloud workspaces keep source off laptops and centralise revocation, which helps compliance. They also introduce shared prebuild images and forwarded ports that need policies. Neither option is secure by default; both need secret scoping and scanning.