# Self-host JupyterHub

> Multi user server that manages and proxies notebook servers. The install form carries jupyterhub_config.py as an editable file with a generated shared password, so it starts with a working login.

- Page: https://levelrail.com/templates/jupyterhub/
- JSON: https://levelrail.com/templates/jupyterhub.json
- Category: Developer Tools
- Licence: BSD-3-Clause (Permissive license)
- Source: https://github.com/jupyterhub/jupyterhub
- Upstream docs: https://jupyterhub.readthedocs.io/

## Requirements
- Memory: about 256 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 5.4.0

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| jupyterhub | quay.io/jupyterhub/jupyterhub | 5.4.0 | 8000 | data -> /srv/jupyterhub/state |

## Deploy

### CLI

```bash
levelrail-cli templates install jupyterhub --name my-jupyterhub
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain jupyterhub=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/jupyterhub/install \
  -d '{
    "name": "my-jupyterhub"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## First run
1. Sign in as admin with the generated password shown in the deployment variables, then edit the config file setting to change the authenticator and spawner.

## Questions

### Can I deploy JupyterHub on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for JupyterHub, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image quay.io/jupyterhub/jupyterhub:5.4.0 is what you deploy there.

Self-host JupyterHub, JupyterHub docker compose file, deploy JupyterHub on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
