I am unable to connect a second manager node to my Swarm when using an http proxy


When I try to connect a second manager node to my Docker Swarm when using an HTTP proxy I get the following error:

Does this machine require a proxy to access the Internet? (y/N) y
Enter desired HTTP proxy address:
The installer will use the proxy at ''
Joining the swarm
Error response from daemon: manager stopped: can't initialize raft node: rpc error: code = Unavailable desc = grpc: the connection is unavailable
Failed to join the swarm cluster.
It may be possible to re-run this installer with the flags -swarm-advertise-addr and -swarm-listen-addr to resolve the problem.


Docker must be configured not to use the HTTP proxy for all managers when connecting via internal IP addresses. To fix this you must add the advertise addresses of all Swarm managers to each manager’s NO_PROXY variable.

The /swarm-init and /swarm-join scripts scripts can be run with the additional-no-proxy flag set to a comma-delimited list of all manager IP addresses in the Swarm.

For example:

curl -sSL https://get.replicated.com/swarm-init | sudo bash -s \
    http-proxy= \


curl -sSL https://get.replicated.com/swarm-join | sudo bash -s \
    swarm-master-address= \
    swarm-token=[redacted] \
    daemon-registry-address= \
    ca=[redacted] \
    http-proxy= \

Additional managers can be added later by manually editing the Docker NO_PROXY environment variable and restarting the Docker service.

You can change this by editing the file /etc/systemd/system/docker.service.d/http-proxy.conf. You will then need to reload the systemd service configuration (systemctl daemon-reload) and restart the Docker service (systemctl restart docker). More information can be found here on configuring the Docker service.