Manage the Docker environment where Portainer is running.
Ensure that you have started the Portainer container with the following Docker flag:
-v "/var/run/docker.sock:/var/run/docker.sock"
(Linux).
or
-v \\.\pipe\docker_engine:\\.\pipe\docker_engine
(Windows).