title: How do I run a docker swarm node on the same machine as the swarm manager?
body: <p>I have been following <a href="https://docs.docker.com/swarm/install-manual/">these instructions</a> to set up a docker swarm on my Ubuntu machine. I'd like to run some swarm nodes on the same machine that is running the swarm manager, but the status of the nodes are "Pending" with the error "Cannot connect to the docker engine endpoint". </p>
  
  <p>These are the commands I ran to set up the system: </p>
  
  <pre><code>docker run -d --name consul -p 8500:8500 progrium/consul -server -bootstrap
  docker run --name manager -d -p 4000:4000 swarm manage -H :4000 --advertise 192.168.1.18:4000  consul://192.168.1.18:8500
  docker run -d -p 6300:2375 swarm join --advertise=192.168.1.18:6300 consul://192.168.1.18:8500
  </code></pre>
  
  <p>One thing I noticed is that the node isn't bound to a port: </p>
  
  <pre><code>$ nmap localhost
  
  Starting Nmap 6.40 ( http://nmap.org ) at 2016-03-02 15:06 EST
  Nmap scan report for localhost (127.0.0.1)
  Host is up (0.00054s latency).
  Other addresses for localhost (not scanned): 127.0.0.1
  Not shown: 996 closed ports
  PORT     STATE SERVICE
  4000/tcp open  remoteanything
  8500/tcp open  fmtp
  </code></pre>
  
  <p>Here's the output from docker info:</p>
  
  <pre><code>$ docker -H :4000 info
  Containers: 0
   Running: 0
   Paused: 0
   Stopped: 0
  Images: 0
  Server Version: swarm/1.1.2
  Role: primary
  Strategy: spread
  Filters: health, port, dependency, affinity, constraint
  Nodes: 1
   (unknown): 192.168.1.18:6300
    └ Status: Pending
    └ Containers: 0
    └ Reserved CPUs: 0 / 0
    └ Reserved Memory: 0 B / 0 B
    └ Labels:
    └ Error: Cannot connect to the docker engine endpoint
    └ UpdatedAt: 2016-03-02T18:44:38Z
  Plugins:
   Volume:
   Network:
  Kernel Version: 4.2.0-30-generic
  Operating System: linux
  Architecture: amd64
  CPUs: 0
  Total Memory: 0 B
  Name: 739dc6a5c721
  </code></pre>
  
  <p>Any help would be greatly appreciated!</p>