Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Servers, nginx and Docker

ddev start stops because DDEV cannot reach a Docker provider

Your error

Could not connect to a Docker provider. Please start or install a Docker provider.3 more lines it can show

Fix it fast

Most common cause, 1 of 4

No Docker provider is running, or none is installed

On macOS or Windows, launch your provider from the applications menu and give it time to finish starting.

Fix
# Linux / WSL2
sudo systemctl enable --now docker
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

Could not connect to a Docker provider (DDEV 1.24 and older) or Could not connect to Docker (DDEV 1.25) means DDEV got no answer from a Docker daemon. Start OrbStack, Docker Desktop or the Linux docker service, join the docker group instead of using sudo, pick the right context with docker context use and clear a stray DOCKER_HOST.

  • Applies to DDEV 1.25.5, DDEV 1.24, Docker Engine 29.10, Ubuntu 24.04, macOS
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Ask the plain docker client the same question DDEV asks. The reply of docker ps, together with the context list, separates the four causes below.

Run this first
docker ps
docker context ls
env | grep -E '^DOCKER_(HOST|CONTEXT)='

Then find the line you see in this list and open its fix:

  1. 1No Docker provider is running, or none is installeddocker ps answers Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  2. 2Your Linux user is not in the docker group, so sudo looks like the way outdocker ps says permission denied while trying to connect to the docker API, and sudo ddev start is refused with the root privileges message
  3. 3The Docker client is pointed at another provider's contextdocker ps fails with unable to resolve docker endpoint: context "docker-desktop": context not found, or a context in docker context ls belongs to a provider you removed
  4. 4DOCKER_HOST or DOCKER_CONTEXT in your shell overrides the contextThe env check in the first step prints a DOCKER_HOST or DOCKER_CONTEXT line, for example an address such as tcp://host:2375 that no longer answers

What does the error look like?

  • Could not connect to a Docker provider. Please start or install a Docker provider.
  • Could not connect to Docker. Please ensure Docker is installed and running.
  • DDEV is not designed to be run with root privileges, please run as normal user and without sudo
  • permission denied while trying to connect to the docker API at unix:///var/run/docker.sock

Cause 1 of 4

No Docker provider is running, or none is installed

You seedocker ps answers Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Check

DDEV's Could not connect message with a docker ps that cannot reach the daemon means the provider itself is down or missing. DDEV's Docker troubleshooting notes say this reply often means Docker is not installed or its daemon has not started, and that DDEV needs a provider such as OrbStack, Docker Desktop, Rancher Desktop or Docker Engine first.

Check
docker version
systemctl is-active docker   # Linux and WSL2 only

Fix

On macOS or Windows, launch your provider from the applications menu and give it time to finish starting. On Linux or WSL2, start the Docker service and enable it for later boots.

Fix
# Linux / WSL2
sudo systemctl enable --now docker

Verify

docker ps prints a table header, and ddev start gets past the Docker check.

Verify
docker ps
ddev start

Confirmed by docs.ddev.com

Did this fix it?

Cause 2 of 4

Your Linux user is not in the docker group, so sudo looks like the way out

You seedocker ps says permission denied while trying to connect to the docker API, and sudo ddev start is refused with the root privileges message

Check

A DDEV connection error paired with permission denied on /var/run/docker.sock means the daemon runs but your account may not use its socket. DDEV's docs name group membership as the reason, and DDEV's own code exits when it runs as root, so sudo is not an option.

Check
id -nG | tr ' ' '\n' | grep -x docker || echo 'not in the docker group'

Fix

Add your account to the docker group, then open a shell that has the new group. sg docker gives you one at once; logging out and back in applies it to the whole session (in WSL2, open a new terminal).

Fix
sudo groupadd -f docker && sudo usermod -aG docker "$USER"
sg docker

Verify

As your normal user, without sudo, both commands work.

Verify
docker run hello-world
ddev start

Confirmed by docs.ddev.com

Did this fix it?

Cause 3 of 4

The Docker client is pointed at another provider's context

You seedocker ps fails with unable to resolve docker endpoint: context "docker-desktop": context not found, or a context in docker context ls belongs to a provider you removed

Check

DDEV failing right after a switch between Docker providers points to a stale Docker context, the setting that tells the client which daemon to call. DDEV's docs list context-not-found and error during connect replies as context problems, and note that Colima switches to its own context when it starts.

Check
docker context show

Fix

Select the context of the provider you actually run. default is the local socket; Colima and some other providers create a context under their own name.

Fix
docker context ls
docker context use default

Verify

docker context show prints the context you picked, and docker ps answers without an error.

Verify
docker context show
docker ps

Confirmed by docs.ddev.com

Did this fix it?

Cause 4 of 4

DOCKER_HOST or DOCKER_CONTEXT in your shell overrides the context

You seeThe env check in the first step prints a DOCKER_HOST or DOCKER_CONTEXT line, for example an address such as tcp://host:2375 that no longer answers

Check

DDEV cannot connect when an environment variable sends the client to an address with no daemon behind it. Docker's context docs say DOCKER_HOST and DOCKER_CONTEXT win over the context chosen with docker context use, and DDEV's troubleshooting page tells you to look for them in ~/.bashrc and ~/.zshrc.

Check
grep -n -E 'DOCKER_(HOST|CONTEXT)' ~/.bashrc ~/.zshrc ~/.profile 2>/dev/null

Fix

Remove the export lines from your shell profile, then clear the variables in the current shell.

Fix
unset DOCKER_HOST DOCKER_CONTEXT

Verify

A new terminal shows no DOCKER_ variables, and ddev start runs.

Verify
env | grep '^DOCKER_' || echo 'none set'
ddev start

Confirmed by docs.docker.com

Did this fix it?

How do I stop it coming back?

  • Keep a single Docker provider running on a machine, and run docker context show after installing or removing one.
  • Set up the docker group once on Linux and never prefix ddev with sudo.
  • Leave DOCKER_HOST out of shell profiles; pass it on the command line for the rare remote engine.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: TaxiDex, Dispatch Pro.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.