Installing Docker and Docker Compose on Ubuntu

Basic steps and script to get Docker and Docker Compose up and running quickly

You may want to check out the step before this, Building a Linux Open-Source GIS Environment with Windows: Part 1 - WSL!

Installing Docker and Docker-Compose

Docker lets you run containers on your computer (or Subsystem in this case).

Docker-compose is a simple Docker orchestrator that’s great for small systems.

  1. Docker and digitalocean have put together some great information on this, and I could never do better, so I used their documents to put together a script:
  4. You can paste this into Terminal
export user=$(whoami)
sudo apt-get update
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \

curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update && sudo apt-get install \
    docker-ce \
    docker-ce-cli \

sudo usermod -aG docker ${USER}
# This step will ask you for your password again
su - ${USER}
# start docker (This is needed with WSL)
sudo service docker start
  1. Let’s install docker-compose
  2. Go here:
  3. Take note of the latest docker-compose version and enter it below, where I have “1.29.0”
      export DOCKERCOMPOSEVERSION=1.29.0
  4. You could also run this command to pull the latest version from github with the same result
      export DOCKERCOMPOSEVERSION=$(curl -s | perl -pe 's/^.+\/tag\/(.+?)">.+/\1/g')
  5. Install the latest docker-compose
    sudo curl -L "${DOCKERCOMPOSEVERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
  6. Verify your version by running this command
    docker-compose --version
  7. You now have Docker and docker-compose installed!