Skip to main content

JupyterLab Shell Config

To change the default shell used by terminals in JupyterLab (e.g., to /bin/bash instead of the default shell), you'll need to modify the Jupyter Server configuration file.

1. Locate or Create the Jupyter Server Configuration File​

The default location for the Jupyter Server configuration file is:

~/.jupyter/jupyter_server_config.json

If this file does not exist, you can generate it manually. You do not need to use a --generate-config command (which applies to Python config .py files), simply create the JSON file manually if needed.

2. Edit the Configuration File​

Open the file in a text editor:

nano ~/.jupyter/jupyter_server_config.json

If the file does not exist, create it with the following contents:

{
"ServerApp": {
"terminado_settings": {
"shell_command": ["/bin/bash"]
}
}
}

If the file already exists, merge the "ServerApp" section into the existing JSON structure.

tip

Make sure the JSON syntax is valid — use proper commas and nesting.

Alternative method​

If the json is creating issue and alternative is to make the change in jupyter_server_config.py

locate terminado_settings: {} and change it to

terminado_settings: {"shell_command": ["/bin/bash"]}

3. Restart JupyterLab​

After saving the changes, restart JupyterLab for the changes to take effect:

jupyter lab

Now, when you open a new terminal in JupyterLab, it will use /bin/bash by default.


Notes​

  • Replace /bin/bash with any shell you prefer, e.g., /bin/zsh or /usr/bin/fish.
  • This setting affects all new terminal sessions started within JupyterLab.
  • This configuration applies to Jupyter Server, which underpins JupyterLab.