Please enable Javascript for better experience...
Execute a Firefox Browser in a Docker Container with Graphical Interface
By Keshav Khatore | May 23, 2020 | In Articles | Update: May 23, 2020 | Total Views [ 14343 ]
Taged In
(5 Like)

Today we'll learn how we can run GUI Applications like Firefox inside a Docker Container. We can easily run most of the common GUI apps without getting into trouble inside a Docker Container. Docker is an Open Source project that provides an open platform to pack, ship, and run any application as a lightweight container. It has no boundaries of Language support, Frameworks, or packaging system and can be run anywhere, anytime from small home computers to high-end servers. It makes them great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider




The Docker container should be installed in Linux


The Centos Image should be there


The fast internet connectivity should be there

Red hat Linux

Red hat Linux Should be installed


Step 1

Open Terminal in Linux and Write

export display=:0

What is the meaning of this Command

The environment variable DISPLAY tells GUI programs on how to communicate with the GUI. A Unix system can run multiple X servers, i.e. multiple displays. These displays can be physical displays (one or more monitor), or remote displays (forwarded over the network, e.g. over SSH), or virtual displays such as Xvfb, etc. The basic syntax to specify displays is HOST: NUMBER; if you omit the HOST part, the display is a local one.

Step 2

Restart The Docker Service

The Serice of Docker Should start Otherwise it should give some errors

Step 3

After the start of Docker service then you should type the Docker run command with the use of X11 Port.

X11 Port Explanation

X11 is the graphical environment for most Unix or Unix-like systems, including *BSD and GNU/Linux; it provides access to screen, keyboard, and mouse. X11 is the Unix and Linux graphics drivers.

Step 4

Installation of Firefox  In Docker

Step 5

Once the Firefox will be installed in Docker

Step 6

In Container Terminal

Type Firefox

The Firefox Will take Gui from the Linux port X11.

Thanks for visiting here. Share this article if you found it useful.
Like Facebook Page
Connect to twitter
Subscribe my Channel
Connect over Linkedin
Share this on Social Media

About the Author

Keshav Khatore
Keshav Khatore

Public profile: user/profile/99905478

Follow me

facebook linkedin twitter G+ VMTN youtube

I am Keshav Khatore student of Lovely Professional University, Phagwara, Punjab, India, currently pursuing Masters In Computer Application.I am a Member of Redhat Linux, the biggest network on the planet and it's a glad thing for me to be a piece of such extraordinary and lofty community. I expert in Linux and have certification Red-hat Certified System Administration . For Contact- || LinkedIn-

Please SignUp/Login to comment...

Or comment as anonymous...
* Name
* Email ID
Facebook Likes