# Firefox-in-a-Docker \*for desktop\*

**URL:** <https://discourse.mozilla.org/t/firefox-in-a-docker-for-desktop/18241>\
**Category:** Linux\
**Created:** [August 20, 2017, 7:29am UTC](https://discourse.mozilla.org/t/firefox-in-a-docker-for-desktop/18241 "2017-08-20T07:29:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elijah](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/elijah/32/15912_2.png) [@elijah](https://discourse.mozilla.org/u/elijah)\
**Post date:** [August 20, 2017, 7:29am UTC](https://discourse.mozilla.org/t/firefox-in-a-docker-for-desktop/18241/1 "2017-08-20T07:29:58Z")

</div>

A long time ago I wanted this, and didn’t find anything like it out there. The browser-in-a-container systems were all around CI tests instead of day-to-day use. So I wrote my own and have been actively using it for over a year now.

I haven’t checked since to see if someone else has done this, but even if they have, I don’t think this type of setup gets much attention. So here’s me Firefox-in-a-Docker config:

> **[begrif/ffdocker](https://github.com/begrif/ffdocker)**
>
> ffdocker - Firefox-in-a-Docker for desktop use.

The goal was to isolate Firefox from as much of the hardware and filesystem as seemed “reasonable” to me. My reasonable may not be yours.

Longer term, I have been thinking about adding memory / cpu limits by way of Docker, but it has been so long since I’ve had real run-away problems there with Firefox that I haven’t done that. It’s an easy addition to the `docker run` line in the runner script. Harder is deciding what’s a reasonable limit without being arbitrary.

Discussion welcome!

---

<div class="post-metadata">

**Author:** ![rugkx](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/rugkx/32/19322_2.png) [@rugkx](https://discourse.mozilla.org/u/rugkx)\
**Post date:** [August 4, 2018, 3:43pm UTC](https://discourse.mozilla.org/t/firefox-in-a-docker-for-desktop/18241/2 "2018-08-04T15:43:30Z")

</div>

Another way to sandbox Firefox a bit would e.g. be using [Flatpak](https://discourse.mozilla.org/t/firefox-in-flatpak-flathub/20347).

---

<div class="post-metadata">

**Author:** ![elijah](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/elijah/32/15912_2.png) [@elijah](https://discourse.mozilla.org/u/elijah)\
**Post date:** [August 5, 2018, 6:13am UTC](https://discourse.mozilla.org/t/firefox-in-a-docker-for-desktop/18241/3 "2018-08-05T06:13:07Z")

</div>

Under the hood that seems to be another Linux container implementation, but because the focus is on _easy to use_, it might be harder for tinkering with. I think the Docker set-up is reasonably straightforward to start tweaking and adjusting for someone not used to creating Docker files, but otherwise familiar with Unix scripting. Not so sure about Flatpak, I’ve never tried to create one.

Of course, yes, if someone else has created one, Flatpak will be easier to use. That’s the intent of Flatpak. Easy to use desktop containers.

---

<div class="post-metadata">

**Author:** ![APK\_Thrills](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@APK\_Thrills](https://discourse.mozilla.org/u/APK_Thrills)\
**Post date:** [August 10, 2023, 9:12pm UTC](https://discourse.mozilla.org/t/firefox-in-a-docker-for-desktop/18241/4 "2023-08-10T21:12:13Z")

</div>

> [@rugkx](#):
>
> Another way to sandbox Firefox a bit would e.g. be using [Flatpak](https://discourse.mozilla.org/t/firefox-in-flatpak-flathub/20347).

I hope it will. I guess it is working. I have been trying to check this.

Thanks Everyone
