Best Way to Install Docker on Kali Linux
Tags: devops, opensource, docker, linux
Published: 2023-11-29 20:34:40


![output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1v6ivii3ea4dpra5xzla.jpg)

## INTRODUCTION
Are you finding it difficult to install Docker on your Linux machine? 
Docker is a powerful platform that enables developers to build, ship, and run applications in containers. Installing Docker on Kali can be tasking. Running docker Linux is a straightforward process, and in this guide, we'll walk you through each step, explaining the command line scripts along the way. Let's get started.

## PREREQUISITES
Before installing docker. it is important to get have the following prerequisites:
1. A kali Linux Machine (ensure it is up-to-date)
2. Access to the terminal with sudo privileges
3. Basic understanding of command line.

To install docker in your kali linux machine, follow these steps:

## Step 1: Update packages List
To start the installation of docker in your machine, it is important to update your package lists. To do this, open your terminal and run the following command to ensure that your package lists are updated:

```
sudo apt update
```
output:

![output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8mjbxg30udew5bs6s1uk.png)
## Step 2: Install Docker
Once the package lists are successfully installed, install Docker using the following command:

```
sudo apt install docker.io
```
output:

![output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9gtzbzza38mt1mtmo1zy.png)
## Step 3: Enable and Start Docker Services
Docker requires a service to be running in the background. This steps enables and start the docker service with the following commands:

```
sudo systemctl enable docker --now
```
output:

![output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ybxhwlmwrge1mhf8y612.png)
This command not only enables Docker to start on boot but also starts the service immediately.

## Step 4: Check Docker Service Status
To ensure docker is up and running, it is important to check the status. Use the following command:

```
sudo systemctl status docker
```
output:

![output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rbyd7oliaj3kvri4qnea.png)
This command provides detailed information about the Docker service, including its current status. Look for **Active** to confirm that Docker is running.

## Step 5: Add Your User to the Docker Group
This step is required to avoid `sudo` each time you want to use Docker, add your user to the Docker group:

```
sudo usermod -aG docker $USER
```
This step grants your user the necessary permissions to interact with the Docker daemon.

## Step 6: Restart Your System
To apply the changes made by adding your user to the Docker group, restart your system. You can do this by signing out and signing back in or using the command:

```
sudo reboot
```

## Step 7: Verify Docker Installation
Confirm that Docker is successfully installed by checking its version:

```
docker --version
```
output:

![output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ck15zhyk2lbmvpjixi7.png)
This command displays the installed Docker version, confirming that the installation was successful.

## CONCLUSION
Congratulations on successfully navigating through the installation of Docker on your Kali Linux machine! Docker brings a new level of flexibility and efficiency to your development and deployment workflows. With containers, you can ensure consistency across different environments, making your life as a developer much smoother. Feel free to explore Docker's vast capabilities and revolutionize the way you package and deploy applications.
Happy coding!