PyCharm 2025.1 Help

Manage Jupyter notebook servers

In PyCharm, you can execute code cells using the following server types:

  • Managed server – a Jupyter server that is automatically launched by PyCharm for the current project. It will be terminated when you close PyCharm.

  • Configured server – any Jupyter server that you connect to by specifying its URL and token. It can run on either your local or remote machines.

Add a Jupyter server

  1. Go to Tools | Add Jupyter Connection...

    Alternatively, right-click the project directory and select New | Jupyter connection from the context menu.

  2. In the window that opens, click Add Jupyter Connection Add Jupyter Connection or press Alt+Insert.

    Add Jupyter Connection
  3. Choose the type of server you want to create. For more information on configuring specific servers, refer to Set up a managed server and Set up a configured server.

  4. Click Apply if you want the newly created server to be automatically selected for your current notebook.

    Alternatively, click OK to save the changes without selecting the new server.

Add a Jupyter server

Set up a managed server

  1. Click the list of servers on the Jupyter notebook toolbar and select Configure Jupyter Server from the context menu.

    Configure Jupyter Server
  2. In the window that opens, choose Managed server.

  3. In the Name field, set the name for your managed server.

  4. Set the server settings using the Command line arguments field.

  5. Set Environment variables and assign values to them.

  6. Jupyter servers can be secured either with a token (included in the URL) or a user-defined password. If the Jupyter server is secured with a password, enter it in the Password field.

    For more information, refer to Security in the Jupyter notebook server.

  7. Click OK to apply the changes and close the window, or click Apply to keep the window open.

Set up a managed server

Set up a configured server

  1. Click the list of servers on the Jupyter notebook toolbar and select Configure Jupyter Server from the context menu.

    Configure Jupyter Server

    Alternatively, right-click the server in the Project view Alt+1 and select Configure Jupyter Server from the context menu.

  2. In the window that opens, choose Configured server.

  3. In the Name field, set the name for your remote server.

  4. In the Server URL field, specify the address to establish a connection to a remote Jupyter server. The target URL should contain a server name or its address and the access token.

    Alternatively, click Discover local servers to automatically detect available Jupyter instances on the local machine. If a server is found, the URL and token will be filled in automatically.

  5. Under Type, select the required server type.

    Use this option to connect to a standard Jupyter Notebook or JupyterLab instance, running locally or on a remote machine.

    Provide the required authentication token or password.

    Notebook/Lab

    Use this option to connect to a JupyterHub instance.

    Provide one of the following:

    • Your username, password, and the URL of the hub, if authentication is done by using login credentials.

    • Direct URL to a running Jupyter notebook server that includes the access token if token-based authentication is used.

    Hub

    Use this option to connect to an AWS SageMaker instance or another cloud solution.

    No token is required, you can use the presigned URL directly.

    AWS SageMaker
  6. If the server requires a proxy connection, select the Use IDE Proxy checkbox.

    Refer to the HTTP proxy page to configure the corresponding settings.

  7. Click Test connection to verify the setup.

  8. Click OK to apply the changes and close the window, or click Apply to keep the window open.

Set up a configured server

Manage remote server files

When a configured Jupyter server is connected, its files appear in the Project View. You can create, open, edit, and delete files from the remote Jupyter server as if they were part of your local project. For example:

  • To add a file, right-click the Remote server directory or a package within it and select New from the context menu. Select the required file type.

    For more information, refer to Create new files.

    Add a remote server file
  • To delete a file, right-click it in the Remote server directory and select Delete Delete from the context menu.

    Delete remote server file

    Remove a Jupyter server

    • Go to Settings | Languages & Frameworks | Jupyter | Jupyter Servers.

      In the window that opens, select the server you want to remove and click Remove Configured Server Remove Configured Server or press Delete.

      Remove a Jupyter server
    • Alternatively, to remove a remote server, right-click the server in the Project view Alt+1 and select Delete Delete from the context menu.

    Launch a local Jupyter server

    1. Click the list of servers on the Jupyter notebook toolbar and select the server that you want to launch from the context menu.

    2. To run a Jupyter server, execute any code cell. When you initiate cell execution, PyCharm launches a Jupyter server on the local host using any available port (by default, it is the 8888 port). You can switch to the Jupyter Server tool window to preview the server's configuration details.

    Jupyter server is running. Jupyter tool window

    Once the server is launched, it is shown as a managed server in the list of the servers in the Jupyter notebook toolbar.

    Stop the Jupyter server

    To stop any running server, switch to the Jupyter Server tool window and click Stop Jupyter server Stop Jupyter server. Preview the status in the Server Log window.

    Stopping the server

    Once you have shut down the server, the current session is terminated. When you start the server next time, execution results for all previous sessions and all notebooks will be lost.

      Kernel actions

      Restart kernel

      You might want to refresh your calculations without shutting down the entire server and affecting any other notebooks. To restart the currently running kernel, click Kernels on the Jupyter notebook toolbar. You can then view the kernel status in the Server Log window:

      Restarting the current kernel

        Shutdown kernel

        To completely stop a running kernel, open the list of servers on the Jupyter notebook toolbar and select Shutdown Kernel from the context menu. This action will terminate the current kernel session.

        Shutdown the kernel

          Switch kernel

          If you have at least two kernels available, and you need to switch to a different kernel, open the list of servers on the Jupyter notebook toolbar. Select Switch Kernel from the context menu, and choose the required kernel from the dropdown list.

          Switch the kernel

            Connect kernel to server

            After selecting a remote Jupyter server and opening a notebook, the kernel list becomes available automatically after the first cell is run.

            However, you can manually connect to the server before running any cells. After you launch the configured server, open the list of servers on the Jupyter notebook toolbar and select Connect to Server from the context menu. This will establish the connection between the kernel and the Jupyter server.

            Connect the kernel to the server
              Last modified: 14 May 2025