Installing Docker in Kali Linux (updated for 2019.2)

2019-11-1 19:19:18 | 浏览:
  • these instructions have been tested and are working on Kali Linux 2019.2
  • added instructions for Raspberry Pi — tested on 32-bit Kali Linux on Raspberry Pi 3, I couldn’t get Docker to work on 64-bit yet

This is a quick guide on how to install proper Docker CE in Kali Linux that has been tested on 64 bit Kali 2019.1. There’s other guides which use outdated Docker repositories (you can tell by the package name — docker, docker-engine, or

This guide is based on official Docker documentation ( as of February 2019, with slight modification as adding a repository doesn’t work (we’re adding Debian repository to Kali distro).

I’ve assumed you are using Kali as root, so sudo is not used throughout the commands below. Do sudo su - before typing the commands below if that’s not the case.


Kali has a myriad of tools, but it you want to run a tool that is not included, the cleanest way to do it is via a Docker container. As an example, I was looking into a tool called changeme ( that scans for default passwords, released at DerbyCon 7. Doing it the Docker way:

docker run -it ztgrace/changeme /bin/bash

was easy and didn’t pollute the rest of the system with python dependencies etc. Also, there is an older version of the tool included in Kali package repositories, with Docker you can try new versions of existing tools without any library version conflicts etc.

I’m no Docker expert by any means, so if you’ve used Docker in Kali, feel free to share what you liked about it.


Before starting, ensure your Kali Linux is fully up to date.

Add Docker PGP key:

curl -fsSL | apt-key add -

Configure Docker APT repository (Kali is based on Debian testing, which will be called buster upon release, and Docker now has support for it):

echo 'deb [arch=amd64] buster stable' > /etc/apt/sources.list.d/docker.list

For Raspberry Pi — use the following command instead:

echo 'deb [arch=armhf] buster stable' > /etc/apt/sources.list.d/docker.list

Note: as mentioned, I couldn’t get Docker to work on 64-bit Kali Linux for Raspberry Pi yet, so you’ll need a 32-bit version. This should work on Raspberry Pi 4 as well, though I haven’t tested it yet.

Update APT:

apt-get update

Install Docker

If you had older versions of Docker installed, uninstall them:

apt-get remove docker docker-engine

Install Docker:

apt-get install docker-ce

For Raspberry Pi, use the following command instead:

apt-get install --no-install-recommends docker-ce

(aufs-dkms package errors out when trying to install on Raspberry Pi, by using --no-install-recommends switch we avoid the issue by not installing aufs-dkms, and Docker still works fine.)


docker run hello-world

After installation, Docker service will be started, but not enabled (i.e. it will not be started automatically after reboot). To start it:

systemctl start docker

To start Docker automatically upon reboot (do it on your own risk!):

systemctl enable docker