Audvik Labs

Running GUI applications using docker for Mac

Docker as we know , is an open platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud.

Docker provides an API for interacting with the Docker daemon (called the Docker Engine API).

The Docker API has allowed limitless options for interfacing with Docker engine, containers, and images to emerge from CLIs to desktop applications and web-based management tools. Everything the Docker client can do can be done with the API.

 Running a GUI program in Docker can be a useful technique when you’re evaluating a new piece of software. You can install the software in a clean container, instead of having to pollute your host with new packages.

This approach also helps you avoid any incompatibilities with other packages in your environment. If you need to temporarily run two versions of a program, you can use Docker to avoid having to remove and reinstall the software on your host.

Kitematic is a simple application for managing Docker containers on Mac, Linux and Windows.It is an open source project built to simplify and streamline using Docker on a Mac or Windows PC.

Kitematic automates the Docker installation and setup process and provides an intuitive graphical user interface (GUI) for running Docker containers.

Kitematic integrates with Docker Machine to provision a VirtualBox VM and install the Docker Engine locally on your machine.

Take a few minutes to understand some key concepts before you install Docker.

On an “out-of-the-box” Linux installation, the Docker client, daemon, and all containers run directly on localhost, meaning you can access ports on a Docker container using localhost addressing; something like localhost:8080 or

On macOS, Docker’s daemon runs inside a Linux VM. The macOS Docker client talks to the Docker host VM, and your containers run on the host. You cannot use localhost in this setting; instead, the container’s ports map to the VM’s ports. If your VM has the IP address, access the ports like or


Install XQuartz from the official website


Install Docker for MAC


Configure XQuartz to allow connections from network clients from Preferences – Security tab



Host machine IP

To run:

On your local machine, start XQuartz

Run xhost + ${hostname} after

Set DISPLAY var in the container: export DISPLAY=<IP>:0

Run xclock in the container to test the X11

Now you can run your app with GUI

(GUI) is an interface that is drawn on the screen for the user to interact with.

User interfaces have some common components. Mac users may get some different messages while running applications. The application will look different when you run it on Mac or Windows.

Leave a comment

Your email address will not be published. Required fields are marked *