Hi can I run Kali on docker as I run it in a VM ?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey there! 👋
Yes, you can run Kali Linux in a Docker container just like you would in a VM, but there are some key differences to be aware of.
Getting Started with Kali Linux Docker Image
To get started, you can pull the official Kali Linux Docker image and run it with the following commands:
This will give you a running instance of Kali inside a Docker container. You’ll notice that the prompt looks like this:
One important thing to note is that systemd is not supported out of the box in Docker. This means you won’t be able to use
systemctl
without some extra work. If you need systemd, you’ll have to modify the Dockerfile and adjust thedocker run
flags accordingly.Installing Metapackages
Also, the image doesn’t come with the default Kali metapackage. You can install it manually by running:
Managing Your Kali Docker Container
If your container exits, don’t worry! You can list all containers, start it again, and reattach like this:
You’ll drop back into the same state as before. Just hit return to see the prompt.
Cleaning Up
When you’re done with the container, you can remove it with:
For more details, check out the official Kali Linux Docker documentation.
Hope this helps! 🚀
- Bobby
Heya,
Yes, you can do that.
Pull the Kali Linux Docker Image: Kali provides official Docker images that you can pull from Docker Hub. To download the image, run:
This will pull the rolling release version of Kali Linux from Docker Hub.
Run the Kali Linux Docker Container: To start a Kali Linux container interactively, use the following command:
This command will launch a container and give you a bash shell inside it. Once inside, you can use Kali as if it were installed in a traditional environment, but without the overhead of a full VM.
Install Kali Tools: The base Kali image on Docker might not include all the tools you’d expect from a full Kali installation. You can install specific tools or the full Kali toolset by running:
This installs the default Kali toolset. You can also install only specific tools as needed.