We may not have the course you’re looking for. If you enquire or give us a call on 800600725 and speak to our training experts, we may still be able to help with your training requirements.
Training Outcomes Within Your Budget!
We ensure quality, budget-alignment, and timely delivery by our expert instructors.
Containerisation has become a fundamental concept in modern Software Development and deployment. Docker, a popular Containerisation platform, allows developers to package applications along with their dependencies into Containers, making it easier to deploy and run them across different environments consistently. In this blog, we will walk you through on how to Install Docker on Linux machines and setting up a basic Docker environment. Read more to find out!
Table of Contents
1) What is the Docker platform?
2) Usage of Docker
3) Prerequisites to Install Docker on Linux
4) Steps on how to Install Docker on Linux
5) Docker version
6) Docker information
7) Conclusion
What is the Docker platform?
Docker allows applications to be packaged and run in isolated Containers. This segregation and security enable you to run multiple containers concurrently on the specified host. You can easily share Docker images during your work, ensuring that anyone you share them with receives a similar Container that functions similarly. Docker offers a platform and tooling infrastructure to manage the lifecycle of your Container.
Usage of Docker
The following are the usage of Docker:
Fast application delivery
1) Docker streamlines the development lifecycle by enabling developers to work in standardised environments with local Containers.
2) Local Containers provide the services and applications for continuous delivery and integration workflows.
Responsive scaling and deployment
1) Docker's Container-based platform allows for highly efficient workloads running on local laptops, cloud providers, virtual or physical machines, or a combination of developer environments.
2) Docker's lightweight and portable nature facilitates dynamic workload maintenance, making it easy to scale up or tear down services and applications based on business requirements.
Running multiple workloads on similar hardware
1) Docker is fast, lightweight, and cost-effective, serving as a practical alternative to hypervisor-based Virtual Machines.
2) This enables the utilisation of more server capacity to achieve business objectives, making Docker suitable for high-density platforms and efficient in medium and small deployments requiring optimal resource usage.
Interested to gain deeper knowledge about docker, refer to our blog on "Podman vs Docker"
Prerequisites to Install Docker on Linux
Before you dive into the exciting world of Docker and its Containerisation magic, there are a few essential prerequisites you need to have in place. These prerequisites will guarantee a smooth and successful installation of Docker on your Linux system, enabling you to start deploying and managing Containers effortlessly. Let's explore the prerequisites in detail:
a) Linux Operating System: Make sure you have a Linux OS installed on your machine, such as Ubuntu, Debian, CentOS, or Fedora. Docker is fully compatible with various Linux distributions.
b) Administrative access or sudo privileges: To install Docker and its dependencies, you'll need administrative access or a user account with sudo privileges.
c) Internet connectivity: Ensure your system is connected to the internet, as Docker installation requires downloading packages and dependencies.
d) Disk space availability: Docker needs enough free disk space to store containers and images effectively.
e) CPU and memory requirements: Check that your system meets the minimum CPU and memory requirements for running Docker smoothly.
f) Package manager: Have your Linux distribution's package manager installed and updated to the latest version (e.g., apt, yum, or dnf).
g) Firewall configuration: If you have a firewall enabled, make sure it allows traffic on the necessary Docker ports.
h) SELinux configuration (optional): On SELinux-enabled distributions like CentOS or Fedora, consider adjusting settings to work harmoniously with Docker.
Unlock the potential of Containerisation with our Certified DevOps Professional (CDOP) Course today!
Steps on how to Install Docker on Linux
This section of the blog will give you a step-by-step guide on how you should Install Docker on Linux.
Update system packages
Keeping your system up-to-date is a fundamental aspect of any installation process. Before proceeding with Docker installation on Linux, we recommend updating your system packages. This will ensure that you have the latest software versions and security patches. Open your terminal and execute the following commands:
sudo apt update
sudo apt upgrade
The first command updates the package lists, and the second command upgrades the installed packages to their latest versions.
Install dependencies
Docker relies on several essential dependencies to function correctly. Let's install these prerequisites on your Linux system using the package manager. Execute the following command:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
These dependencies enable secure communication and allow Docker to interact with other components effectively.
Add Docker repository
To obtain the latest version of Docker, you will be required to add the Docker repository to your system. Don't worry; it's a simple process. Use the following command to add the repository:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
sudo add-apt-repository "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
By adding the Docker repository, you ensure that you get access to the most recent and stable Docker packages for your Linux distribution.
Install Docker engine
Now comes the exciting part—installing the Docker engine itself. This is the core component that powers Docker and allows you to manage containers on your system. Run the following command to install Docker:
sudo apt update
sudo apt install docker-ce
Once the installation process is complete, you'll have the Docker engine up and ready to work its magic!
Enhance your DevOps practices with our ITSM For DevOps Training. Sign up today!
Start and enable Docker
Congratulations! Docker is now installed on your system. However, it's not running just yet. You need to start the Docker service and enable it to launch automatically on system boot. Execute the following commands:
sudo systemctl start docker
sudo systemctl enable docker
Starting the Docker service ensures that you can immediately begin working with Containers, while enabling it on boot guarantees that Docker is always available whenever you power on your machine.
Verify Docker installation
It's essential to verify that Docker is installed and functioning correctly. The easiest way to do this is by running a simple "Hello World" container. Execute the following command in your terminal:
sudo docker run hello-world
If everything is set up correctly, you'll receive a friendly greeting from Docker, indicating that your installation is successful.
Managing Docker as a non-root user
By default, Docker commands require root privileges, which can be inconvenient and less secure. To manage Docker as a non-root user, you can add your user to the "docker" group. This will help you execute Docker commands without using "sudo" every time. Use the following command:
sudo usermod -aG docker $USER
Remember to log out and log back in or restart your system for the group changes to take effect.
Installing Docker Compose (optional)
Learn how to seamlessly install Docker on Linux with this comprehensive guide. From initial setup to advanced configurations, explore Docker Compose integration for streamlined container management. Master the essential steps for efficient deployment. While it's optional, Docker Compose can be immensely helpful for complex setups. If you wish to install Docker Compose, use the following commands:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Once installed, you can create and manage Multi-Container applications effortlessly using Docker Compose.
Docker version
To check your Docker version, open a command prompt or terminal window and enter the following command:
docker version
This command will display detailed information about the Docker installation on your system, including the client and server versions.
Docker information
To gather comprehensive information about your Docker installation, you can use the following command:
docker info
Copy code docker info executing this command in the command prompt or terminal will provide an overview of Docker's configuration details, including containers, images, storage drivers, and more. It offers a detailed snapshot of your Docker environment.
Conclusion
You have reached the end of this easy blog on what you need to do to Install Docker on Linux. Congratulations on setting up Docker and unlocking its vast potential for your Software Development journey. With Docker, you'll experience enhanced portability, scalability, and efficiency in deploying applications. Embrace the world of Containerisation, and let Docker revolutionise the way you develop and deploy software!
Take your DevOps skills to the next level – explore our Certified DevOps Security Professional (CDSOP) course today!
Frequently Asked Questions
Docker Desktop for Linux offers an intuitive graphical interface that streamlines the administration of containers and services. It incorporates Docker Engine as the fundamental technology driving Docker containers. Docker Desktop for Linux includes supplementary features such as Docker Scout and Docker Extensions.
When you Install Docker on Linux, the Docker components are typically installed in the /usr/bin directory. The main Docker binary, which is the Docker daemon, is usually located at /usr/bin/docker. Other related binaries and components may be installed in the same directory or in subdirectories under /usr.
It's important to note that the specific installation path may vary slightly depending on the Linux distribution and the installation method used. The default location for Docker binaries on many Linux systems is within the /usr/bin directory.
The Knowledge Academy takes global learning to new heights, offering over 30,000 online courses across 490+ locations in 220 countries. This expansive reach ensures accessibility and convenience for learners worldwide.
Alongside our diverse Online Course Catalogue, encompassing 17 major categories, we go the extra mile by providing a plethora of free educational Online Resources like News updates, blogs, videos, webinars, and interview questions. Tailoring learning experiences further, professionals can maximise value with customisable Course Bundles of TKA.
Explore DevOps Courses with The Knowledge Academy, where more courses await, including Kuberflow Training, Pupper Training, and Docker Course. Tailored for various skill levels, these courses offer in-depth insights into DevOps methodologies.
Dive into our Programming & DevOps blogs, a trove of resources covering PRINCE2 topics. Whether you are a beginner or aiming to enhance your Project Management skills, The Knowledge Academy's diverse courses and insightful blogs are your go-to source.
Upcoming Programming & DevOps Resources Batches & Dates
Date
Fri 6th Dec 2024
Fri 14th Feb 2025
Fri 11th Apr 2025
Fri 13th Jun 2025
Fri 15th Aug 2025
Fri 10th Oct 2025
Fri 12th Dec 2025