Run GUI Apps in Containers, Access Them from Any Browser
Ever needed to run a Linux GUI application but didn’t want to mess with your host system’s libraries, display managers, or dependencies? Maybe you’re testing an app in a clean environment, or you just want to run something headless and access it remotely.
That’s where docker-baseimage-gui comes in. It’s a minimal Docker base image designed to run any X11 GUI application inside a container, then expose it through a web browser (via noVNC) or a standard VNC client. No X11 forwarding, no messy setup, no need for a physical display.
What It Does
This project by jlesage provides a lightweight Docker base image that bundles:
- Xvfb – a virtual framebuffer X server (no physical display needed)
- Openbox – a minimal window manager for basic window management
- x11vnc – a VNC server that lets you connect to the X session
- noVNC – a web-based VNC client for browser access
You build your own Dockerfile on top of this image, install just the GUI app you want, and run it. The container starts the virtual display, launches your app inside it, and you connect via http://localhost:5800 (noVNC) or a VNC client on port 5900.
Why It’s Cool
It’s absurdly simple. No need to configure X11 forwarding, install a display server on your host, or wrestle with xhost. Just pull the image, add your app, and run.
It works anywhere. Run it on a headless server, a Raspberry Pi, or in CI/CD pipelines. You can even spin up temporary GUI environments for testing or demos.
It’s secure by default. The app runs fully isolated inside the container. No direct access to your host’s display, file system, or network unless you explicitly mount things.
Ready-made examples. The repo includes several pre-built Dockerfiles for popular apps like Firefox, Chrome, LibreOffice, and more. You can take them as templates and adapt to your own needs.
How to Try It
The fastest way to see it in action is to run one of the prebuilt examples. For instance, to run Firefox in a container:
docker run -d --name=firefox -p 5800:5800 -p 5900:5900 jlesage/firefox
Then open your browser to http://localhost:5800. You’ll see Firefox running inside the container.
To build your own, create a Dockerfile like this:
FROM jlesage/baseimage-gui:latest
# Install your app
RUN apt-get update && apt-get install -y my-gui-app
COPY startapp.sh /startapp.sh
# Replace the default window manager with a startup script
ENV APP_NAME="My App"
The startapp.sh script just needs to launch your application. The base image handles the rest.
Final Thoughts
This isn’t a flashy new tool, but it’s one of those “why didn’t I think of that” projects that solves a real pain point. If you’ve ever been stuck trying to run a GUI app in a headless environment or wanted to share a desktop app with colleagues without installing anything, this image saves you hours of configuration.
It’s also great for developers building tools that need a GUI for demos, testing, or CI workflows. Just wrap your app in a container and let anyone access it with a browser.
Give it a spin – you’ll probably find yourself using it more than you expect.
H/T to @githubprojects for the original tweet
Repository: https://github.com/jlesage/docker-baseimage-gui