Add a "Deploy to Docker Cloud" button

Estimated reading time: 2 minutes

The Deploy to Docker Cloud button allows developers to deploy stacks with one click in Docker Cloud as long as they are logged in. The button is intended to be added to files in public GitHub repositories, although it can be used anywhere else.

Note: You must be logged in to Docker Cloud for the button to work correctly. If you are not logged in, you’ll see a 404 error instead.

This is an example button to deploy our python quickstart:

The button redirects the user to the Launch new Stack wizard, with the stack definition already filled with the contents of any of the following files (which are fetched in the order shown) from the repository (taking into account branch and relative path):

  • docker-cloud.yml
  • docker-compose.yml
  • fig.yml

The user can still modify the stack definition before deployment.

Adding the ‘Deploy to Docker Cloud’ button in GitHub

You can simply add the following snippet to your file:

[![Deploy to Docker Cloud](](

Docker Cloud will detect the HTTP referer header and deploy the stack file found in the repository, branch and relative path where the source file is stored.

Adding the ‘Deploy to Docker Cloud’ button in Docker Hub

If the button is displayed on the Docker Hub, Docker Cloud cannot automatically detect the source GitHub repository, branch and path. In this case, edit the repository description and add the following code:

[![Deploy to Docker Cloud](](<repo_url>)

where <repo_url> is the path to your GitHub repository (see below).

Adding the ‘Deploy to Docker Cloud’ button anywhere else

If you want to use the button somewhere else (i.e. from external documentation, or a landing site), you just need to create a link to the following URL:<repo_url>

where <repo_url> is the path to your GitHub repository. For example:

  • to use branch staging instead of the default branch
  • to use branch master and the relative path /example inside the repository

You can use your own image for the link (or no image). Our Deploy to Docker Cloud image is available at the following URL:

chat icon Feedback? Suggestions? Can't find something in the docs?
Edit this page Request docs changes Get support
Rate this page: