Getting Started with Crate on Docker Cloud

Docker Cloud is Docker's official platform for building, managing and deploying Docker containers across a variety of cloud providers and a provides features ideal for Development workflows. One of the best and most relevant features for Crate users is default support for overlay networking. Whilst Crate offers multiple options for Unicast host discovery, when multicast is unavailable, this default support is a positive.

Connect Cloud Providers

The first step is to connect the cloud hosting providers you would like to use with Docker Cloud. The current options are Amazon Web Services, Digital Ocean, Microsoft Azure, Softlayer and Packet.

Create Nodes

Visit the Nodes section of the dashboard and click the large green Launch your first Node button.

Give the cluster a name, select the details of your cloud provider and give the cluster a tag that we use to group and target services.

Nodes Section

After a couple of minutes, the cluster will be ready.

Cluster Ready

And here are the new instances on Digital Ocean (in my case).

New Instances

Create Services

Next we need to setup our services. Docker Cloud provide an amazing selection of configuration and management options through their UI, but by far the easiest and quickest method for getting a Crate cluster deployed is by using a 'Stack' file. This allows us to set some options that Crate needs to function correctly and then you can analyze the resulting services to see what Docker Cloud is capable of.

Click on the Stacks tab, then the green Create your first stack button. Give the Stack a name and add the following code:

  image: 'crate:latest'
  command: 'crate'
    - '4200:4200'
    - '4300:4300'
  image: 'crate:latest'
  command: 'crate'
  image: 'crate:latest'
  command: 'crate'

This creates three instances of Crate, all using the 'latest' tagged Docker image. One sets ports manually and the others use dynamic port allocation. Finally, we change the default publish_host. We do this because Docker Cloud has default support for Weave, which allows for seamless cross machine communication through its overlay network. However, Weave requires Crate to publish on a different interface to its default and this is how we accomplish this.

Click the green Create stack button and you will see a list of the resulting services not yet running.

Click the green Start button and after a few moments you will see our 3 node Crate cluster spread across containers and nodes. We have used Docker Cloud's default approach to load balancing (Emptiest Node) but there are many to choose from. As we are setting one set of ports manually, this will limit some of our potential deployment strategies.


Click the Endpoints tab to see the cluster URL and open the link ending in port 4200 under the Service endpoints section, adding /admin to access the Crate admin interface. You should see a 3 node cluster, indicated by the '3' in the top right of the window.


To double check what is happening, click the Nodes tab, you should see the two VMs, one with 1 container and 1 with 2.

Nodes Tab


The real potential in the Docker Cloud lies in its simple scalability through a user-friendly UI (and CLI) which pairs well with Crate, this has been a simple, 'getting started' example and we recommend you look further at Docker Cloud's documentation to explore its full potential.

Next Steps