The first thing you need to do is install Docker and Docker compose if you don’t have them already.
Docker requires a 64-bit operating system running kernel version 3.10 or higher.
- Check your current kernel version. Open a terminal and use
uname -rto display your kernel version:
# uname -r 3.10.0-229.el7.x86_64
- Run the Docker installation script.
# curl -sSL https://get.docker.com/ | sh
If you would like to use Docker as a non-root user, you should now consider adding your user to the
docker group with something like the following command (remember that you’ll have to log out and log back in for this to take effect):
# usermod -aG docker your-user
Docker Compose 1.6 or newer is required. Follow these steps to install it:
- Download the Docker Compose binary:
# curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- Grant execution permissions:
# chmod +x /usr/local/bin/docker-compose
If the command docker-compose fails after installation, check your path. You can also create a symbolic link to /usr/bin or any other directory in your path.
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
- Test the installation to ensure everything went properly:
$ docker-compose --version docker-compose version 1.23.1, build b02f1306
If you see
docker-compose: command not found it means that
/usr/local/bin is not in your
PATH, most Linux distributions have
PATH so you can create a symbolic link from
# ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose