Create a new swarm on Amazon Web Services in Docker CloudEstimated reading time: 4 minutes
You can now create new Docker Swarms from within Docker Cloud as well as register existing swarms.
When you create a swarm, Docker Cloud connects to the Cloud provider on your behalf, and uses the provider’s APIs and a provider-specific template to launch Docker instances. The instances are then joined to a swarm and the swarm is configured using your input. When you access the swarm from Docker Cloud, the system forwards your commands directly to the Docker instances running in the swarm.
Link your service provider to Docker Cloud
To create a swarm, you need to give Docker Cloud permission to deploy swarm nodes on your behalf in your cloud services provider account.
If you haven’t yet linked Docker Cloud to AWS, follow the steps in Link Amazon Web Services to Docker Cloud. Once it’s linked, it will show up on the Swarms -> Create page as a connected service provider.
Create a swarm
If necessary, log in to Docker Cloud and switch to Swarm Mode
Click Swarms in the top navigation, then click Create.
Alternatively, you can select + -> Swarm from the top navigation to get to the same page.
Enter a name for the new swarm.
Your Docker ID is pre-populated. In the example, our swarm name is “vote-swarm”.
Tip: For Docker Cloud, use all lower case letters for swarm names. No spaces, capitalized letters, or special characters other than
-are allowed. AWS does not accept underscores in the name
Select Amazon Web Services as the service provider and select a channel (
Edge) from the drop-down menu.
In this example, we’ll use the
Select a Region from the drop-down menu.
Tip: The SSH keys available to you in the next steps are filtered by the region you select here. Make sure that you have appropriate SSH keys available on the region you select.
Optionally, click Region Advanced Settings to configure a Virtual Private Cloud(VPC) on which to run this swarm.
For guidance on setting up a VPC, see Recommended VPC and subnet setup in the Docker for AWS topics.
Choose how many swarm managers and swarm worker nodes to deploy.
Configure swarm properties.
Select a public SSH key for Docker Cloud to use to connect to the nodes on AWS. Public keys from the key pairs you configured on AWS are provided in the drop-down menu. Only keys associated with the Region you selected (in step 5) are shown.
Choose whether to provide daily resource cleanup.
Enabling this option helps to avoid charges for resources that you are no longer using. (See also, topics on resource cleanup in the AWS documentation.)
Enable or disable Cloudwatch for container logging.
Select the instance sizes for the managers, and for the workers.
In general, the larger your swarm, the larger the instance sizes you should use. See the Docker for AWS topics for more on resource configuration.
Docker for AWS bootstraps all of the recommended infrastructure to start using Docker on AWS automatically. You don’t need to worry about rolling your own instances, security groups, or load balancers when using Docker for AWS. (To learn more, see Why Docker for AWS.)
This will take a few minutes. When the swarm is ready, its indicator on the Swarms page will show steady green.
Note: At this time, you cannot add nodes to a swarm from within Docker Cloud. To add new nodes to an existing swarm, log in to your AWS account, and add nodes manually. (You can unregister or dissolve swarms directly from Docker Cloud.)
Where to go next
Learn how to connect to a swarm through Docker Cloud.
Learn how to register existing swarms.
You can get an overivew of topics on swarms in Docker Cloud.
To find out more about Docker swarm in general, see the Docker engine Swarm Mode overview.swarm mode, swarms, create swarm, Cloud, AWS