<\/span><\/h2>\n\n\n\nThe docker repository, by default, is not included in the official repository of Ubuntu 22.04. First, we will add the key, then the repo.<\/p>\n\n\n\n
To add the GPGK key:<\/p>\n\n\n\n
curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add -<\/pre>\n\n\n\nOnce the GPGK key is added, we can proceed to add the repo:<\/p>\n\n\n\n
sudo add-apt-repository \"deb [arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu focal stable\"<\/pre>\n\n\n\n<\/span>Step 4. Install Docker<\/span><\/h2>\n\n\n\nOnce the key and repo are added, we can install Docker with the following commands:<\/p>\n\n\n\n
sudo apt-get install docker-ce docker-ce-cli containerd.io -y<\/pre>\n\n\n\nAfter successful installation, start and enable the docker service:<\/p>\n\n\n\n
sudo systemctl enable docker && sudo systemctl start docker<\/pre>\n\n\n\nTo check the status of the service, execute the following command:<\/p>\n\n\n\n
sudo systemctl status docker<\/pre>\n\n\n\nYou should receive the following output:<\/p>\n\n\n\n
root@host:~# sudo systemctl status docker\n\u25cf docker.service - Docker Application Container Engine\n Loaded: loaded (\/lib\/systemd\/system\/docker.service; enabled; vendor preset: enabled)\n Active: active (running) since Thu 2023-02-09 03:02:24 CST; 10s ago\nTriggeredBy: \u25cf docker.socket\n Docs: https:\/\/docs.docker.com\n Main PID: 2361 (dockerd)\n Tasks: 9\n Memory: 26.2M\n CPU: 780ms\n CGroup: \/system.slice\/docker.service\n \u2514\u25002361 \/usr\/bin\/dockerd -H fd:\/\/ --containerd=\/run\/containerd\/containerd.sock\n<\/pre>\n\n\n\nDocker service is not running on a specific port, but if you want to check the process, you can execute the following command:<\/p>\n\n\n\n
ps aux | grep docker<\/pre>\n\n\n\nYou will receive the following output:<\/p>\n\n\n\n
root@host:~# ps aux | grep docker\nroot 2361 0.0 1.8 1390760 72376 ? Ssl 03:02 0:00 \/usr\/bin\/dockerd -H fd:\/\/ --containerd=\/run\/containerd\/containerd.sock\nroot 2792 0.0 0.0 9076 2324 pts\/0 S+ 03:42 0:00 grep docker\n<\/pre>\n\n\n\n