Or copy link
Copy link
Docker on Ubuntu is an open-source platform facilitating the development, deployment, and execution of applications in lightweight, portable containers. These containers include all essential components for an application to run, ensuring a consistent environment across different systems. This makes it easier to manage and scale applications seamlessly throughout the software development lifecycle. Interested? Let’s take a look at all of the steps you’ll need to perform to install Docker on Ubuntu 22.04.
If you want a more detailed intro to the world of docker, you can explore the official website. It contains comprehensive documentation to help everyone get started. This guide will help you install Docker yourself, so make sure that you have the prerequisites addressed. And if you require any assistance at any step, feel free to contact us to get assistance. Let’s get started, shall we?
Before we get started with the installation, make sure that you have the following:
Read also Setting up a Docker Instance on Your CentOS VPS
Before diving into Docker installation, it’s crucial to ensure your system is up-to-date. Execute the following command:
$sudo apt update && sudo apt upgrade -y
It will help by refreshing the package list and then upgrades the installed packages. This preemptive update minimizes the risk of conflicts during Docker installation on Ubuntu, ensuring a smoother process and optimal compatibility with your system. Taking this step helps maintain a secure and stable environment, setting the stage for a trouble-free Docker installation experience.
After this process completes, you’ll need to install some packages.
If you want more control over the installation process, you can install docker from the official docker repository.
We need to install some packages using apt over HTTPS. Run the following:
$sudo apt install apt-transport-https ca-certificates curl software-properties-common
Now import the GPG key to ensure the authenticity of the package:
$curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
After this import the repository:
$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
After successfully importing the and the repository and the key, make sure to run the update in order to include it in your list.
$sudo apt update
Once the repository is imported, make sure that you are proceeding with the installation from the official Docker repo rather than the default Ubuntu repo. Run this to confirm:
$apt-cache policy docker-ce
With the output, you will see that “docker-ce” is not installed. With all of these steps complete, you are now ready to start installing docker.
Unleash the power of Ubuntu VPS
Get the reliability of the world’s most popular Linux distro and the flexibility of a virtual server. Enjoy blazing-fast speeds and low latency.
If you haven’t seen an error up to this point, you can start docker installation on Ubuntu by running the following:
$sudo apt install docker-ce
After the installation completes, you will have the daemon started and the process enabled to start on boot. You can run the following to make sure that it is running:
$sudo systemctl status docker
You will see a similar output. It means that you have been successful in the whole process.
If you want a more streamlined process and don’t want the hassle of manually updating Docker every time, you can install it from the default repository. After the update process, just run the following:
$sudo apt install docker.io -y
Upon completion of the process, you can confirm the successful installation of Docker by checking its version. In this instance, we’ve verified the installation of Docker version 24.0.5. It’s important to note that while this version may not be the latest, as of the time of writing this post, it remains the most recent version available in the Ubuntu repository.
Run the following to make sure that docker is active and running:
You’ll see the active status in the output. Let’s run a simple “Hello World” to confirm that Docker is correctly installed and working.
$sudo docker run hello-world
Installing Docker on Ubuntu 22.04 opens up a world of efficient and scalable application deployment. Through the two methods discussed—utilizing the Docker repository for the latest version or the default repository for a stable release—you now have the flexibility to choose the approach that best suits your needs.
Whether you opt for bleeding-edge features or prioritize stability, Docker empowers you to streamline your development process and enhance application management. By following the steps outlined in this guide, you’ve equipped yourself with the knowledge to harness the power of Docker and elevate your software development experience on Ultahost’s Linux VPS platform. Happy containerizing!
Docker is a platform that enables developers to automate the deployment of applications inside lightweight, portable containers. Containers can run on any machine that has Docker installed, making it easy to deploy and scale applications.
You can install docker by running sudo apt install docker-ce on the terminal.
You can check the Docker version by running docker –version
To run Docker commands without using sudo, you can add your user to the docker group. Run the command sudo usermod -aG docker $USER. Replace USER with your username.
docker
Migrating your WordPress site from a local development ...
Git is an important tool on Ubuntu for both development...
Apache Spark offers a powerful open-source framework sp...
Linux gaming is exploding in popularity, and Steam is l...
Puppet is a popular open-source configuration managemen...
Ruby is a dynamic, interpreted programming language ren...
Save my name, email, and website in this browser for the next time I comment.
Δ