portainer: Unable to connect to the Docker endpoint

Steps to reproduce the issue:

  1. run docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer
  2. Open url in browser http://ip:9000 and input password.

image console error image

Technical details:

  • Portainer version:
  • Portainer Docker image tag (latest/arm/windows…): portainer/portainer:latest
  • Target Docker version (the host/cluster you manage): Docker version 17.03.1-ce, build c6d412e
  • Target Swarm version (if applicable):
  • Platform (windows/linux): linux centos7
  • Browser: Chrome 57.0.2987.133 (64-bit)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 30 (13 by maintainers)

Commits related to this issue

Most upvoted comments

@kanbekotori I see you’re using CentOS 7, SELinux is probably enabled, could you try using the --privileged flag?

$ docker run -d -p 9000:9000 --privileged -v /var/run/docker.sock:/var/run/docker.sock --name portainer portainer/portainer

Ok, let’s try something.

  • Edit the file /usr/lib/systemd/system/docker.service
  • Replace the line ExecStart=/usr/bin/dockerd with ExecStart=/usr/bin/dockerd -H unix:///var/run/docker.sock
  • Restart Docker: systemctl restart docker

And try to redeploy Portainer with and without the --privileged flag.

I am running portainer in docker swarm and the host is centos where SELinux is enabled. Is there a workaround to get the privileged mode on or to get the docker endpoint work?