From 34fab033fe196c648ad77d728b84277ff6ee6f11 Mon Sep 17 00:00:00 2001 From: Jason Williams Date: Tue, 12 Jun 2018 16:59:17 -0400 Subject: [PATCH] Jupyterhub on Docker add workaround for `unable to connect to localhost` Added a command that worked for me to fix the situation that localhost:8000 is unable to reach the hub even though the published command for Docker exposes the correct port. --- docs/source/troubleshooting.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/source/troubleshooting.md b/docs/source/troubleshooting.md index 3d6007bf..533a15cf 100644 --- a/docs/source/troubleshooting.md +++ b/docs/source/troubleshooting.md @@ -9,6 +9,7 @@ problem and how to resolve it. - sudospawner fails to run - What is the default behavior when none of the lists (admin, whitelist, group whitelist) are set? +- JupyterHub Docker container not accessible at localhost [*Errors*](#errors) - 500 error after spawning my single-user server @@ -63,6 +64,17 @@ this to a particular set of users, and the admin_users lets you specify who among them may use the admin interface (not necessary, unless you need to do things like inspect other users' servers, or modify the userlist at runtime). +### JupyterHub Docker container not accessible at localhost + +Even though the command to start your Docker container exposes port 8000 +(`docker run -p 8000:8000 -d --name jupyterhub jupyterhub/jupyterhub jupyterhub`), +is possible that the IP address itself is not accessible/visible. As a result +when you try http://localhost:8000 in your browser, you are unable to connect +even though the container is running properly. One workaround is to explicitly +tell Jupyterhub to start at `0.0.0.0` which is visible to everyone. Try this +command: +`docker run -p 8000:8000 -d --name jupyterhub jupyterhub/jupyterhub jupyterhub --ip 0.0.0.0 --port 8000` + ## Errors