
To install Docker on Ubuntu, you need to follow these steps:
1. Update the package manager index:
sudo apt update
2. Install the dependencies required to add a new repository:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
3. Add the GPG key for the official Docker repository to your system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
4. Add the Docker repository to APT sources:
sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”
5. Update the package manager index again:
sudo apt update
6. Install Docker:
sudo apt install docker-ce
7. Verify that Docker is installed correctly by running the following command:
sudo docker run hello-world
This should download and run a test image, and display a message similar to “Hello from Docker! This message shows that your installation appears to be working correctly.”
If you want to use Docker as a non-root user, you should add your user to the “docker” group:
sudo usermod -aG docker $USER
You will need to log out and log back in for the changes to take effect.
I hope this helps! Let me know if you have any questions.
LinkedIn: Sails Software Solutions