Skip to content

Instantly share code, notes, and snippets.

@santaklouse
Forked from roaldnefs/mac-docker-gui.txt
Created August 6, 2025 10:52
Show Gist options
  • Save santaklouse/85b72a9c366d0b950d347d3020367320 to your computer and use it in GitHub Desktop.
Save santaklouse/85b72a9c366d0b950d347d3020367320 to your computer and use it in GitHub Desktop.
Running GUI application in Docker on MacOS
# Install XQuartz
brew cask install xquartz
# Restart MacOS
# Open XQuartz
open -a XQuartz
# Ensure the "Allow connections from network clients" option in Preferences >> Security is turned on
# Add localhost as an allowed source
xhost + 127.0.0.1
# Run a Docker container, e.g. Firefox
docker run -e DISPLAY=host.docker.internal:0 -v /tmp/.X11-unix:/tmp/.X11-unix jess/firefox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment