Self-hosted service
mviereck/x11docker avatar
mviereck/x11docker

x11docker: running GUI applications in Docker and podman containers

Run GUI applications and desktops in docker and podman containers. Focus on security.

6,321 stars418 forksShellMIT

At a glance

What is it?
x11docker supplies the display server that Docker and podman lack, then adds isolation around it. It suits engineers who want a graphical app sandboxed on a Linux host without giving up GPU, sound or clipboard access.
Who is it for?
Adopt x11docker if you run graphical Linux applications that are hard to package, or you want a sandbox for software you do not fully trust, and you accept that isolation depends on which options you enable. Do not adopt it if you are on Docker Desktop, if you need a supported Windows path, or if you expect the container to be the only security boundary.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 87 days ago.
What is it written in?
Mainly Shell, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The gap x11docker fills between Docker and a graphical desktop

Docker and podman run processes in an isolated environment, but neither provides a display server. An application that expects an X display has nothing to connect to, so a container built for a GUI simply fails to open a window. x11docker runs an X display server and hands it to the container, which is the whole reason the project exists. It is aimed at Linux users who want to run desktop applications, or an entire desktop environment, inside a container without giving the container direct access to the host display.

The second half of the pitch is security. The README states that x11docker performs security setup to enhance container isolation and to avoid X security leaks, which it describes as a sandbox that fairly well protects the host from possibly malicious or buggy software. That framing matters: a plain Docker run with the host socket mounted gives the container far more than a window. x11docker's default posture is narrower than that, though the README is also explicit that some options degrade isolation, so the security level is a function of the flags you pass, not a fixed property of the tool.

How the display server and container runtime fit together

x11docker is a shell script, not a daemon or a container image. It orchestrates three things: a container runtime, an X server, and the container image you name on the command line. The runtime is docker, podman or nerdctl. The X server can run on the host or inside a container built from the image x11docker/xserver. The README lists nxagent and Xephyr as the recommended host-side options, with xpra as an alternative.

That extra X server is the mechanism behind the isolation claim. Rather than exposing the host's own display to the container, x11docker starts a separate server and points the container at it. The container never talks to the display the user is actually sitting in front of. The README notes that the container user is set to the same user as on the host, which avoids running the application as root inside the container. Capabilities are restricted to what the project considers a bare minimum.

Optional features are wired in per session: GPU acceleration, sound, webcam, printer, clipboard, DBus, an init system, language locales and shared folders. Each of those is a deliberate opening between container and host, and the README groups some of them under options that degrade container isolation. The architecture is therefore best understood as a set of switches rather than a single sandbox mode.

Installing x11docker and running a first GUI container

The README offers distribution packages as one route and a manual installation as another. For a quick start it gives a one-line installer that fetches the script from the repository and runs it with an update flag:

bash
curl -fsSL https://raw.githubusercontent.com/mviereck/x11docker/master/x11docker | sudo bash -s -- --update

After that, the README says to either pull the image x11docker/xserver or install at least nxagent or xpra together with Xephyr on the host. That choice decides whether the X server runs as a container or as a host process.

The terminal syntax is a single command with an image name and an optional command. The README's own examples look like this:

bash
x11docker x11docker/xfce thunar
x11docker --desktop x11docker/xfce
x11docker --gpu x11docker/xfce glxgears

The first runs the file manager thunar from the x11docker/xfce image. The second starts a full desktop session instead of a single window. The third enables GPU acceleration for glxgears, which is the README's suggested way to check that hardware acceleration works. If the window appears, the display server, the runtime and the image are all cooperating.

The README also mentions a --preset option for preconfiguration, including the ability to define a default preset for all x11docker sessions. That is the place to put recurring choices such as the X server backend or GPU, rather than repeating flags. The README does not document a rollback procedure for a preset change.

Where the isolation promise breaks down

The security section of the README is not marketing. It contains a subsection titled security weaknesses and another listing options that degrade container isolation. That is an honest structure, and it should shape how you read the rest of the documentation. Features such as GPU access, sound, webcam, printer and shared folders all require the container to reach host resources. Enabling them moves the session away from the minimal default.

Docker Desktop is the other clear boundary. The README states that support for the VM-based Docker Desktop is experimental, that some features will not work, and that basic functionality is given. It recommends the native Docker Engine server version instead, which uses the host kernel. If your environment standardises on Docker Desktop, x11docker is not the tool you want. The package naming matters here: the README points to docker.io or docker-ce as the supported native packages, in contrast to the VM-based docker-desktop package. Podman sidesteps the distinction entirely.

There is also a platform limit. Installation on MS Windows is mentioned as a topic, but the project is a shell script built around Linux containers and a Linux display server. Anyone expecting a first-class Windows experience should treat that as out of scope rather than as a gap waiting to be filled.

x11docker compared with running Docker GUI apps by hand

The direct alternative is doing it yourself: run docker with the host X socket mounted and the DISPLAY variable passed through, which is the common recipe for Docker GUI Linux setups. That approach is shorter to type and has no extra dependency, but it hands the container the host's X server. Any client connected to that server can, depending on the setup, observe or interfere with other windows. x11docker's answer is to start a dedicated X server for the session, which is why nxagent, Xephyr or the x11docker/xserver image appear in the dependency list at all.

A second alternative is a full virtual machine. A VM gives a stronger boundary than a container, at the cost of a second kernel and noticeably more memory and startup time. x11docker's position is the middle ground: container-level resource use with a display server that is not the host's. That trade is the reason the project exists, and it is also why the security section matters more than the feature list. If you do not care about the display boundary, plain Docker with a mounted socket is simpler. If you do care, the extra X server is the point.

Remote access is a third path the README mentions, pointing to wiki pages on SSH and VNC. Those are documented outside the main README, so treat the wiki as part of the product when you evaluate it.

Maintenance, licensing and what upgrades cost

The repository is not archived. The last push was on 2026-07-05, and the most recent release listed is v7.8.0 from 2026-01-17, preceded by v7.7.1 and v7.7.0 in November 2025. The project is written in Shell, with the main script at the repository root alongside x11docker.man, CHANGELOG.md and TODO.md. There is a published paper in the JOSS format, with paper.md and paper.bib in the tree, which is unusual for a shell tool and suggests the design has been written up rather than only coded.

Upgrade cost is low by construction. The tool is a script, and the documented installer takes an --update flag, so refreshing means re-running the installer rather than rebuilding images. The image x11docker/xserver is a separate artifact that can be pulled independently. The main compatibility risk is not the script but the host: X server options, GPU drivers and container runtime versions change underneath it, and the README's dependency list is where that surface is described.

The licence is MIT, per LICENSE.txt. That is permissive and imposes few obligations on redistribution, but it also means the project offers no warranty, and the security claims in the README are the author's stated design goals rather than a certification. If your threat model requires an audited boundary, the MIT licence tells you nothing about that, and you should not read it as one.

Editorial conclusion

Adopt x11docker if you run graphical Linux applications that are hard to package, or you want a sandbox for software you do not fully trust, and you accept that isolation depends on which options you enable. Do not adopt it if you are on Docker Desktop, if you need a supported Windows path, or if you expect the container to be the only security boundary. Before committing, check the security and feature report for your setup, confirm whether the host has nxagent, Xephyr or the x11docker/xserver image, and read the section on options that degrade container isolation.

Frequently asked questions

Why are people moving away from Docker?

The README does not discuss migration away from Docker. It notes that podman is a supported runtime alongside docker and nerdctl, and that podman users do not need to worry about the Docker Desktop versus Docker Engine distinction.

What is Docker and why would I need it?

The README describes Docker as a container tool that runs applications in an isolated environment using far fewer resources than a virtual machine. You need one of docker, podman or nerdctl as the runtime for an x11docker session.

Is Docker still relevant in 2026?

The README does not make claims about Docker's long-term relevance. It does state that the native Docker Engine server version is recommended over the VM-based Docker Desktop, and that x11docker support for Docker Desktop is experimental.

Is Podman better than Docker?

The README does not rank the two runtimes. It lists podman as a supported container runtime and notes that podman users avoid the Docker Desktop versus Docker Engine distinction entirely.

Official sources

  1. Issues
  2. License: MIT
  3. mviereck/x11docker on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mviereck-x11docker.svg)](https://hysenlabs.com/projects/mviereck-x11docker)