
In this tutorial, we are going to explain how to install Docker on Ubuntu 24.04 OS. Docker is an open-source platform for running, developing, and shipping applications. Docker delivers the software in packages called containers. The advantage of the docker containers is that the developer can reduce the delay between the production and testing environment. Also, the applications can work efficiently in isolation and different environments. The software that hosts the containers is called Docker Engine.
Installing Docker is a straightforward process and may take up to 10 minutes. Let’s get started!
Table of Contents
Prerequisites
- A server running Ubuntu 24.04 OS
- User privileges: root or non-root user with sudo privileges
Step 1. Update the System
Before we start with the installation we need to update the system packages to their latest versions available.
Step 2. Add Docker GPG key
First, we need to add the Docker GPG key to set up the repository later.
Step 3. Add Repository to APT sources
The next step is to add the docker repository to the advanced package tool sources. Execute the following command:
Once added, update the system.
Step 4. Install Docker
Now, when the GPG key and the docker repo are added, we can proceed with installing the docker packages with the command below:
Step 5. Manage Docker Service
After successful installation, we can enable the docker service to start on the system reboot automatically.
You should get the following output:
To check the status of the docker service execute the following command:
If the service is up and running you will get the following output:
To restart the Docker service you can use the following command:
To stop the Docker service you can use the command below:
Step 6. Create Docker Container
We have installed Docker and now let’s create the first Docker container. Since we are using Ubuntu 24.04 let’s make a Docker container with a Ubuntu image. In other words, it will be Ubuntu OS running inside of Ubuntu.
The container will be created and you will get the following output:
As you can see now the prompt is changed: root@55d468ed1b39:/#. This means we are already inside the Docker container with Ubuntu.
You can copy the number of the container 55d468ed1b39 and use it to start the container whenever you want. Press CTRL+D to exit from the docker container prompt.
Now the container is not running. To start it execute the following command:
To check whether the container is running you can use the following command:
You should get the following output:
To enter the Docker container you can use the command below:
The prompt will change to:
That’s it. You successfully learned how to install Docker on Ubuntu 24.04 and learned how to create and use the Docker container simple commands. Of course, you do not have to do this on your own. You only need to sign up for one of our NVMe VPS Ubuntu hosting plans and submit a support ticket. Our admins will help you with any aspect of the Docker installation and configuration on your server.
If you liked this post on how to install Docker on Ubuntu 24.04, please share it with your friends or leave a comment down below.