Install Docker on Ubuntu
There are 2 ways to install Docker engine on Ubuntu, one is easy but the version not as updated. The other one is more complex but is the official way in docker.com
1. Easy Way (For older docker version)
Note the docker.io package name
sudo apt-get install docker.io
2. Hard Way (For latest docker version)
Follow this guide.
- Uninstall old versions
sudo apt-get remove docker docker-engine docker.io containerd runc
- Setup apt-repository for docker
- Install Docker engine
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io
- Verify that Docker engine is installed correctly
sudo docker run hello-world
Bonus – Install docker-compose
Follow this docker-compose guide.
- Download current stable release of Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- Apply executable permissions to the binary
sudo chmod +x /usr/local/bin/docker-compose
- Test installation
docker-compose --version