How To Install Docker on Ubuntu 22.04 LTS

How To Install Docker on Ubuntu 22.04 LTS

Installing Docker on Ubuntu 22.04 LTS

UbuntuDocker

Requirements

  • A running instance of Ubuntu 22.04 LTS.
  • A user account with sudo privileges.

Steps to Install Docker

  1. Update Your System:
    • Open a terminal and update the package index:
      sudo apt update
      sudo apt upgrade -y
      
  2. Install Required Packages:
    • Install packages to allow apt to use a repository over HTTPS:
      sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
      
  3. Add Docker’s Official GPG Key:
    • Add the GPG key for the Docker repository:
      curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
      
  4. Add the Docker Repository:
    • 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 Index Again:
    • Refresh the package index to include the new Docker repository:
      sudo apt update
      
  6. Install Docker:
    • Install the latest version of Docker CE (Community Edition):
      sudo apt install docker-ce -y
      
  7. Start and Enable Docker:
    • Start the Docker service and enable it to run on startup:
      sudo systemctl start docker
      sudo systemctl enable docker
      
  8. Verify Docker Installation:
    • Check if Docker is installed correctly by running:
      sudo docker --version
      
    • You can also run the hello-world image to test Docker:
      sudo docker run hello-world
      
  9. Manage Docker as a Non-root User (Optional):
    • To run Docker commands without sudo, add your user to the Docker group:
      sudo usermod -aG docker $USER
      
    • Log out and back in for the changes to take effect.
  10. Check Docker Status:
    • Verify that Docker is running:
      sudo systemctl status docker
      

Conclusion

You have successfully installed Docker on Ubuntu 22.04 LTS. You can now start using Docker to manage containers and images. Ubuntu

NeeRoz M
NeeRoz M Author of Affiliates, a template available for WordPress, HTML, Ghost and Jekyll. You are currently previewing Jekyll template demo.
comments powered by Disqus