# Customizing /hub/login page?

**URL:** <https://discourse.jupyter.org/t/customizing-hub-login-page/33308>\
**Category:** JupyterHub\
**Created:** [February 27, 2025, 7:38pm UTC](https://discourse.jupyter.org/t/customizing-hub-login-page/33308 "2025-02-27T19:38:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asmacdo](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/asmacdo/32/12899_2.png) [@asmacdo](https://discourse.jupyter.org/u/asmacdo)\
**Post date:** [February 27, 2025, 7:38pm UTC](https://discourse.jupyter.org/t/customizing-hub-login-page/33308/1 "2025-02-27T19:38:11Z")

</div>

I’ve been asked to add some text to our /hub/login page.

I’m using Z2JH. First of all, is there a way to modify the login html (and possibly other web templates) in config only?

If not, could I get a sanity check on my naive approach below?

1. the actual code that I’d modify would be here (or, at least somewhere in this repo) [jupyterhub/share/jupyterhub/templates/login.html at 3885affd68ad348a28736d03034351c2f6ebdc95 · jupyterhub/jupyterhub · GitHub](https://github.com/jupyterhub/jupyterhub/blob/3885affd68ad348a28736d03034351c2f6ebdc95/share/jupyterhub/templates/login.html)

2. then I’d modify the Hub image [zero-to-jupyterhub-k8s/images/hub/Dockerfile at 6eedd18bfdee593f8d5bd538b665c3be1847efdf · jupyterhub/zero-to-jupyterhub-k8s · GitHub](https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/6eedd18bfdee593f8d5bd538b665c3be1847efdf/images/hub/Dockerfile) to use my custom jupyterhub/jupyterhub code.

3. then I’d use that hub image in the jupyterhub config. [Configuration Reference — Zero to JupyterHub with Kubernetes documentation](https://z2jh.jupyter.org/en/stable/resources/reference.html#hub-image)

---

<div class="post-metadata">

**Author:** ![mahendrapaipuri](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mahendrapaipuri/32/6800_2.png) [@mahendrapaipuri](https://discourse.jupyter.org/u/mahendrapaipuri)\
**Post date:** [February 27, 2025, 8:52pm UTC](https://discourse.jupyter.org/t/customizing-hub-login-page/33308/2 "2025-02-27T20:52:16Z")

</div>

Here are the [docs](https://jupyterhub.readthedocs.io/en/latest/howto/templates.html) for customizing HTML templates. Here is an [example](https://gitlab.com/idris-cnrs/jupyter/jupyter-jeanzay-spawner/-/tree/main/share/jupyterhub/custom-templates?ref_type=heads) for the reference!

---

<div class="post-metadata">

**Author:** ![asmacdo](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/asmacdo/32/12899_2.png) [@asmacdo](https://discourse.jupyter.org/u/asmacdo)\
**Post date:** [February 27, 2025, 10:14pm UTC](https://discourse.jupyter.org/t/customizing-hub-login-page/33308/3 "2025-02-27T22:14:00Z")

</div>

@mahendrapaipuri thanks you! I suppose I don’t actually need to carry a jupyterhub/jupyterhub fork if I can add template\_paths into the config.

The awkward problem remains how to get that config to work with z2jh-- but I’ve now found [Smooth JupyterHub template customization · Issue #1266 · jupyterhub/zero-to-jupyterhub-k8s · GitHub](https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues/1266). When we find the time to try this out, maybe it would be useful to add a section to the z2jh customization guide? [Customization Guide — Zero to JupyterHub with Kubernetes documentation](https://z2jh.jupyter.org/en/stable/jupyterhub/customization.html)

---

<div class="post-metadata">

**Author:** ![mahendrapaipuri](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mahendrapaipuri/32/6800_2.png) [@mahendrapaipuri](https://discourse.jupyter.org/u/mahendrapaipuri)\
**Post date:** [February 28, 2025, 7:53am UTC](https://discourse.jupyter.org/t/customizing-hub-login-page/33308/4 "2025-02-28T07:53:19Z")

</div>

I guess that issue you mentioned is outdated? I mean, you can put custom templates in a persistent volume and set proper permissions so that user running JupyterHub inside the container can read them. We will not need an init container to do that job. Is it not the case?

---

<div class="post-metadata">

**Author:** ![Paul2708](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/paul2708/32/14207_2.png) [@Paul2708](https://discourse.jupyter.org/u/Paul2708)\
**Post date:** [February 28, 2025, 9:35am UTC](https://discourse.jupyter.org/t/customizing-hub-login-page/33308/5 "2025-02-28T09:35:00Z")

</div>

We pass the custom templates via [hub.extraFiles](https://z2jh.jupyter.org/en/latest/resources/reference.html#hub-extrafiles).  
Thus, we can pass the templates during the Helm deployment, which does not require an extra volume.

**config.yaml**

```auto
hub:
  extraFiles:
    landing_page:
      mountPath: /usr/local/share/jupyterhub/templates/login.html

```

**(Local) ./templates/login.html**

```auto
{% extends "page.html" %}
...

```

**Deployment**

```bash
helm upgrade --cleanup-on-fail \
  --install jupyterhub jupyterhub/jupyterhub \
  --namespace dev \
  --version 4.1.0 \
  --values config.yaml \
  --set-file hub.extraFiles.landing_page.stringData=./templates/login.html

```
