To install Docker on Ubuntu 24.04

Docker is a containerization platform that allows developers to build, deploy, and run applications in isolated containers. In this guide, we'll walk through the process of installing Docker on Ubuntu 24.04.

Step 1: Update the System

Before installing Docker, it's recommended to update your system's packages. Open a terminal and run the following commands:

bash
sudo apt update && sudo apt upgrade -y

Step 2: Install Required Packages

To install Docker, you'll need some packages that ensure Docker operates correctly. Run the following command to install these packages:

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

Step 3: Add Docker Repository

Next, add Docker's official repository. First, add the GPG key for the repository:

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

Then, add Docker's repository to your APT sources:

bash
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

Step 4: Install Docker

With the Docker repository added, update your package list and install Docker:

bash
sudo apt update && sudo apt install docker-ce docker-ce-cli containerd.io -y

Step 5: Verify Docker Installation

After installing Docker, ensure that it is installed and running properly:

bash
sudo systemctl status docker

You should see output indicating that the Docker service is active and running.

Step 6: Add User to Docker Group

To run Docker commands without sudo, add your user to the Docker group:

bash
sudo usermod -aG docker $USER

To apply the changes, either log out and log back in, or run:

bash
newgrp docker

Step 7: Test Docker

Now, check if Docker is working correctly by running a test container:

bash
docker run hello-world

If the installation was successful, you will see a message from Docker confirming that it is working correctly.

Congratulations! You've successfully installed Docker on your Ubuntu 24.04 server. You can now use Docker for containerization and deploying your applications. If you encounter any issues or have questions, the Docker official documentation and community are always available to help.

  • docker, ubuntu, vps
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Корпоративная почта на базе собственного домена

Корпоративная почта на собственном домене не только придаёт профессиональный...

Установка и настройка Rclone

Rclone — это мощный инструмент командной строки для управления файлами на облачных хранилищах....

Apache vs Nginx: what’s the difference, how to Install, and which one to choose?

When choosing a web server for your project, Apache and Nginx often come into focus. Both of...

HTTP Errors: common causes and how to fix them

Error 403: ForbiddenDescription: The server understands the request but refuses to fulfill it....

Let's Encrypt without a control panel

Let's Encrypt SSL Certificates: How to Install and Set Up Free Automated Encryption Let's...

Powered by WHMCompleteSolution