# jupyterhub/jupyterhub-deploy-docker architecture

> Architecture diagram of the GitHub repository jupyterhub/jupyterhub-deploy-docker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jupyterhub/jupyterhub-deploy-docker
- Repository: https://github.com/jupyterhub/jupyterhub-deploy-docker

## Overview

This repository is a single-host reference deployment of JupyterHub in Docker, intended for demos and small teams or classes. Users access the Hub, sign up through Native Authenticator, and start single-user Notebook servers through DockerSpawner. The deployment also persists Hub state and user notebook directories in Docker volumes. The graph focuses on these runtime responsibilities; the CI token configuration is not part of the product workflow. Relationships for documented but unsampled deployment details cite the README.

Main entry points: [`basic-example/jupyterhub_config.py`](https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py) (JupyterHub), [`basic-example/docker-compose.yml`](https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/docker-compose.yml) (Compose deployment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Host deployment"]
  node_compose["Compose deployment<br/>[docker-compose.yml]"]
  node_dockerhost["Docker host"]
  node_image["Notebook image"]
end

subgraph group_hub["Hub services"]
  node_hub["JupyterHub"]
  node_auth["Native Authenticator"]
  node_spawner["DockerSpawner"]
  node_notebooks["Notebook servers"]
end

subgraph group_persistence["Persistent data"]
  node_hubdata[("Hub data volume")]
  node_userdata[("User notebook volumes")]
end

node_user(("User"))

node_user -->|"accesses"| node_hub
node_compose -->|"runs on"| node_dockerhost
node_hub -->|"authenticates with"| node_auth
node_hub -->|"dispatches to"| node_spawner
node_spawner -->|"spawns"| node_notebooks
node_spawner -->|"uses"| node_image
node_spawner -->|"mounts"| node_userdata
node_hub -->|"persists state"| node_hubdata
node_dockerhost -->|"provides volume"| node_hubdata
node_dockerhost -->|"provides volumes"| node_userdata

click node_compose "https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/docker-compose.yml"
click node_hub "https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py"
click node_auth "https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py"
click node_spawner "https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py"
click node_notebooks "https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py"
click node_image "https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py"
click node_hubdata "https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py"
click node_userdata "https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_compose,node_dockerhost,node_image,node_user toneBlue
class node_hub,node_auth,node_spawner,node_notebooks toneAmber
class node_hubdata,node_userdata toneMint
```

## Components

### Host deployment

- [Compose deployment](https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/docker-compose.yml): `basic-example/docker-compose.yml`
- **Docker host**
- [Notebook image](https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py): `basic-example/jupyterhub_config.py`

### Hub services

- [JupyterHub](https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py): `basic-example/jupyterhub_config.py`
- [Native Authenticator](https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py): `basic-example/jupyterhub_config.py`
- [DockerSpawner](https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py): `basic-example/jupyterhub_config.py`
- [Notebook servers](https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py): `basic-example/jupyterhub_config.py`

### Persistent data

- [Hub data volume](https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py): `basic-example/jupyterhub_config.py`
- [User notebook volumes](https://github.com/jupyterhub/jupyterhub-deploy-docker/blob/main/basic-example/jupyterhub_config.py): `basic-example/jupyterhub_config.py`

### Other components

- **User**

## Connections

- User → JupyterHub: accesses (evidence: `README.md`)
- Compose deployment → Docker host: runs on (evidence: `README.md`)
- JupyterHub → Native Authenticator: authenticates with (evidence: `basic-example/jupyterhub_config.py`)
- JupyterHub → DockerSpawner: dispatches to (evidence: `basic-example/jupyterhub_config.py`)
- DockerSpawner → Notebook servers: spawns (evidence: `README.md`)
- DockerSpawner → Notebook image: uses (evidence: `basic-example/jupyterhub_config.py`)
- DockerSpawner → User notebook volumes: mounts (evidence: `basic-example/jupyterhub_config.py`)
- JupyterHub → Hub data volume: persists state (evidence: `basic-example/jupyterhub_config.py`)
- Docker host → Hub data volume: provides volume (evidence: `README.md`)
- Docker host → User notebook volumes: provides volumes (evidence: `README.md`)
