Troubleshooting dev containers
Dev container not starting
If your dev container fails to start:
-
Check the agent logs for error messages:
/tmp/coder-agent.log/tmp/coder-startup-script.log/tmp/coder-script-[script_id].log
-
Verify Docker is available in your workspace (see below).
-
Ensure the
devcontainer.jsonfile is valid JSON. -
Check that the repository has been cloned correctly.
-
Verify the resource limits in your workspace are sufficient.
Docker not available
Dev containers require Docker, either via a running daemon (Docker-in-Docker) or a mounted socket from the host. Your template determines which approach is used.
If using Docker-in-Docker, check that the daemon is running:
sudo service docker status
sudo service docker start # if not running
If using a mounted socket, verify the socket exists and is accessible:
ls -la /var/run/docker.sock
docker ps # test access
If you get permission errors, your user may need to be in the docker group.
Finding your dev container agent
Use coder show to list all agents in your workspace, including dev container
sub-agents:
coder show <workspace>
The agent name is derived from the workspace folder path. For details on how names are generated, see Agent naming.
SSH connection issues
If coder ssh <workspace>.<agent> fails:
-
Verify the agent name using
coder show <workspace>. -
Check that the dev container is running:
docker ps -
Check the workspace agent logs for container-related errors:
grep -i container /tmp/coder-agent.log
VS Code connection issues
VS Code connects to dev containers through the Coder extension. The extension uses the sub-agent information to route connections through the parent workspace agent to the dev container. If VS Code fails to connect:
- Ensure you have the latest Coder VS Code extension.
- Verify the dev container is running in the Coder dashboard.
- Check the parent workspace agent is healthy.
- Try restarting the dev container from the dashboard.
Dev container features not working
If features from your devcontainer.json aren't being applied:
-
Rebuild the container to ensure features are installed fresh.
-
Check the container build output for feature installation errors.
-
Verify the feature reference format is correct:
{ "features": { "ghcr.io/devcontainers/features/node:1": {} } }
Slow container startup
If your dev container takes a long time to start:
- Use a pre-built image instead of building from a Dockerfile. This avoids the image build step, though features and lifecycle scripts still run.
- Minimize features. Each feature executes as a separate Docker layer
during the image build, which is typically the slowest part. Changing
devcontainer.jsoninvalidates the layer cache, causing features to reinstall on rebuild. - Check lifecycle scripts. Commands in
postStartCommandrun on every container start. Commands inpostCreateCommandrun once per build, so they execute again after each rebuild.
Getting more help
If you continue to experience issues:
- Collect logs from
/tmp/coder-agent.log(both workspace and container). - Note the exact error messages.
- Check Coder GitHub issues for similar problems.
- Contact your Coder administrator for template-specific issues.


