2015-06-07 22:59:58 +02:00
<!-- [metadata]>
+++
2016-01-24 21:03:44 +01:00
title = "Install Compose"
2015-06-07 22:59:58 +02:00
description = "How to install Docker Compose"
keywords = ["compose, orchestration, install, installation, docker, documentation"]
[menu.main]
2016-01-24 21:03:44 +01:00
parent="workw_compose"
weight=-90
2015-06-07 22:59:58 +02:00
+++
<![end-metadata]-->
2014-01-27 16:03:21 +01:00
2015-06-07 22:59:58 +02:00
# Install Docker Compose
2014-01-27 16:03:21 +01:00
2016-03-17 19:09:38 +01:00
You can run Compose on OS X, Windows and 64-bit Linux. To install it, you'll need to install Docker first.
2015-01-31 02:16:48 +01:00
2015-08-05 19:38:40 +02:00
To install Compose, do the following:
2015-01-31 02:16:48 +01:00
2016-02-05 00:46:41 +01:00
1. Install Docker Engine:
2015-01-31 02:16:48 +01:00
2016-03-17 19:10:32 +01:00
* < a href = "/engine/installation/mac/" target = "_blank" > Mac OS X installation</ a >
2016-03-17 19:09:38 +01:00
2016-03-17 19:10:32 +01:00
* < a href = "/engine/installation/windows/" target = "_blank" > Windows installation</ a >
2015-08-24 21:25:25 +02:00
2016-03-17 19:10:32 +01:00
* < a href = "/engine/installation/ubuntulinux/" target = "_blank" > Ubuntu installation</ a >
2015-08-24 21:25:25 +02:00
2016-03-17 19:10:32 +01:00
* < a href = "/engine/installation/" target = "_blank" > other system installations</ a >
2015-08-24 21:25:25 +02:00
2016-03-17 19:09:38 +01:00
2. The Docker Toolbox installation includes both Engine and Compose, so Mac and Windows users are done installing. Others should continue to the next step.
2015-08-24 21:25:25 +02:00
2015-09-02 06:11:43 +02:00
3. Go to the < a href = "https://github.com/docker/compose/releases" target = "_blank" > Compose repository release page on GitHub</ a > .
2015-10-29 17:52:00 +01:00
4. Follow the instructions from the release page and run the `curl` command,
which the release page specifies, in your terminal.
2014-01-27 16:03:21 +01:00
2015-09-02 06:11:43 +02:00
> Note: If you get a "Permission denied" error, your `/usr/local/bin` directory
probably isn't writable and you'll need to install Compose as the superuser. Run
`sudo -i` , then the two commands below, then `exit` .
2014-01-27 16:03:21 +01:00
2015-10-29 17:52:00 +01:00
The following is an example command illustrating the format:
2014-03-03 16:20:09 +01:00
2016-07-27 16:55:47 +02:00
curl -L https://github.com/docker/compose/releases/download/1.8.0-rc3/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
2015-08-24 21:25:25 +02:00
2015-07-26 01:47:36 +02:00
If you have problems installing with `curl` , see
[Alternative Install Options ](#alternative-install-options ).
2015-08-24 21:25:25 +02:00
2015-07-26 01:47:36 +02:00
5. Apply executable permissions to the binary:
2015-03-27 01:17:36 +01:00
2015-08-05 19:38:40 +02:00
$ chmod +x /usr/local/bin/docker-compose
2014-12-25 11:16:45 +01:00
2015-07-26 01:47:36 +02:00
6. Optionally, install [command completion ](completion.md ) for the
2015-08-05 19:38:40 +02:00
`bash` and `zsh` shell.
2015-07-28 16:31:18 +02:00
2015-07-26 01:47:36 +02:00
7. Test the installation.
2014-03-03 16:20:09 +01:00
2015-08-05 19:38:40 +02:00
$ docker-compose --version
2016-07-27 16:55:47 +02:00
docker-compose version: 1.8.0-rc3
2014-01-27 16:03:21 +01:00
2015-07-26 01:47:36 +02:00
## Alternative install options
### Install using pip
2015-10-08 17:10:51 +02:00
Compose can be installed from [pypi ](https://pypi.python.org/pypi/docker-compose )
using `pip` . If you install using `pip` it is highly recommended that you use a
[virtualenv ](https://virtualenv.pypa.io/en/latest/ ) because many operating systems
have python system packages that conflict with docker-compose dependencies. See
the [virtualenv tutorial ](http://docs.python-guide.org/en/latest/dev/virtualenvs/ )
to get started.
$ pip install docker-compose
2015-07-26 01:47:36 +02:00
2015-11-19 18:55:03 +01:00
> **Note:** pip version 6.0 or greater is required
2015-07-26 01:47:36 +02:00
### Install as a container
Compose can also be run inside a container, from a small bash script wrapper.
To install compose as a container run:
2016-07-27 16:55:47 +02:00
$ curl -L https://github.com/docker/compose/releases/download/1.8.0-rc3/run.sh > /usr/local/bin/docker-compose
2015-07-26 01:47:36 +02:00
$ chmod +x /usr/local/bin/docker-compose
2015-10-08 16:50:15 +02:00
## Master builds
If you're interested in trying out a pre-release build you can download a
binary from https://dl.bintray.com/docker-compose/master/. Pre-release
builds allow you to try out new features before they are released, but may
be less stable.
2015-07-26 01:47:36 +02:00
2015-08-05 19:38:40 +02:00
## Upgrading
2015-02-25 09:43:33 +01:00
2015-08-05 19:38:40 +02:00
If you're upgrading from Compose 1.2 or earlier, you'll need to remove or migrate
your existing containers after upgrading Compose. This is because, as of version
1.3, Compose uses Docker labels to keep track of containers, and so they need to
be recreated with labels added.
2015-06-15 19:46:01 +02:00
2015-08-05 19:38:40 +02:00
If Compose detects containers that were created without labels, it will refuse
to run so that you don't end up with two sets of them. If you want to keep using
your existing containers (for example, because they have data volumes you want
2015-11-27 18:02:13 +01:00
to preserve) you can use compose 1.5.x to migrate them with the following command:
2015-06-15 19:46:01 +02:00
2015-08-05 19:38:40 +02:00
$ docker-compose migrate-to-labels
2015-06-15 19:46:01 +02:00
2015-09-02 06:11:43 +02:00
Alternatively, if you're not worried about keeping them, you can remove them.
2015-08-05 19:38:40 +02:00
Compose will just create new ones.
2015-06-15 19:46:01 +02:00
2015-08-05 19:38:40 +02:00
$ docker rm -f -v myapp_web_1 myapp_db_1 ...
2015-06-15 19:46:01 +02:00
2015-06-30 18:21:36 +02:00
## Uninstallation
To uninstall Docker Compose if you installed using `curl` :
$ rm /usr/local/bin/docker-compose
To uninstall Docker Compose if you installed using `pip` :
$ pip uninstall docker-compose
2015-08-24 21:25:25 +02:00
2015-08-05 19:38:40 +02:00
>**Note**: If you get a "Permission denied" error using either of the above
>methods, you probably do not have the proper permissions to remove
>`docker-compose`. To force the removal, prepend `sudo` to either of the above
>commands and run again.
2015-06-30 18:21:36 +02:00
2015-08-05 19:38:40 +02:00
## Where to go next
2015-02-25 09:43:33 +01:00
2015-11-18 11:17:23 +01:00
- [User guide ](index.md )
2015-10-09 16:49:41 +02:00
- [Getting Started ](gettingstarted.md )
2015-05-12 13:44:43 +02:00
- [Get started with Django ](django.md )
- [Get started with Rails ](rails.md )
2015-09-16 17:01:43 +02:00
- [Get started with WordPress ](wordpress.md )
2015-10-13 13:01:19 +02:00
- [Command line reference ](./reference/index.md )
2015-10-13 21:23:27 +02:00
- [Compose file reference ](compose-file.md )