How to Install KALI Linux in DOCKER
This is the first part of a two-part series. Here, I install the Kali Linux Docker image on Ubuntu 22.04.3 Desktop.

As an IT enthusiast and someone who enjoys working with Linux distributions, you might find it interesting to install the Kali Linux Docker image on your Ubuntu Desktop 22.04.3. This article will guide you through the process, step by step, and also explain why you might want to do this.
Why Install Kali Linux on Ubuntu Desktop?
Before diving into the installation process, let's address the question of why you might want to run Kali Linux inside a Docker container on your Ubuntu Desktop.
1. Security Testing:
Kali Linux is a popular choice for penetration testing and ethical hacking. Running Kali in a Docker container on your Ubuntu system allows you to create a controlled environment for security testing without altering your primary system.
2. Isolation:
Docker containers provide a lightweight and isolated environment. By running Kali in a container, you ensure that any changes or modifications made within it won't affect your host Ubuntu system.
3. Portability:
Docker containers are highly portable. You can easily share your Kali Linux setup with others, replicate it on different systems, or back it up for future use.
Installing Kali Linux in Docker on Ubuntu Desktop:
Step 1: Install Docker
If you haven't already installed Docker on your Ubuntu Desktop, follow these steps:
sudo apt update
sudo apt install docker.io
Step 2: Pull Kali Linux Image
Now, you can pull the Kali Linux Docker image. We'll use the kalilinux/kali-rolling
image for this example. Open a terminal and run:
docker pull kalilinux/kali-rolling
Step 3: Run Kali Linux in a Container
To run Kali Linux with full packages in a Docker container, use the following command:
docker run -it --name my-kali-container kalilinux/kali-rolling /bin/bash
docker run
: This is the primary Docker command used to create and start a new container from an image.-it
: These are two options combined:-i
stands for "interactive," which means it allows you to interact with the container using your terminal.-t
stands for "pseudo-TTY," which allocates a pseudo-terminal, enabling you to have an interactive shell session within the container.
--name my-kali-container
: This option specifies a name for the container you're creating. In this case, the name is set to "my-kali-container." Naming containers makes them easier to identify and manage.kalilinux/kali-rolling
: This is the name of the Docker image you want to use. In this case, you are using the official Kali Linux Docker image tagged as "kali-rolling." This image serves as the base for the new container./bin/bash
: This is the command that you want to run inside the container. In this case, you are launching a Bash shell, which provides an interactive command-line environment within the container.
When you run this command, Docker will create a new container based on the Kali Linux image, start it in interactive mode, and provide you with a Bash shell prompt within the container. This allows you to work and interact with the Kali Linux environment as if it were a standalone system, while all changes and activities remain isolated within the container, ensuring your host system's security.
Step 4: Install Full Kali Packages
Inside the container, you can install the full Kali Linux packages using the package manager apt
.
apt update
apt install kali-linux-full
This will install all the packages included in the full Kali Linux distribution.
Step 5: Use Kali Linux in Docker
You're now ready to use Kali Linux within your Docker container. You can run various security tools and perform security testing in this isolated environment.
Conclusion:
Installing Kali Linux in a Docker container on your Ubuntu Desktop is a smart choice for security enthusiasts and IT professionals. It provides a secure, isolated, and portable environment for conducting security testing and ethical hacking. By following the steps outlined in this article, you can easily set up Kali Linux in Docker and start exploring its powerful tools and features while keeping your host system safe.
Remember to exercise ethical hacking practices and comply with legal and ethical standards when using Kali Linux for security testing.
Here is the full video:
