<!--
  canonical-url: https://www.avonture.be/blog/docker-gui-in-browser
  published:     2024-09-05
  This is a static plain-Markdown mirror generated at build time.
  Visit the canonical URL above for the fully rendered page, with images and interactive components.
-->

# Docker - Running some GUI interfaces in the browser

> Easily run Linux GUI applications like Firefox and GIMP in a Docker container and access them directly through your web browser with these simple commands.

---
![Docker - Running some GUI interfaces in the browser](/img/v2/docker_gui.webp)

**TL;DR**

This article shows how to run graphical Linux applications like Firefox and GIMP inside Docker containers and access their interface directly through a web browser (via `http://localhost:3000`), using the `linuxserver/firefox` and `linuxserver/gimp` images — handy for testing a site in a specific browser version without installing it.

In a future article, I'll be covering a subject I've just discovered: the possibility of running graphical interfaces in Docker and, therefore, having a Linux application running in Windows. *That article is now written: [Docker - Run Graphical User Interfaces - Firefox, Chrome & GIMP](/blog/docker-run-linux-gui), where the applications are displayed as real windows instead of in a browser tab.*

But first, let's take a look at a few graphical interfaces, such as Firefox or GIMP (image processing software), which can be run as if they were web applications.

## Start Firefox in your browser

Imagine you're a web developer and just want to check if your site can be displayed on a specific version of Firefox (without having to install the version, of course). Here it is, running in a container and rendered straight in Chrome:

> Screenshot — http\://localhost:3000
>
> ![Start Firefox inside Docker in Chrome](./images/firefox_in_chrome.webp)

To reproduce this, copy/paste the command below in your console (coming from <https://hub.docker.com/r/linuxserver/firefox>):

```bash
$ docker run -d \
    --name=firefox \
    --security-opt seccomp=unconfined \
    -e PUID=1000 \
    -e PGID=1000 \
    -e TZ=Etc/UTC \
    -e FIREFOX_CLI=https://www.linuxserver.io/ \
    -p 3000:3000 \
    -p 3001:3001 \
    -v /path/to/config:/config \
    --shm-size="1gb" \
    --restart unless-stopped \
    lscr.io/linuxserver/firefox:latest
```

Then open your browser and surf to `http://localhost:`3000 to start Firefox. You can then surf to any amazing site.

> **On my screenshot above, you'll see I'm using the port 5000 instead (this because my blog is running on port 3000):**

And, for fun, here is the same but I've started Firefox in Docker in an MS-DOS environment and, then, I've used Edge instead of Chrome:

> Screenshot — http\://localhost:3000
>
> ![Start Firefox inside Docker in Edge](./images/firefox_in_edge.webp)

The command I've used in DOS is: `docker run -d --name=firefox --security-opt seccomp=unconfined -e PUID=1000 -e PGID=1000 -e TZ=Etc/UTC -e FIREFOX_CLI=https://www.linuxserver.io/ -p ` 3000`:3000 -p ` 3001`:3001 -v %CD%\temp:/config --shm-size="1gb" --restart unless-stopped lscr.io/linuxserver/firefox:latest`.

## Start GIMP in your browser

Another example is running GIMP (image processing software) in the browser:

> Screenshot — http\://localhost:3000
>
> ![Running GIMP in Docker](./images/gimp_in_docker.webp)

Take a look at <https://github.com/linuxserver/docker-gimp?tab=readme-ov-file#docker-cli-click-here-for-more-info>. You'll find there a command to run in your console.

First, make sure to create a subfolder called `config` and, in my example below, I'll also create a subfolder `images` where I've copied an avatar of a meerkat.

```bash
$ docker run -d \
    --name=gimp \
    --security-opt seccomp=unconfined \
    -e PUID=1000 \
    -e PGID=1000 \
    -e TZ=Etc/UTC \
    -p 3000:3000 \
    -p 3001:3001 \
    -v ./config:/config \
    -v ./images:/images \
    -w /images \
    --restart unless-stopped \
    lscr.io/linuxserver/gimp:latest
```

Like earlier, now, just start your browser and surf to `http://localhost:`3000 to start GIMP — that's the screenshot above.

The MS-DOS version of the CLI is: `docker run -d --name=gimp --security-opt seccomp=unconfined -e PUID=1000 -e PGID=1000 -e TZ=Etc/UTC -p ` 3000`:3000 -p ` 3001`:3001 -v %CD%/config:/config -v ./images:/images -w /images --restart unless-stopped lscr.io/linuxserver/gimp:latest`.

## Conclusion

Two `docker run` commands, two GUI apps in a browser tab — no install, no cleanup. If you'd
rather have these applications open as real windows on your desktop instead of inside a browser
tab, [Docker - Run Graphical User Interfaces - Firefox, Chrome & GIMP](/blog/docker-run-linux-gui) covers that variant.
