A lightweight setup to run Kali Linux with a GUI using Docker and Docker Compose.
-
🐳 Docker and Docker Compose must be installed on your system.
-
🖥️ Install a VNC client:
- Linux:
tigervnc-viewer
orremmina
- Windows:
RealVNC Viewer
orTightVNC
(choco install tightvnc
) - macOS:
RealVNC Viewer
orChicken of the VNC
- Linux:
-
🔑 Create a
.env
file with the following content:VNC_PASSWORD=your_password_here
To pull the official Kali Linux image:
docker pull docker.io/kalilinux/kali-rolling
-
Build the image:
docker build -t kali-gui .
-
Start the service:
docker-compose up -d
The kali-gui
service allows you to access the Kali Linux desktop environment via VNC.
-
Start the Docker container:
docker-compose up -d
-
Connect to the VNC server:
- Open your VNC client.
- Enter the address:
localhost:5901
(or127.0.0.1:5901
). - Enter the VNC password (configured in the
.env
file).
-
Access the desktop:
- Once connected, you should see the Kali Linux desktop environment.
-
🌐 If running on a remote server, replace
localhost
with the server's IP address and ensure port5901
is open in the firewall. -
🛠️ To check container logs for troubleshooting:
docker logs kali-gui
-
🔒 Ensure the
.env
file contains theVNC_PASSWORD
variable.
To stop the kali-gui
service:
docker-compose down