This Docker image provides a full Ubuntu 24.04 desktop environment (GNOME) accessible via VNC with TLS security support.
docker build -t ubuntu_desktop_vnc .
docker run -d -p 5901:5901 --name ubuntu-desktop ubuntu_desktop_vnc
Use any VNC client (e.g., TigerVNC Viewer, RealVNC, TightVNC) to connect:
localhost:5901 or <your-server-ip>:5901password123| Variable | Default | Description |
|---|---|---|
VNC_USER | vncuser | Username for the VNC session |
VNC_PASSWORD | password123 | VNC and user password |
VNC_RESOLUTION | 1920x1080 | Screen resolution |
VNC_DEPTH | 24 | Color depth (16, 24, or 32) |
docker run -d -p 5901:5901 \
-e VNC_USER=myuser \
-e VNC_PASSWORD=mysecretpassword \
ubuntu_desktop_vnc
docker run -d -p 5901:5901 -e VNC_RESOLUTION=2560x1440 ubuntu_desktop_vnc
docker run -d \
--name ubuntu-desktop \
-p 5901:5901 \
-e VNC_USER=developer \
-e VNC_PASSWORD=mysecretpassword \
-e VNC_RESOLUTION=1920x1080 \
-e VNC_DEPTH=24 \
ubuntu_desktop_vnc
To persist user home directory data:
docker run -d \
--name ubuntu-desktop \
-p 5901:5901 \
-v ubuntu_home:/home/vncuser \
ubuntu_desktop_vnc
If you need GPU acceleration:
docker run -d \
--name ubuntu-desktop \
--gpus all \
-p 5901:5901 \
ubuntu_desktop_vnc
| Port | Protocol | Description |
|---|---|---|
| 5901 | TCP | VNC Server (display :1) |
vncviewer, Remmina, TigerVNC Viewervncviewer localhost:5901
To access the container shell as the VNC user:
docker exec -it -u vncuser ubuntu-desktop bash
To access as root:
docker exec -it ubuntu-desktop bash
Check if the container is running:
docker ps
Check container logs:
docker logs ubuntu-desktop
This can happen if GNOME fails to start. Try:
Restart the container:
docker restart ubuntu-desktop
Or exec into the container and restart VNC:
docker exec -it ubuntu-desktop bash
su - vncuser -c "vncserver -kill :1"
su - vncuser -c "vncserver -geometry 1920x1080 -depth 24 -SecurityTypes VncAuth,TLSVnc :1"
-e VNC_RESOLUTION=1280x720-e VNC_DEPTH=16This image can be built using the repository's GitHub Actions workflow:
build_folder to ubuntu_desktop_vnctags (e.g., latest)vncuser by default)VncAuth,TLSVnc)⚠️ Warning: The default VNC password is password123. Always set a strong password using the VNC_PASSWORD environment variable in production environments.
⚠️ Warning: For secure remote access over untrusted networks, consider:
ssh -L 5901:localhost:5901 user@server| File | Description |
|---|---|
Dockerfile | Docker image definition |
entrypoint.sh | Container entrypoint script that sets up user and starts VNC |
README.MD | This documentation file |
This Dockerfile is provided as-is for educational and development purposes.
Content type
Image
Digest
sha256:229f50cc7…
Size
1.1 GB
Last updated
9 months ago
docker pull brokenjade/ubuntu_desktop_vnc