0

I am installing Drupal on Linux(Ubuntu 20.04) using ddev. ddev requires docker installed and in Ubuntu, I can connect with docker using sudo. If I want to check for the running container I will use the command.

sudo docker ps

But when I run this command to configure the local environment using ddev. I got this error. The error tells that ddev unable to connect with docker provider.

ddev config --docroot web --project-name my-site --project-type drupal10 --create-docroot

This error is given.

Could not connect to a docker provider. Please start or install a docker provider.

The solution to this issue is that I need to make the docker run without sudo. I have browsed this issue and found different solutions and tried them but none of them is working. These are the coammands I tried to solve the issue.

I tried to run the ddev command using sudo this got this error.

sudo ddev config --docroot web --project-name my-site --project-type drupal10 --create-docroot

WARN[0000] not reading global config file because running with root privileges Not populating custom commands or hostadditions because running with root privileges ddev is not designed to be run with root privileges, please run as normal user and without sudo

sudo groupadd docker

sudo usermod -aG docker $(whoami)

sudo service docker start

But this has not solved the issue. I have followed this link for the solution but that also has not worked. Docker can't connect to docker daemon

How do I solve the problem?

enstazao
  • 121
  • 1
  • 8
  • You need to log out and back in for group membership to be effective. Check with `groups` and make sure that `docker` appears in the list of your assigned groups. – Grobu Jul 12 '23 at 04:31
  • restarting the system solved the issue. – enstazao Jul 13 '23 at 05:35

1 Answers1

1

The normal reason for this is that you haven't done the post-install activities required for docker. If sudo docker ps works, but docker ps fails, that's what's going on.

As it says in the DDEV docs don't forget the post-installation steps for linux.

Normally all you have to do is sudo usermod -aG docker $USER and then reboot.

@grobu gave you the answer in a comment.

rfay
  • 9,963
  • 1
  • 47
  • 89