# Not beeing able to spawn notebook servers with jupyterhub

**URL:** <https://discourse.jupyter.org/t/not-beeing-able-to-spawn-notebook-servers-with-jupyterhub/34626>\
**Category:** JupyterHub\
**Tags:** jupyterhub, help-wanted, notebook\
**Created:** [April 16, 2025, 5:32pm UTC](https://discourse.jupyter.org/t/not-beeing-able-to-spawn-notebook-servers-with-jupyterhub/34626 "2025-04-16T17:32:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henrique\_Pacheco\_Man](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/henrique_pacheco_man/32/18366_2.png) [@Henrique\_Pacheco\_Man](https://discourse.jupyter.org/u/Henrique_Pacheco_Man)\
**Post date:** [April 16, 2025, 5:32pm UTC](https://discourse.jupyter.org/t/not-beeing-able-to-spawn-notebook-servers-with-jupyterhub/34626/1 "2025-04-16T17:32:08Z")

</div>

I was trying to configure a docker environment where one of my services would be a jupyterhub with pre-customised images. I am using traefik as a reverse proxy because when deploying I will use a domain instead of localhost. Here are my docker-composer and jupyterhub\_config.py

> version: “3.8”
> 
> services:  
> traefik:  
> image: traefik:v3.0  
> command:  
> - “–api.insecure=true”  
> - “–entrypoints.websecure.address=:443”  
> - “–providers.docker=true”  
> - “–providers.file.filename=/etc/traefik\_dynamic.yml”  
> - “–providers.file.watch=true”  
> ports:  
> - “443:443”  
> - “8888:8888”  
> volumes:  
> - “/var/run/docker.sock:/var/run/docker.sock”  
> - “./certs:/certs”  
> - “./traefik\_dynamic.yml:/etc/traefik\_dynamic.yml”  
> networks:  
> - lepocolab-net  
> labels:  
> - “traefik.enable=true”
> 
> lepocolab:  
> build: ./build/lepocolab  
> image: lepocolab/hub  
> container\_name: lepocolab  
> environment:  
> - CONFIGPROXY\_AUTH\_TOKEN=dummytoken  
> volumes:  
> - ./conf:/srv/jupyterhub  
> - ./shared:/home/jovyan/shared  
> - /var/run/docker.sock:/var/run/docker.sock  
> restart: always  
> labels:  
> - “traefik.enable=true”  
> - “traefik.http.routers.jupyterhub.rule=Host(`localhost`) && PathPrefix(`/colab`)”  
> - “traefik.http.routers.jupyterhub.entrypoints=websecure”  
> - “traefik.http.routers.jupyterhub.tls=true”  
> - “traefik.http.services.jupyterhub.loadbalancer.server.port=8888”  
> networks:  
> - lepocolab-net
> 
> networks:  
> lepocolab-net:  
> driver: bridge
> 
> # ---------------------------
> 
> # CONFIGURAÇÃO GERAL DO JUPYTERHUB
> 
> # ---------------------------
> 
> c.JupyterHub.bind\_url = “[http://0.0.0.0:8888/colab](http://0.0.0.0:8888/colab)”  
> c.JupyterHub.cleanup\_servers = False  
> c.JupyterHub.proxy\_api\_url = “[https://localhost/colab/hub/api](https://localhost/colab/hub/api)”  
> c.JupyterHub.proxy\_auth\_token = os.environ[‘CONFIGPROXY\_AUTH\_TOKEN’]  
> c.DockerSpawner.network\_name = ‘lepocolab\_lepocolab-net’ # nome da rede Docker
> 
> # ---------------------------
> 
> # AUTENTICAÇÃO
> 
> # ---------------------------
> 
> c.JupyterHub.authenticator\_class = “dummy”  
> c.DummyAuthenticator.password = “123”
> 
> # ---------------------------
> 
> # DOCKERSPAWNER
> 
> # ---------------------------
> 
> c.JupyterHub.spawner\_class = “dockerspawner.DockerSpawner”
> 
> c.DockerSpawner.allowed\_images = [  
> ‘lepocolab/datascience-notebook:ubuntu-24.04’,  
> ‘lepocolab/pytorch-notebook:ubuntu-24.04’,  
> ‘lepocolab/tensorflow-notebook:ubuntu-24.04’,  
> ]
> 
> c.DockerSpawner.http\_timeout = 300 # Aumentar o tempo de espera para 60 segundos
> 
> c.JupyterHub.log\_level = ‘DEBUG’
> 
> c.DockerSpawner.volumes = {  
> ‘/home/user/jupyterhub/users/{username}/work’: ‘/home/{username}/work’,  
> }
> 
> c.JupyterHubSingleUser.check\_hub\_version = False  
> c.DockerSpawner.api\_url = None # Impede a comunicação com a API do Hub
> 
> c.DockerSpawner.port = 8000  
> c.DockerSpawner.remove = True  
> c.DockerSpawner.extra\_create\_kwargs = {  
> ‘user’: ‘root’  
> }  
> c.DockerSpawner.extra\_host\_config = {  
> ‘mem\_limit’: ‘1G’,  
> ‘memswap\_limit’: ‘1G’  
> }
> 
> # ---------------------------
> 
> # SERVIÇO DE LIMPEZA
> 
> # ---------------------------
> 
> c.JupyterHub.services = [  
> {  
> ‘name’: ‘idle-culler’,  
> ‘admin’: True,  
> ‘command’: [  
> sys.executable,  
> ‘-m’, ‘jupyterhub\_idle\_culler’,  
> ‘–timeout=604800’,  
> ],  
> },  
> ]

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [April 20, 2025, 3:44pm UTC](https://discourse.jupyter.org/t/not-beeing-able-to-spawn-notebook-servers-with-jupyterhub/34626/2 "2025-04-20T15:44:34Z")

</div>

We’ve got an example of deploying JupyterHub with Docker Compose in

> **[jupyterhub-deploy-docker/basic-example at main ·...](https://github.com/jupyterhub/jupyterhub-deploy-docker/tree/main/basic-example)**
>
> Reference deployment of JupyterHub with docker. Contribute to jupyterhub/jupyterhub-deploy-docker development by creating an account on GitHub.

Can you try starting from that example, and iteratively add in your customisations until it breaks? When you get to that point please share your debug logs from JupyterHub. Thanks!
