create — Create a discovery token

You are viewing docs for legacy standalone Swarm. These topics describe standalone Docker Swarm. In Docker 1.12 and higher, Swarm mode is integrated with Docker Engine. Most users should use integrated Swarm mode — a good place to start is Getting started with swarm mode, Swarm mode CLI commands, and the Get started with Docker walkthrough). Standalone Docker Swarm is not integrated into the Docker Engine API and CLI commands.

Estimated reading time: 1 minute

The create command uses Docker Hub’s hosted discovery backend to create a unique discovery token for your cluster. For example:

$ docker run --rm  swarm create

Later, when you use manage or join to create Swarm managers and nodes, you use the discovery token in the <discovery> argument. For instance, token://86222732d62b6868d441d430aee4f055. The discovery backend registers each new Swarm manager and node that uses the token as a member of your cluster.

Some documentation also refers to the discovery token as a cluster_id.

Warning: Docker Hub’s hosted discovery backend is not recommended for production use. It’s intended only for testing/development.

For more information and examples about this and other discovery backends, see the Docker Swarm Discovery topic.

swarm, create