# What is a Jupyter kernel? A Jupyter kernel is the process that runs a notebook's code and keeps its state between cells. The notebook page in your browser only sends text and shows results. The kernel, a separate process, usually IPython, runs each cell and holds every variable, import and function the cells have made. When the kernel stops, that state is gone, even though the notebook file and its saved outputs remain. **On Runtime, a notebook keeps its kernels in memory while it is paused. A cell run after the pause still sees the variables from before it, with no restart and no re-run of earlier cells.** A paused notebook resumes on the next visit or the next cell ([Notebooks](/docs/notebooks)). ## How a kernel talks to the notebook Jupyter splits the work in three: | Part | What it does | | -------------- | ---------------------------------------------------------------- | | Front end | JupyterLab or Notebook in the browser: edits cells, shows output | | Jupyter server | Saves files, starts and stops kernels, relays messages | | Kernel | Runs code and keeps its state in its own memory | The server and the kernel exchange messages over ZeroMQ, using the Jupyter messaging protocol: `execute_request` carries a cell's code, and replies carry its output, its result and any error. Because a kernel is just a process that speaks this protocol, kernels exist for many languages. `ipykernel` is the Python one. ## What lives in the kernel and what does not - **In the kernel:** variables, loaded DataFrames, imported modules, open connections, the execution count shown as `[3]` beside a cell. - **In the notebook file (`.ipynb`):** the cells' source and the outputs that were saved. Opening a file does not bring its variables back. - **On disk:** the data files the code reads and writes. That is why "Restart kernel and run all" exists: after a restart the file still shows old outputs, but nothing is defined until the cells run again. ## When a kernel's state is lost | Event | Kernel state | | ------------------------------------- | --------------------------------- | | Restart kernel | Lost | | Out of memory | Lost; the kernel dies | | The machine stops or reboots | Lost | | The browser tab closes | Kept; the server keeps the kernel | | A Runtime notebook pauses and resumes | Kept, with the machine's memory | ## See it keep state across a pause This runs a cell, pauses the notebook, and runs a second cell that reads the first cell's variable. `started` is `false` on the second cell: the same kernel answered it. ```bash no-run API=https://api.withruntime.com AUTH="Authorization: Bearer $RUNTIME_API_KEY" JSON="Content-Type: application/json" id=$(curl -sf -X POST "$API/v2/notebooks" -H "$AUTH" -H "$JSON" -d '{}' | jq -r .id) curl -s -X POST "$API/v2/notebooks/${id}:runCode" -H "$AUTH" -H "$JSON" \ -d '{"code": "import pandas as pd\nsales = pd.Series([125, 250, 375])\nsales.sum()"}' \ | jq -c '{started, executionCount, value: .results[0].text}' # {"started":true,"executionCount":1,"value":"750"} curl -s -X POST "$API/v2/notebooks/${id}:pause" -H "$AUTH" -H "$JSON" -d '{}' | jq -r .state # paused curl -s -X POST "$API/v2/notebooks/${id}:runCode" -H "$AUTH" -H "$JSON" \ -d '{"code": "print(sales.mean())"}' | jq -c '{started, executionCount, stdout}' # {"started":false,"executionCount":2,"stdout":"250.0\n"} curl -s -X DELETE "$API/v2/notebooks/${id}" -H "$AUTH" > /dev/null ``` Each `context` in [`runCode`](/docs/reference/notebooks#runcode) is a kernel of its own. Two contexts on one notebook do not share variables. ## Related - [How to run Jupyter in the cloud](/how-to/run-jupyter-in-the-cloud) - [How to set up a cloud development environment](/how-to/set-up-a-cloud-dev-environment) - [How to open VS Code in the browser](/how-to/open-vs-code-in-the-browser) - [What is a memory snapshot?](/glossary/memory-snapshot) - [What is idle pause?](/glossary/idle-pause) ## Sources - [Jupyter: Messaging in Jupyter](https://jupyter-client.readthedocs.io/en/stable/messaging.html), read 17 November 2026 Facts on this page were checked on 17 November 2026.