Your laptop and your production-like environment rarely match. VS Code's remote development lets the editor UI run locally while the language servers, terminal, and extensions execute where the code actually lives.
Three flavors of remote
All three share the same model: a lightweight server runs on the remote side and your local VS Code connects to it.
Remote - SSH Work on any machine you can SSH into
Dev Containers Work inside a Docker container
WSL Work inside a Linux distro on WindowsReproducible dev containers
A devcontainer.json describes a complete, disposable development environment.
Anyone who opens the repo gets the exact same toolchain.
{
"name": "spring-service",
"image": "mcr.microsoft.com/devcontainers/java:21",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"forwardPorts": [8080],
"postCreateCommand": "./mvnw dependency:go-offline"
}Ports just work
forwardPorts tunnels a remote port to localhost, so a service running in the
container is reachable at http://localhost:8080 on your machine.
Takeaways
- The editor stays local while execution happens on the remote target.
- Dev containers make the whole toolchain reproducible and disposable.
forwardPortsbridges remote services to your local browser seamlessly.
Dev containers pair especially well with CI — the same image can build your code locally and on the pipeline, eliminating "works on my machine."