Skip to main content

Install Docker and Docker Compose

To install Docker-CE (Community Edition) and Docker Compose, you can open the terminal, or SSH into your host system, then use the command 

curl https://get.docker.com | sh

You'll be prompted to enter you super user password, then the install should commence.

NOTE: If you are using a system without sudo installed, you should install it, as this command seems to require it, even if you're logged in as root, which you really shouldn't be.

If you happen to be using a Linux version that isn't supported by this one-liner command, you can find instructions to install Docker-CE and Docker Compose for your distro with a quick web search.

Finally, let's add our user to the docker group. This will allow us to use the docker and docker compose commands without using sudo every time. Use the command:

sudo usermod -aG docker <username>

Where you'll replace <username> with your actual name / username.  In my case I would use

sudo usermod -aG docker brian

Now, you can either log out and back in to get the new group to take effect, or you can use the command:

newgrp && newgrp docker

which will allow you to act as part of the docker group temporarily until you can log out and back in later.