Support Online
Skip to main content

Installing Docker on Ubuntu 22.04 (CE)

Docker runs applications in isolated containers.
This structure provides fast installation, portability and low resource consumption.

In this guide, we will install Docker CE with the correct and up-to-date method.

What's in This Guide?

  • official Docker CE install for Ubuntu 22.04
  • Using Docker without sudo
  • Image and container management
  • Docker Hub logic
  • NVIDIA GPU supported Docker installation
  • Safety and permanence tips

🧠 Technical Summary

This guide covers installing Docker Community Edition on Ubuntu 22.04.
The official repository is used.
Scope; installation, authorization, image management and GPU integration.


🛠 Before You Begin

  • A server with Ubuntu 22.04 installed
  • User with authority sudo
  • Internet access
  • (Optional) NVIDIA GPU

1️⃣ Docker CE Installation

Ubuntu default repositories do not offer up-to-date Docker.
Therefore, Docker's official repository is used.

Update package list

sudo apt update

  • Install necessary helper packages

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

  • Add Docker GPG key

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

  • Define the Docker repository to the system

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

  • Install Docker CE

sudo apt update
sudo apt install docker-ce

  • Check service status

sudo systemctl status docker

If Docker is active, the installation is complete.

2️⃣ Using Docker Without Sudo (Recommended) Add the user to the Docker group to avoid constantly typing sudo.

bash

sudo usermod -aG docker $USER Refresh the session:

bash

su - $USER Check:

bash

groups 3️⃣ Docker Image and Container Usage Test the installation bash

docker run hello-world interactive terminal bash with Ubuntu image

docker run -it ubuntu This command opens an isolated Ubuntu environment.

List containers bash

docker ps docker ps -a 4️⃣ Docker Hub and Image Logic Docker Hub is the central repository where images are shared.

bash

docker search nginx docker pull nginx docker images These commands perform image search and download operations.

5️⃣ Container Management bash

docker start container_id docker stop container_id docker rm container_id When the container is deleted, the data in it is not permanent.

📌 Docker Volume is used for persistence.

6️⃣ 🚀 NVIDIA GPU Supported Docker (Optional) If your server has an NVIDIA GPU, Docker can provide GPU access.

Install the required package bash

sudo apt install nvidia-docker2 sudo systemctl restart docker GPU test command bash

docker run --gpus all nvidia/cuda:12.0-base nvidia-smi If the GPU is listed, the configuration is correct.

🔒 Security Tips Run containers without root if possible

Do not open unnecessary ports to the outside world

Use only trusted images

Update images regularly

❓ Frequently Asked Questions (FAQ) Is Docker a virtual machine? No. Uses the same core, much lighter.

Will data be lost when the container is deleted? Yes. Volume is required for permanence.

What causes permission denied error? The user is not in the Docker group.

Is Docker Hub mandatory? No. It is for image sharing only.

🎯 Conclusion With this guide, you have installed Docker CE on Ubuntu 22.04 correctly. Now you are ready for container-based projects.

⚡ You can safely run your Nginx, database or microservice projects on high-performance servers in GenixNode infrastructure.