Config file and command line options¶
The JupyterLab Server can be run with a variety of command line arguments. A list of available options can be found below in the options section.
Defaults for these options can also be set by creating a file named
jupyter_jupyterlab_server_config.py
in your Jupyter folder. The Jupyter
folder is in your home directory, ~/.jupyter
.
To create a jupyter_jupyterlab_server_config.py
file, with all the defaults
commented out, you can use the following command line:
$ python -m jupyterlab_server --generate-config
Options¶
This list of options can be generated by running the following and hitting enter:
$ python -m jupyterlab_server --help-all
- Application.log_datefmtUnicode
Default:
'%Y-%m-%d %H:%M:%S'
The date format used by logging formatters for %(asctime)s
- Application.log_formatUnicode
Default:
'[%(name)s]%(highlevel)s %(message)s'
The Logging format template
- Application.log_levelany of
0``|``10``|``20``|``30``|``40``|``50``|
’DEBUG’|
’INFO’|
’WARN’|
’ERROR’|
’CRITICAL’`` Default:
30
Set the log level by value or name.
- Application.show_configBool
Default:
False
Instead of starting the Application, dump configuration to stdout
- Application.show_config_jsonBool
Default:
False
Instead of starting the Application, dump configuration to stdout (as JSON)
- JupyterApp.answer_yesBool
Default:
False
Answer yes to any prompts.
- JupyterApp.config_fileUnicode
Default:
''
Full path of a config file.
- JupyterApp.config_file_nameUnicode
Default:
''
Specify a config file to load.
- JupyterApp.generate_configBool
Default:
False
Generate default config file.
- JupyterApp.log_datefmtUnicode
Default:
'%Y-%m-%d %H:%M:%S'
The date format used by logging formatters for %(asctime)s
- JupyterApp.log_formatUnicode
Default:
'[%(name)s]%(highlevel)s %(message)s'
The Logging format template
- JupyterApp.log_levelany of
0``|``10``|``20``|``30``|``40``|``50``|
’DEBUG’|
’INFO’|
’WARN’|
’ERROR’|
’CRITICAL’`` Default:
30
Set the log level by value or name.
- JupyterApp.show_configBool
Default:
False
Instead of starting the Application, dump configuration to stdout
- JupyterApp.show_config_jsonBool
Default:
False
Instead of starting the Application, dump configuration to stdout (as JSON)
- ExtensionApp.answer_yesBool
Default:
False
Answer yes to any prompts.
- ExtensionApp.config_fileUnicode
Default:
''
Full path of a config file.
- ExtensionApp.config_file_nameUnicode
Default:
''
Specify a config file to load.
- ExtensionApp.default_urlUnicode
Default:
''
No description
- ExtensionApp.generate_configBool
Default:
False
Generate default config file.
- ExtensionApp.handlersList
Default:
[]
Handlers appended to the server.
- ExtensionApp.log_datefmtUnicode
Default:
'%Y-%m-%d %H:%M:%S'
The date format used by logging formatters for %(asctime)s
- ExtensionApp.log_formatUnicode
Default:
'[%(name)s]%(highlevel)s %(message)s'
The Logging format template
- ExtensionApp.log_levelany of
0``|``10``|``20``|``30``|``40``|``50``|
’DEBUG’|
’INFO’|
’WARN’|
’ERROR’|
’CRITICAL’`` Default:
30
Set the log level by value or name.
- ExtensionApp.open_browserBool
Default:
False
- Whether to open in a browser after starting.
The specific browser used is platform dependent and determined by the python standard library webbrowser module, unless it is overridden using the –browser (ServerApp.browser) configuration option.
- ExtensionApp.settingsDict
Default:
{}
Settings that will passed to the server.
- ExtensionApp.show_configBool
Default:
False
Instead of starting the Application, dump configuration to stdout
- ExtensionApp.show_config_jsonBool
Default:
False
Instead of starting the Application, dump configuration to stdout (as JSON)
- ExtensionApp.static_pathsList
Default:
[]
paths to search for serving static files.
This allows adding javascript/css to be available from the notebook server machine, or overriding individual files in the IPython
- ExtensionApp.static_url_prefixUnicode
Default:
''
Url where the static assets for the extension are served.
- ExtensionApp.template_pathsList
Default:
[]
Paths to search for serving jinja templates.
Can be used to override templates from notebook.templates.
- LabServerApp.allowed_extensions_urisUnicode
Default:
''
“A list of comma-separated URIs to get the allowed extensions list
Changed in version 2.0.0: LabServerApp.whitetlist_uris renamed to allowed_extensions_uris
- LabServerApp.answer_yesBool
Default:
False
Answer yes to any prompts.
- LabServerApp.app_settings_dirUnicode
Default:
''
The application settings directory.
- LabServerApp.app_urlUnicode
Default:
'/lab'
The url path for the application.
- LabServerApp.blacklist_urisUnicode
Default:
''
Deprecated, use LabServerApp.blocked_extensions_uris
- LabServerApp.blocked_extensions_urisUnicode
Default:
''
A list of comma-separated URIs to get the blocked extensions list
Changed in version 2.0.0: LabServerApp.blacklist_uris renamed to blocked_extensions_uris
- LabServerApp.cache_filesBool
Default:
True
Whether to cache files on the server. This should be True except in dev mode.
- LabServerApp.config_fileUnicode
Default:
''
Full path of a config file.
- LabServerApp.config_file_nameUnicode
Default:
''
Specify a config file to load.
- LabServerApp.extra_labextensions_pathList
Default:
[]
Extra paths to look for federated JupyterLab extensions
- LabServerApp.generate_configBool
Default:
False
Generate default config file.
- LabServerApp.handlersList
Default:
[]
Handlers appended to the server.
- LabServerApp.jinja2_optionsDict
Default:
{}
Options to pass to the jinja2 environment for this
- LabServerApp.labextensions_pathList
Default:
[]
The standard paths to look in for federated JupyterLab extensions
- LabServerApp.labextensions_urlUnicode
Default:
''
The url for federated JupyterLab extensions
- LabServerApp.listings_refresh_secondsInt
Default:
3600
The interval delay in seconds to refresh the lists
- LabServerApp.listings_request_optionsDict
Default:
{}
The optional kwargs to use for the listings HTTP requests as described on https://2.python-requests.org/en/v2.7.0/api/#requests.request
- LabServerApp.listings_urlUnicode
Default:
''
The listings url.
- LabServerApp.log_datefmtUnicode
Default:
'%Y-%m-%d %H:%M:%S'
The date format used by logging formatters for %(asctime)s
- LabServerApp.log_formatUnicode
Default:
'[%(name)s]%(highlevel)s %(message)s'
The Logging format template
- LabServerApp.log_levelany of
0``|``10``|``20``|``30``|``40``|``50``|
’DEBUG’|
’INFO’|
’WARN’|
’ERROR’|
’CRITICAL’`` Default:
30
Set the log level by value or name.
- LabServerApp.open_browserBool
Default:
False
- Whether to open in a browser after starting.
The specific browser used is platform dependent and determined by the python standard library webbrowser module, unless it is overridden using the –browser (ServerApp.browser) configuration option.
- LabServerApp.schemas_dirUnicode
Default:
''
The optional location of the settings schemas directory. If given, a handler will be added for settings.
- LabServerApp.settingsDict
Default:
{}
Settings that will passed to the server.
- LabServerApp.settings_urlUnicode
Default:
''
The url path of the settings handler.
- LabServerApp.show_configBool
Default:
False
Instead of starting the Application, dump configuration to stdout
- LabServerApp.show_config_jsonBool
Default:
False
Instead of starting the Application, dump configuration to stdout (as JSON)
- LabServerApp.static_dirUnicode
Default:
''
The optional location of local static files. If given, a static file handler will be added.
- LabServerApp.static_pathsList
Default:
[]
paths to search for serving static files.
This allows adding javascript/css to be available from the notebook server machine, or overriding individual files in the IPython
- LabServerApp.static_url_prefixUnicode
Default:
''
Url where the static assets for the extension are served.
- LabServerApp.template_pathsList
Default:
[]
Paths to search for serving jinja templates.
Can be used to override templates from notebook.templates.
- LabServerApp.templates_dirUnicode
Default:
''
The application templates directory.
- LabServerApp.themes_dirUnicode
Default:
''
The optional location of the themes directory. If given, a handler will be added for themes.
- LabServerApp.themes_urlUnicode
Default:
''
The theme url.
- LabServerApp.translations_api_urlUnicode
Default:
''
The url path of the translations handler.
- LabServerApp.tree_urlUnicode
Default:
''
The url path of the tree handler.
- LabServerApp.user_settings_dirUnicode
Default:
''
The optional location of the user settings directory.
- LabServerApp.whitelist_urisUnicode
Default:
''
Deprecated, use LabServerApp.allowed_extensions_uris
- LabServerApp.workspaces_api_urlUnicode
Default:
''
The url path of the workspaces API.
- LabServerApp.workspaces_dirUnicode
Default:
''
The optional location of the saved workspaces directory. If given, a handler will be added for workspaces.
- ServerApp.allow_credentialsBool
Default:
False
Set the Access-Control-Allow-Credentials: true header
- ServerApp.allow_originUnicode
Default:
''
Set the Access-Control-Allow-Origin header
Use ‘*’ to allow any origin to access your server.
Takes precedence over allow_origin_pat.
- ServerApp.allow_origin_patUnicode
Default:
''
Use a regular expression for the Access-Control-Allow-Origin header
Requests from an origin matching the expression will get replies with:
Access-Control-Allow-Origin: origin
where origin is the origin of the request.
Ignored if allow_origin is set.
- ServerApp.allow_password_changeBool
Default:
True
Allow password to be changed at login for the Jupyter server.
While logging in with a token, the Jupyter server UI will give the opportunity to the user to enter a new password at the same time that will replace the token login mechanism.
This can be set to false to prevent changing password from the UI/API.
- ServerApp.allow_remote_accessBool
Default:
False
Allow requests where the Host header doesn’t point to a local server
By default, requests get a 403 forbidden response if the ‘Host’ header shows that the browser thinks it’s on a non-local domain. Setting this option to True disables this check.
This protects against ‘DNS rebinding’ attacks, where a remote web server serves you a page and then changes its DNS to send later requests to a local IP, bypassing same-origin checks.
Local IP addresses (such as 127.0.0.1 and ::1) are allowed as local, along with hostnames configured in local_hostnames.
- ServerApp.allow_rootBool
Default:
False
Whether to allow the user to run the server as root.
- ServerApp.answer_yesBool
Default:
False
Answer yes to any prompts.
- ServerApp.authenticate_prometheusBool
Default:
True
- “
Require authentication to access prometheus metrics.
- ServerApp.autoreloadBool
Default:
False
Reload the webapp when changes are made to any Python src files.
- ServerApp.base_urlUnicode
Default:
'/'
The base URL for the Jupyter server.
Leading and trailing slashes can be omitted, and will automatically be added.
- ServerApp.browserUnicode
Default:
''
- Specify what command to use to invoke a web
browser when starting the server. If not specified, the default browser will be determined by the webbrowser standard library module, which allows setting of the BROWSER environment variable to override it.
- ServerApp.certfileUnicode
Default:
''
The full path to an SSL/TLS certificate file.
- ServerApp.client_caUnicode
Default:
''
The full path to a certificate authority certificate for SSL/TLS client authentication.
- ServerApp.config_fileUnicode
Default:
''
Full path of a config file.
- ServerApp.config_file_nameUnicode
Default:
''
Specify a config file to load.
- ServerApp.config_manager_classType
Default:
'jupyter_server.services.config.manager.ConfigManager'
The config manager class to use
- ServerApp.contents_manager_classTypeFromClasses
Default:
'jupyter_server.services.contents.largefilemanager.LargeFileM...
The content manager class to use.
- ServerApp.cookie_optionsDict
Default:
{}
Extra keyword arguments to pass to set_secure_cookie. See tornado’s set_secure_cookie docs for details.
- ServerApp.cookie_secretBytes
Default:
b''
- The random bytes used to secure cookies.
By default this is a new random number every time you start the server. Set it to a value in a config file to enable logins to persist across server sessions.
Note: Cookie secrets should be kept private, do not share config files with cookie_secret stored in plaintext (you can read the value from a file).
- ServerApp.cookie_secret_fileUnicode
Default:
''
The file where the cookie secret is stored.
- ServerApp.custom_display_urlUnicode
Default:
''
Override URL shown to users.
Replace actual URL, including protocol, address, port and base URL, with the given value when displaying URL to the users. Do not change the actual connection URL. If authentication token is enabled, the token is added to the custom URL automatically.
This option is intended to be used when the URL to display to the user cannot be determined reliably by the Jupyter server (proxified or containerized setups for example).
- ServerApp.default_urlUnicode
Default:
'/'
The default URL to redirect to from /
- ServerApp.disable_check_xsrfBool
Default:
False
Disable cross-site-request-forgery protection
Jupyter notebook 4.3.1 introduces protection from cross-site request forgeries, requiring API requests to either:
originate from pages served by this server (validated with XSRF cookie and token), or
authenticate with a token
Some anonymous compute resources still desire the ability to run code, completely without authentication. These services can disable all authentication and security checks, with the full knowledge of what that implies.
- ServerApp.extra_servicesList
Default:
[]
handlers that should be loaded at higher priority than the default services
- ServerApp.extra_static_pathsList
Default:
[]
Extra paths to search for serving static files.
This allows adding javascript/css to be available from the Jupyter server machine, or overriding individual files in the IPython
- ServerApp.extra_template_pathsList
Default:
[]
Extra paths to search for serving jinja templates.
Can be used to override templates from jupyter_server.templates.
- ServerApp.file_to_runUnicode
Default:
''
Open the named file when the application is launched.
- ServerApp.file_url_prefixUnicode
Default:
'notebooks'
The URL prefix where files are opened directly.
- ServerApp.generate_configBool
Default:
False
Generate default config file.
- ServerApp.get_secure_cookie_kwargsDict
Default:
{}
Extra keyword arguments to pass to get_secure_cookie. See tornado’s get_secure_cookie docs for details.
- ServerApp.iopub_data_rate_limitFloat
Default:
1000000
- (bytes/sec)
Maximum rate at which stream output can be sent on iopub before they are limited.
- ServerApp.iopub_msg_rate_limitFloat
Default:
1000
- (msgs/sec)
Maximum rate at which messages can be sent on iopub before they are limited.
- ServerApp.ipUnicode
Default:
'localhost'
The IP address the Jupyter server will listen on.
- ServerApp.jinja_environment_optionsDict
Default:
{}
Supply extra arguments that will be passed to Jinja environment.
- ServerApp.jinja_template_varsDict
Default:
{}
Extra variables to supply to jinja templates when rendering.
- ServerApp.jpserver_extensionsDict
Default:
{}
Dict of Python modules to load as Jupyter server extensions.Entry values can be used to enable and disable the loading ofthe extensions. The extensions will be loaded in alphabetical order.
- ServerApp.kernel_manager_classType
Default:
'jupyter_server.services.kernels.kernelmanager.AsyncMappingKe...
The kernel manager class to use.
- ServerApp.kernel_spec_manager_classType
Default:
'jupyter_client.kernelspec.KernelSpecManager'
The kernel spec manager class to use. Should be a subclass of jupyter_client.kernelspec.KernelSpecManager.
The Api of KernelSpecManager is provisional and might change without warning between this version of Jupyter and the next stable one.
- ServerApp.keyfileUnicode
Default:
''
The full path to a private key file for usage with SSL/TLS.
- ServerApp.local_hostnamesList
Default:
['localhost']
Hostnames to allow as local when allow_remote_access is False.
Local IP addresses (such as 127.0.0.1 and ::1) are automatically accepted as local as well.
- ServerApp.log_datefmtUnicode
Default:
'%Y-%m-%d %H:%M:%S'
The date format used by logging formatters for %(asctime)s
- ServerApp.log_formatUnicode
Default:
'[%(name)s]%(highlevel)s %(message)s'
The Logging format template
- ServerApp.log_levelany of
0``|``10``|``20``|``30``|``40``|``50``|
’DEBUG’|
’INFO’|
’WARN’|
’ERROR’|
’CRITICAL’`` Default:
30
Set the log level by value or name.
- ServerApp.login_handler_classType
Default:
'jupyter_server.auth.login.LoginHandler'
The login handler class to use.
- ServerApp.logout_handler_classType
Default:
'jupyter_server.auth.logout.LogoutHandler'
The logout handler class to use.
- ServerApp.max_body_sizeInt
Default:
536870912
Sets the maximum allowed size of the client request body, specified in the Content-Length request header field. If the size in a request exceeds the configured value, a malformed HTTP message is returned to the client.
Note: max_body_size is applied even in streaming mode.
- ServerApp.max_buffer_sizeInt
Default:
536870912
Gets or sets the maximum amount of memory, in bytes, that is allocated for use by the buffer manager.
- ServerApp.min_open_files_limitInt
Default:
0
Gets or sets a lower bound on the open file handles process resource limit. This may need to be increased if you run into an OSError: [Errno 24] Too many open files. This is not applicable when running on Windows.
- ServerApp.notebook_dirUnicode
Default:
''
DEPRECATED, use root_dir.
- ServerApp.open_browserBool
Default:
False
- Whether to open in a browser after starting.
The specific browser used is platform dependent and determined by the python standard library webbrowser module, unless it is overridden using the –browser (ServerApp.browser) configuration option.
- ServerApp.passwordUnicode
Default:
''
Hashed password to use for web authentication.
To generate, type in a python/IPython shell:
from jupyter_server.auth import passwd; passwd()
The string should be of the form type:salt:hashed-password.
- ServerApp.password_requiredBool
Default:
False
- Forces users to use a password for the Jupyter server.
This is useful in a multi user environment, for instance when everybody in the LAN can access each other’s machine through ssh.
In such a case, serving on localhost is not secure since any user can connect to the Jupyter server via ssh.
- ServerApp.portInt
Default:
0
The port the server will listen on (env: JUPYTER_PORT).
- ServerApp.port_retriesInt
Default:
50
The number of additional ports to try if the specified port is not available (env: JUPYTER_PORT_RETRIES).
- ServerApp.preferred_dirUnicode
Default:
''
Preferred starting directory to use for notebooks and kernels.
- ServerApp.pylabUnicode
Default:
'disabled'
DISABLED: use %pylab or %matplotlib in the notebook to enable matplotlib.
- ServerApp.quit_buttonBool
Default:
True
If True, display controls to shut down the Jupyter server, such as menu items or buttons.
- ServerApp.rate_limit_windowFloat
Default:
3
- (sec) Time window used to
check the message and data rate limits.
- ServerApp.reraise_server_extension_failuresBool
Default:
False
Reraise exceptions encountered loading server extensions?
- ServerApp.root_dirUnicode
Default:
''
The directory to use for notebooks and kernels.
- ServerApp.session_manager_classType
Default:
'jupyter_server.services.sessions.sessionmanager.SessionManager'
The session manager class to use.
- ServerApp.show_configBool
Default:
False
Instead of starting the Application, dump configuration to stdout
- ServerApp.show_config_jsonBool
Default:
False
Instead of starting the Application, dump configuration to stdout (as JSON)
- ServerApp.shutdown_no_activity_timeoutInt
Default:
0
Shut down the server after N seconds with no kernels or terminals running and no activity. This can be used together with culling idle kernels (MappingKernelManager.cull_idle_timeout) to shutdown the Jupyter server when it’s not in use. This is not precisely timed: it may shut down up to a minute later. 0 (the default) disables this automatic shutdown.
- ServerApp.sockUnicode
Default:
''
The UNIX socket the Jupyter server will listen on.
- ServerApp.sock_modeUnicode
Default:
'0600'
The permissions mode for UNIX socket creation (default: 0600).
- ServerApp.ssl_optionsDict
Default:
{}
- Supply SSL options for the tornado HTTPServer.
See the tornado docs for details.
- ServerApp.terminado_settingsDict
Default:
{}
Supply overrides for terminado. Currently only supports “shell_command”.
- ServerApp.terminals_enabledBool
Default:
True
Set to False to disable terminals.
This does not make the server more secure by itself. Anything the user can in a terminal, they can also do in a notebook.
Terminals may also be automatically disabled if the terminado package is not available.
- ServerApp.tokenUnicode
Default:
'<generated>'
Token used for authenticating first-time connections to the server.
The token can be read from the file referenced by JUPYTER_TOKEN_FILE or set directly with the JUPYTER_TOKEN environment variable.
When no password is enabled, the default is to generate a new, random token.
Setting to an empty string disables authentication altogether, which is NOT RECOMMENDED.
- ServerApp.tornado_settingsDict
Default:
{}
Supply overrides for the tornado.web.Application that the Jupyter server uses.
- ServerApp.trust_xheadersBool
Default:
False
Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-For headerssent by the upstream reverse proxy. Necessary if the proxy handles SSL
- ServerApp.use_redirect_fileBool
Default:
True
- Disable launching browser by redirect file
For versions of notebook > 5.7.2, a security feature measure was added that prevented the authentication token used to launch the browser from being visible. This feature makes it difficult for other users on a multi-user system from running code in your Jupyter session as you. However, some environments (like Windows Subsystem for Linux (WSL) and Chromebooks), launching a browser using a redirect file can lead the browser failing to load. This is because of the difference in file structures/paths between the runtime and the browser.
Disabling this setting to False will disable this behavior, allowing the browser to launch by using a URL and visible token (as before).
- ServerApp.webbrowser_open_newInt
Default:
2
- Specify where to open the server on startup. This is the
new argument passed to the standard library method webbrowser.open. The behaviour is not guaranteed, but depends on browser support. Valid values are:
2 opens a new tab,
1 opens a new window,
0 opens in an existing window.
See the webbrowser.open documentation for details.
- ServerApp.websocket_compression_optionsAny
Default:
None
Set the tornado compression options for websocket connections.
This value will be returned from
WebSocketHandler.get_compression_options()
. None (default) will disable compression. A dict (even an empty one) will enable compression.See the tornado docs for WebSocketHandler.get_compression_options for details.
- ServerApp.websocket_urlUnicode
Default:
''
- The base URL for websockets,
if it differs from the HTTP server (hint: it almost certainly doesn’t).
Should be in the form of an HTTP origin: ws[s]://hostname[:port]