Launching GUI App Jupyter Notebook on Top of Docker Container

Sachin Joshi
3 min readJun 1, 2021

In this blog, we will launch two GUI applications (Firefox and Juypter Nootbook) inside a docker container.

Pre-requisites :-

  • Docker installed in OS.(here, We will be using Redhat8 as the base OS)

Steps:-

First of all after installing docker and starting its services. you need to pull one docker image.

Pull one image. here I am pulling centos image

Now, as our image is pulled successfully we need to run our image.

Start docker container normally.

Now let’s install some GUI application like firefox and jupyter inside the container.

After the installation let’s start firefox. Let us try opening Firefox

It gives shows error saying that no display environment variable specified. That is because we required some display environment to run GUI applications in our docker container. So we need to define $DISPLAY while launching container.

Now launch one more container with env $DISPLAY, and install firefox.

it gave an error again, so now let us understand the error, it needs one enviornment variable for x11 Display, so we need to define $DISPLAY.

Now let us launch one more docker container with env $DISPLAY, and install firefox in it as well.

Open localhost terminal now

Here We are using using — net = host, because we here want to use network of our host system. So everything for connecting and networking we will use our host system for it.

After firefox installation is completed open it.

here we are opening firefox letus se if it is working or not.

It is working perfectly. We can see a firefox web browser is open.

now let us install jupyter notebook

we can install jupyter notebook after installing python3 in the container

Now the installation is complete we will now launch jupyter notebook in GUI format.

Since we will be launching jupyter notebook in root user so we need to allow root user to use it. By using command line-

— jupyter notebook — allow-root

Use this Token whenever required

Now we, have successfully launched Juypter Notebook GUI on Docker Container.

Thank you for Reading😊, Do share if you find it valuable.

--

--