Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install Docker on Ubuntu 22.04 - DesignLinux

Nov 15 2022
designlinux 0 Comments
how-to-install-docker-on-ubuntu-22-04

Docker application is used to manage multiple application processes in container. Using docker you can build, test and deploy applications that can run anywhere as portable and self-sufficient containers. In this article described how to install Docker on Ubuntu 22.04 system.

Prerequisites#

Before you start install, you must have non-root user account with sudo privileges.

Installing Docker on Ubuntu#

Docker is available in the standard Ubuntu 22.04 repositories, but it may not always be the latest version. So we will install latest Docker package on Ubuntu system from the Docker’s repositories.

Follow the steps to install docker on Ubuntu 22.04.

Step 1 – Update Package Manager#

At first, update the package manager index list and upgrade the system to latest using below command:

sudo apt update && sudo apt upgrade

Step 2 – Install Dependencies#

Before process ahead we need to install dependencies which are required to enable Docker repository. Execute the command to install dependencies:

sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Step 3 – Import GPG Key#

Now Import the GPG key for repository using following curl command:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

After that, add Docker repository to your system’s software repository list by typing:

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Now Docker repository is enabled so update apt package manager index list again using below command:

sudo apt update

Step 4 – Install Docker#

Install latest version of Docker Community Edition using below:

sudo apt install docker-ce

Once the installation completed the service of docker will start automatically. You can check it by issuing below command:

sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2022-11-14 09:14:25 UTC; 42s ago
...

Step 5 – Check Version#

At the time of writing, the latest stable version of Docker is 20.10.20. You also can check the version of Docker using below command:

docker -v
Docker version 20.10.20

Executing docker command without sudo#

By default, Docker required sudo privileges to run. Add your user to docker group to run docker without sudo privileges. The docker group is created at the installation of docker CE package.

Run the below command to add your user to docker group:

sudo usermod -aG docker $USER

After that, Log out and log back in to apply membership.

Run the below command to verify that you have added docker group :

id -nG
tecnstuff sudo docker

How to Use Docker Command#

Below is the basic syntax for the docker command:

docker [option] [subcommand] [arguments]

You can get list of all docker subcommands by issuing below command:

docker

If you need any help about subcommand then you can use following command:

docker docker-subcommand --help

Upgrading Docker#

You can update docker new version when it is released. You just have to run below commands:

sudo apt update
sudo apt upgrade

Uninstalling Docker#

Uninstall process of Docker is same as any other packages installed using apt:

sudo apt purge docker-ce
sudo apt autoremove

Conclusion#

Congratulations! You learned how to install docker on Ubuntu 22.04 system. To learn more about Docker check out the official Docker documentation.

Feel free to leave a comment, if you have any question or suggestion.

Related

Tags: docker, ubuntu

How to Install Latest Python Version in Ubuntu

Prev Post

How to Install Docker Compose on Ubuntu 22.04

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 2
  • 82
  • 605,832

DesignLinux.com © All rights reserved

Go to mobile version