How to change the default browser used by the ipython/jupyter notebook in Linux?

You can create jupyter_notebook_config.py by:

jupyter notebook --generate-config

Then you go to

~/.jupyter/jupyter_notebook_config.py

and change

# c.NotebookApp.browser = ''

to for example:

c.NotebookApp.browser = '/usr/bin/google-chrome %s'

You can choose which ever browser is installed. You'll find the path for example by typing which firefox Do not forget to delete the #


The accepted answer is great, here is a solution if you want to change it one time:

jupyter-notebook --browser=firefox

Of course you could make a bash wrapper script with this command or create a .desktop file that would let you launch it in your preferred browser every time you use that launcher.

An example wrapper script could look like this:

#!/bin/bash
jupyter-notebook --browser=firefox

You could then place it in your PATH, e.g. $HOME/bin/jnbff.sh, so you can easily launch it from any directory by simply typing its name.

Sidenote: the dash in jupyter-notebook allows for tab-completion, the usually recommended way with space (i.e. jupyter notebook) doesn't.