Docker Community Forums

Share and learn in the Docker community.

How to create overlay network on Ubuntu?

I tried this

docker network create --driver overlay new_network
Error response from daemon: This node is not a swarm manager. Use “docker swarm init” or “docker swarm join” to connect this node to swarm and try again.
If I go for swarm init

docker (docker-machine config swarm-manager-1) swarm init --advertise-addr (docker-machine ip swarm-manager-1)
Error response from daemon: This node is already part of a swarm. Use “docker swarm leave” to leave this swarm and join another one.

Swarm-manager-1 is running.

docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
dev - virtualbox Stopped Unknown
swarm-manager-1 - virtualbox Running tcp://192.168.99.103:2376 v18.09.5

How to create overlay network?
I am on ubuntu 18.04.

docker version
Client:
Version: 18.09.5
API version: 1.39
Go version: go1.10.8
Git commit: e8ff056
Built: Thu Apr 11 04:43:57 2019
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.5
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: e8ff056
Built: Thu Apr 11 04:10:53 2019
OS/Arch: linux/amd64
Experimental: false

The output you pasted indicats that the node is a swarm worker. As such it can neither join a swarm (as it already particpates in one), nor execute swarm specific commands.

Apply “docker swarm leave” on all of your nodes and initialize it on one node. Then take the ouput of swarm init and paste it on you other nodes to join the swarm as worker nodes.