# Download Portainer Agent Stack (Version 2.19.4)

curl -L https://downloads.portainer.io/ce2-19/portainer-agent-stack.yml -o portainer-agent-stack.yml

# Bugfix Docker Socket access

Update portainer-agent-stack.yml to add readonly access to docker socket by adding volume to portainer section this will automatically configure the 'local' environment.
vi portainer-agent-stack.yml

    volumes:
      - portainer_data:/data
      - /var/run/docker.sock:/var/run/docker.sock:ro

# Configure Docker Swarm environment, by agent

Update portainer-agent-stack.yml to add readonly access to docker socket by adding volume to portainer section

Give your environment configuration a unique name. ie docker_lab01
For the environment address (i ran this from the same node running portainer-portainer:

docker network inspect portainer_agent_network

Under "containers" section, get the IPv4Address, i.e. 10.10.5.5/24

The default environment address will be 10.10.5.5:9001

Click connect

# Example Screenshot


# [WARN] memberlist: Was able to connect to XXX but other probes failed, network may be misconfigured

Portainer agent logs contain "network may be misconfigured" and "agent container running in more than a single Docker network. This might cause communication issues | network_count=2 ". This looks like it can be ignored and is due the networks being in "ingress" and "portainer_agent_network".