- Published on
simple installation of docker and docker compose on latest ubuntu 2023
- Authors
- Name
- Lahrasab Ramzan
- @lahrasab931
Docker Installation
Update the repository
sudo apt update
Install some dependencies
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
Add gpg key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add the repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Again update the repositorytory
sudo apt update
Now this command will install the docker
sudo apt-get install docker-ce docker-ce-cli containerd.io
Docker-Compose
Simply run this command it will install the latest version of docker-compose as of January 2023. You can replace the version by checking on their release page and replace the current version with the one included in the command.
sudo curl -L "https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Make it executable
sudo chmod +x /usr/local/bin/docker-compose
Verify the installation
# for docker run
docker --version
# for docker-compose run
docker-compose --version
Hope You liked this simple tutorial.