Jupyter Notebook stores persistent server settings in a user configuration directory, so generating the base file is the first step before changing ports, authentication, browser launch behavior, working directory, or HTTPS settings. Notebook 7 runs on Jupyter Server behind the Notebook interface, so server settings belong in jupyter_server_config.py.
The jupyter server command creates the config file in the active Jupyter config directory, usually ~/.jupyter for a user account. The generated file is a Python config file with commented c.ServerApp settings that can be uncommented later when a specific setting needs to persist.
Generating the file does not change how Notebook starts until a setting is uncommented or added. If jupyter_server_config.py already exists, Jupyter prompts before overwriting it, so keep a backup before replacing a file that already contains custom settings.
$ jupyter --config-dir /home/user/.jupyter
$ jupyter server --generate-config Writing default config to: '/home/user/.jupyter/jupyter_server_config.py'
If the file already exists, choose overwrite only after saving any custom settings that should remain.
$ grep -n "c.ServerApp.port" ~/.jupyter/jupyter_server_config.py 491:# c.ServerApp.port = 0 496:# c.ServerApp.port_retries = 50
ServerApp is the Jupyter Server configuration class used by Notebook 7. Leave generated lines commented until a setting needs to be enabled.
$ grep -n "c.ServerApp.root_dir" ~/.jupyter/jupyter_server_config.py 523:# c.ServerApp.root_dir = ''