---
title: Deploy Jupyter Notebook with AI on Blossom
url: "/deploy/jupyter-notebook/"
canonical_url: https://blossom88.com/deploy/jupyter-notebook/
markdown_url: https://blossom88.com/deploy/jupyter-notebook.md
summary: Run a private Python notebook, save the results, and reopen them after an
  update.
categories:
- deployment
- development
stack:
- Python
- Jupyter Server
- Jupyter Notebook
---

# Deploy Jupyter Notebook with AI on Blossom

[Jupyter Notebook](https://jupyter.org/) lets you run Python cells and
save the results alongside your notes. Start with three days of sample
workshop check-ins.

## Ask Your Agent

> **Ask your AI agent:** Deploy Jupyter Notebook on Blossom and help me run a small private Python notebook.
>
> Follow this guide: https://blossom88.com/deploy/jupyter-notebook/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and choose a Blossom Cloud Location when you log in. You can also use [Blossom BYOC (bring your own cloud)](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#blossom-byoc).

## How It Runs

| Part | Role | Where |
|---|---|---|
| Jupyter Notebook | Serve the browser editor and run Python cells | Persistent Service with Blossom Account access |
| Notebook directory | Store notebook files and saved cell output | Service Volume |

## Deploy Jupyter Notebook

Give the workspace a Volume and keep it behind Blossom Account access.
Require a Jupyter token so the people who work there can sign in.

<details class="optional-reading" markdown="1">
<summary>Notes for your agent</summary>

Use the [Jupyter Docker Stacks base image](https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html).
Set `DOCKER_STACKS_JUPYTER_CMD=notebook`, run the server on port
`8888`, and mount `/home/jovyan/work` as the Volume and server root.
Run with the image's `jovyan` user. Set `JUPYTER_TOKEN_FILE` to a private
file written from a runtime secret. Keep the token out of logs and
URLs. Use `/login` for the HTTP health check.

</details>

<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom app_plan:preview --data jupyter-notebook-plan.yml
    blossom service:create --data jupyter-notebook-service.yml
    blossom environment:deploy --id environment-100 --follow

</details>

## Make a Small Python Notebook

Create a notebook for three days of workshop check-ins. Write a Python
cell that prints the total and mean.

> **Ask your AI agent:** Make a Python notebook that totals three days of sample workshop check-ins.

> Follow this guide: https://blossom88.com/deploy/jupyter-notebook/



## Run the Cell and Save the Output

Sign in to the workspace and run the cell. The sample should show
18 check-ins in total and a mean of 6.0 per day. Save the notebook.

![Run the workshop check-in calculation in Jupyter Notebook.](/deploy/assets/images/jupyter-notebook/run-workshop-notebook.webp)

> **Ask your AI agent:** Help me run the check-in notebook and save the results.

> Follow this guide: https://blossom88.com/deploy/jupyter-notebook/



## Reopen It After a Deploy

Replace the Notebook Container. Reopen the file and check that the
saved code and cell output are still there.

![Find the saved notebook after Container replacement.](/deploy/assets/images/jupyter-notebook/saved-notebook-after-replacement.webp)


> **Ask your AI agent:** Replace the Jupyter Notebook Container and help me reopen the saved results.

> Follow this guide: https://blossom88.com/deploy/jupyter-notebook/



## What You Get

- A private workspace for Python notebooks
- A notebook with saved sample calculations
- A notebook you can reopen after a deploy

Tested on Blossom: The saved Python cell and its results were available after Container replacement.
