[{"data":1,"prerenderedAt":787},["ShallowReactive",2],{"content-query-VpbUPrqAeW":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"layout":10,"crumb":11,"summary":12,"group":13,"order":14,"port":15,"updated":16,"cta":17,"related":25,"faq":44,"body":57,"_type":780,"_id":781,"_source":782,"_file":783,"_stem":784,"_extension":785,"sitemap":786},"/localhost/8888","localhost",false,"","localhost:8888: the Jupyter Notebook port and how to fix it","localhost:8888 is the default port for Jupyter Notebook and JupyterLab. Fix 'refused to connect', token prompts and busy ports, and reach Jupyter remotely.","reference","localhost:8888","Jupyter Notebook and JupyterLab.","Data, AI and automation",10,8888,"2026-10-28",{"eyebrow":18,"title":19,"text":20,"to":21,"label":22,"secondaryTo":23,"secondaryLabel":24},"Webhook Relay Tunnels","Open a remote Jupyter server over HTTPS","relay connect gives a Jupyter server on a workstation or GPU box a stable HTTPS URL, with no inbound ports or public IP. Keep Jupyter's token or password on: the tunnel makes the server reachable, Jupyter's own auth decides who gets in.","/tunnels/","Explore Tunnels","/blog/dotscience-tunnels-jupyter/","Tunnels for data science",[26,29,32,35,38,41],{"title":27,"to":28},"localhost:11434 (Ollama)","/localhost/11434/",{"title":30,"to":31},"localhost:8000","/localhost/8000/",{"title":33,"to":34},"localhost:5432 (PostgreSQL)","/localhost/5432/",{"title":36,"to":37},"127.0.0.1 and the loopback address","/localhost/127-0-0-1/",{"title":39,"to":40},"401 vs 403","/http-errors/401-vs-403/",{"title":42,"to":43},"What is a tunnel?","/glossary/tunnel/",[45,48,51,54],{"q":46,"a":47},"What is localhost:8888?","localhost:8888 is the default port of Jupyter Notebook and JupyterLab. Running jupyter lab or jupyter notebook starts a server on http://localhost:8888 and opens it in your browser with a login token in the URL.",{"q":49,"a":50},"How do I find my Jupyter token?","Run jupyter server list (or jupyter notebook list on older installs). It prints each running server with its URL and token. The token is also printed in the terminal when the server starts.",{"q":52,"a":53},"Why is Jupyter on 8889 instead of 8888?","Another Jupyter server already holds port 8888, so the new one moved to the next free port. Stop the old server with jupyter server stop 8888 or pass --port to choose a port yourself.",{"q":55,"a":56},"How do I access Jupyter on a remote server?","The safest way is an SSH tunnel: run ssh -L 8888:localhost:8888 user@server, then open http://localhost:8888 on your own machine. Start Jupyter on the server with --no-browser and keep token or password authentication enabled.",{"type":58,"children":59,"toc":772},"root",[60,104,111,225,230,236,365,371,400,406,508,541,569,575,580,588,661,673,699,705,710,745,766],{"type":61,"tag":62,"props":63,"children":64},"element","p",{},[65,78,80,86,88,94,96,102],{"type":61,"tag":66,"props":67,"children":68},"strong",{},[69,76],{"type":61,"tag":70,"props":71,"children":73},"code",{"className":72},[],[74],{"type":75,"value":11},"text",{"type":75,"value":77}," is the default port of Jupyter Notebook and JupyterLab.",{"type":75,"value":79}," Running ",{"type":61,"tag":70,"props":81,"children":83},{"className":82},[],[84],{"type":75,"value":85},"jupyter lab",{"type":75,"value":87}," or ",{"type":61,"tag":70,"props":89,"children":91},{"className":90},[],[92],{"type":75,"value":93},"jupyter notebook",{"type":75,"value":95}," starts a server on ",{"type":61,"tag":70,"props":97,"children":99},{"className":98},[],[100],{"type":75,"value":101},"http://localhost:8888",{"type":75,"value":103}," and opens your browser with a one-time token in the URL. If the page refuses to connect, the server isn't running; if it asks for a password or token, the server is running and wants you to log in.",{"type":61,"tag":105,"props":106,"children":108},"h2",{"id":107},"what-runs-on-port-8888",[109],{"type":75,"value":110},"What runs on port 8888",{"type":61,"tag":112,"props":113,"children":114},"table",{},[115,139],{"type":61,"tag":116,"props":117,"children":118},"thead",{},[119],{"type":61,"tag":120,"props":121,"children":122},"tr",{},[123,129,134],{"type":61,"tag":124,"props":125,"children":126},"th",{},[127],{"type":75,"value":128},"Tool",{"type":61,"tag":124,"props":130,"children":131},{},[132],{"type":75,"value":133},"Command",{"type":61,"tag":124,"props":135,"children":136},{},[137],{"type":75,"value":138},"Notes",{"type":61,"tag":140,"props":141,"children":142},"tbody",{},[143,165,185,207],{"type":61,"tag":120,"props":144,"children":145},{},[146,152,160],{"type":61,"tag":147,"props":148,"children":149},"td",{},[150],{"type":75,"value":151},"JupyterLab",{"type":61,"tag":147,"props":153,"children":154},{},[155],{"type":61,"tag":70,"props":156,"children":158},{"className":157},[],[159],{"type":75,"value":85},{"type":61,"tag":147,"props":161,"children":162},{},[163],{"type":75,"value":164},"Default 8888",{"type":61,"tag":120,"props":166,"children":167},{},[168,173,181],{"type":61,"tag":147,"props":169,"children":170},{},[171],{"type":75,"value":172},"Jupyter Notebook",{"type":61,"tag":147,"props":174,"children":175},{},[176],{"type":61,"tag":70,"props":177,"children":179},{"className":178},[],[180],{"type":75,"value":93},{"type":61,"tag":147,"props":182,"children":183},{},[184],{"type":75,"value":164},{"type":61,"tag":120,"props":186,"children":187},{},[188,193,202],{"type":61,"tag":147,"props":189,"children":190},{},[191],{"type":75,"value":192},"Jupyter Docker Stacks",{"type":61,"tag":147,"props":194,"children":195},{},[196],{"type":61,"tag":70,"props":197,"children":199},{"className":198},[],[200],{"type":75,"value":201},"docker run -p 8888:8888 quay.io/jupyter/scipy-notebook",{"type":61,"tag":147,"props":203,"children":204},{},[205],{"type":75,"value":206},"Token printed in container logs",{"type":61,"tag":120,"props":208,"children":209},{},[210,215,220],{"type":61,"tag":147,"props":211,"children":212},{},[213],{"type":75,"value":214},"VS Code Jupyter (remote kernel)",{"type":61,"tag":147,"props":216,"children":217},{},[218],{"type":75,"value":219},"Connects to an existing server",{"type":61,"tag":147,"props":221,"children":222},{},[223],{"type":75,"value":224},"Uses the server's URL and token",{"type":61,"tag":62,"props":226,"children":227},{},[228],{"type":75,"value":229},"A second server moves to 8889, 8890 and so on.",{"type":61,"tag":105,"props":231,"children":233},{"id":232},"fix-localhost8888-refused-to-connect",[234],{"type":75,"value":235},"Fix \"localhost:8888 refused to connect\"",{"type":61,"tag":237,"props":238,"children":239},"ol",{},[240,259,314,340],{"type":61,"tag":241,"props":242,"children":243},"li",{},[244,249,251,257],{"type":61,"tag":66,"props":245,"children":246},{},[247],{"type":75,"value":248},"Is the server running?",{"type":75,"value":250}," The terminal shows ",{"type":61,"tag":70,"props":252,"children":254},{"className":253},[],[255],{"type":75,"value":256},"Jupyter Server ... is running at: http://localhost:8888/lab?token=...",{"type":75,"value":258},". If you closed that terminal, the server stopped with it.",{"type":61,"tag":241,"props":260,"children":261},{},[262,267,300,304,306,312],{"type":61,"tag":66,"props":263,"children":264},{},[265],{"type":75,"value":266},"List running servers:",{"type":61,"tag":268,"props":269,"children":273},"pre",{"className":270,"code":271,"language":272,"meta":7,"style":7},"language-bash shiki shiki-themes github-dark","jupyter server list\n","bash",[274],{"type":61,"tag":70,"props":275,"children":276},{"__ignoreMap":7},[277],{"type":61,"tag":278,"props":279,"children":282},"span",{"class":280,"line":281},"line",1,[283,289,295],{"type":61,"tag":278,"props":284,"children":286},{"style":285},"--shiki-default:#B392F0",[287],{"type":75,"value":288},"jupyter",{"type":61,"tag":278,"props":290,"children":292},{"style":291},"--shiki-default:#9ECBFF",[293],{"type":75,"value":294}," server",{"type":61,"tag":278,"props":296,"children":297},{"style":291},[298],{"type":75,"value":299}," list\n",{"type":61,"tag":301,"props":302,"children":303},"br",{},[],{"type":75,"value":305},"This shows each server's actual port and token. On older installs use ",{"type":61,"tag":70,"props":307,"children":309},{"className":308},[],[310],{"type":75,"value":311},"jupyter notebook list",{"type":75,"value":313},".",{"type":61,"tag":241,"props":315,"children":316},{},[317,322,324,330,332,338],{"type":61,"tag":66,"props":318,"children":319},{},[320],{"type":75,"value":321},"Docker.",{"type":75,"value":323}," Use the ",{"type":61,"tag":70,"props":325,"children":327},{"className":326},[],[328],{"type":75,"value":329},"http://127.0.0.1:8888/lab?token=...",{"type":75,"value":331}," line from ",{"type":61,"tag":70,"props":333,"children":335},{"className":334},[],[336],{"type":75,"value":337},"docker logs \u003Ccontainer>",{"type":75,"value":339},". The hostname-based URL in the logs points to the container's own name, which your browser can't resolve.",{"type":61,"tag":241,"props":341,"children":342},{},[343,348,350,355,357,363],{"type":61,"tag":66,"props":344,"children":345},{},[346],{"type":75,"value":347},"WSL2.",{"type":75,"value":349}," Recent WSL forwards ",{"type":61,"tag":70,"props":351,"children":353},{"className":352},[],[354],{"type":75,"value":5},{"type":75,"value":356}," to Windows. If it doesn't, start with ",{"type":61,"tag":70,"props":358,"children":360},{"className":359},[],[361],{"type":75,"value":362},"--ip 0.0.0.0",{"type":75,"value":364}," and use the WSL IP.",{"type":61,"tag":105,"props":366,"children":368},{"id":367},"password-or-token-page",[369],{"type":75,"value":370},"\"Password or token\" page",{"type":61,"tag":62,"props":372,"children":373},{},[374,376,382,384,390,392,398],{"type":75,"value":375},"That page means you reached Jupyter without the token. Copy the full URL including ",{"type":61,"tag":70,"props":377,"children":379},{"className":378},[],[380],{"type":75,"value":381},"?token=...",{"type":75,"value":383}," from the terminal or ",{"type":61,"tag":70,"props":385,"children":387},{"className":386},[],[388],{"type":75,"value":389},"jupyter server list",{"type":75,"value":391},", or set a password once with ",{"type":61,"tag":70,"props":393,"children":395},{"className":394},[],[396],{"type":75,"value":397},"jupyter server password",{"type":75,"value":399},". Don't \"fix\" this by disabling authentication. A Jupyter server runs arbitrary code as your user, so anyone who can reach it without a token owns the machine.",{"type":61,"tag":105,"props":401,"children":403},{"id":402},"find-and-free-a-busy-port-8888",[404],{"type":75,"value":405},"Find and free a busy port 8888",{"type":61,"tag":268,"props":407,"children":409},{"className":270,"code":408,"language":272,"meta":7,"style":7},"jupyter server stop 8888        # clean shutdown\n# or find the process\nlsof -i :8888\nkill -9 $(lsof -ti :8888)\n",[410],{"type":61,"tag":70,"props":411,"children":412},{"__ignoreMap":7},[413,441,450,469],{"type":61,"tag":278,"props":414,"children":415},{"class":280,"line":281},[416,420,424,429,435],{"type":61,"tag":278,"props":417,"children":418},{"style":285},[419],{"type":75,"value":288},{"type":61,"tag":278,"props":421,"children":422},{"style":291},[423],{"type":75,"value":294},{"type":61,"tag":278,"props":425,"children":426},{"style":291},[427],{"type":75,"value":428}," stop",{"type":61,"tag":278,"props":430,"children":432},{"style":431},"--shiki-default:#79B8FF",[433],{"type":75,"value":434}," 8888",{"type":61,"tag":278,"props":436,"children":438},{"style":437},"--shiki-default:#6A737D",[439],{"type":75,"value":440},"        # clean shutdown\n",{"type":61,"tag":278,"props":442,"children":444},{"class":280,"line":443},2,[445],{"type":61,"tag":278,"props":446,"children":447},{"style":437},[448],{"type":75,"value":449},"# or find the process\n",{"type":61,"tag":278,"props":451,"children":453},{"class":280,"line":452},3,[454,459,464],{"type":61,"tag":278,"props":455,"children":456},{"style":285},[457],{"type":75,"value":458},"lsof",{"type":61,"tag":278,"props":460,"children":461},{"style":431},[462],{"type":75,"value":463}," -i",{"type":61,"tag":278,"props":465,"children":466},{"style":291},[467],{"type":75,"value":468}," :8888\n",{"type":61,"tag":278,"props":470,"children":472},{"class":280,"line":471},4,[473,478,483,489,493,498,503],{"type":61,"tag":278,"props":474,"children":475},{"style":431},[476],{"type":75,"value":477},"kill",{"type":61,"tag":278,"props":479,"children":480},{"style":431},[481],{"type":75,"value":482}," -9",{"type":61,"tag":278,"props":484,"children":486},{"style":485},"--shiki-default:#E1E4E8",[487],{"type":75,"value":488}," $(",{"type":61,"tag":278,"props":490,"children":491},{"style":285},[492],{"type":75,"value":458},{"type":61,"tag":278,"props":494,"children":495},{"style":431},[496],{"type":75,"value":497}," -ti",{"type":61,"tag":278,"props":499,"children":500},{"style":291},[501],{"type":75,"value":502}," :8888",{"type":61,"tag":278,"props":504,"children":505},{"style":485},[506],{"type":75,"value":507},")\n",{"type":61,"tag":268,"props":509,"children":513},{"className":510,"code":511,"language":512,"meta":7,"style":7},"language-powershell shiki shiki-themes github-dark","# Windows\nnetstat -ano | findstr :8888\ntaskkill /PID \u003Cpid> /F\n","powershell",[514],{"type":61,"tag":70,"props":515,"children":516},{"__ignoreMap":7},[517,525,533],{"type":61,"tag":278,"props":518,"children":519},{"class":280,"line":281},[520],{"type":61,"tag":278,"props":521,"children":522},{},[523],{"type":75,"value":524},"# Windows\n",{"type":61,"tag":278,"props":526,"children":527},{"class":280,"line":443},[528],{"type":61,"tag":278,"props":529,"children":530},{},[531],{"type":75,"value":532},"netstat -ano | findstr :8888\n",{"type":61,"tag":278,"props":534,"children":535},{"class":280,"line":452},[536],{"type":61,"tag":278,"props":537,"children":538},{},[539],{"type":75,"value":540},"taskkill /PID \u003Cpid> /F\n",{"type":61,"tag":62,"props":542,"children":543},{},[544,546,552,554,560,562,568],{"type":75,"value":545},"Pick a port explicitly with ",{"type":61,"tag":70,"props":547,"children":549},{"className":548},[],[550],{"type":75,"value":551},"jupyter lab --port 8899",{"type":75,"value":553},", or set ",{"type":61,"tag":70,"props":555,"children":557},{"className":556},[],[558],{"type":75,"value":559},"c.ServerApp.port = 8899",{"type":75,"value":561}," in ",{"type":61,"tag":70,"props":563,"children":565},{"className":564},[],[566],{"type":75,"value":567},"jupyter_server_config.py",{"type":75,"value":313},{"type":61,"tag":105,"props":570,"children":572},{"id":571},"open-jupyter-from-another-machine",[573],{"type":75,"value":574},"Open Jupyter from another machine",{"type":61,"tag":62,"props":576,"children":577},{},[578],{"type":75,"value":579},"The common case is Jupyter running on a GPU box or cloud VM. Two options:",{"type":61,"tag":62,"props":581,"children":582},{},[583],{"type":61,"tag":66,"props":584,"children":585},{},[586],{"type":75,"value":587},"SSH tunnel (best when you have SSH):",{"type":61,"tag":268,"props":589,"children":591},{"className":270,"code":590,"language":272,"meta":7,"style":7},"# on the server\njupyter lab --no-browser --port 8888\n# on your laptop\nssh -L 8888:localhost:8888 user@gpu-box\n",[592],{"type":61,"tag":70,"props":593,"children":594},{"__ignoreMap":7},[595,603,630,638],{"type":61,"tag":278,"props":596,"children":597},{"class":280,"line":281},[598],{"type":61,"tag":278,"props":599,"children":600},{"style":437},[601],{"type":75,"value":602},"# on the server\n",{"type":61,"tag":278,"props":604,"children":605},{"class":280,"line":443},[606,610,615,620,625],{"type":61,"tag":278,"props":607,"children":608},{"style":285},[609],{"type":75,"value":288},{"type":61,"tag":278,"props":611,"children":612},{"style":291},[613],{"type":75,"value":614}," lab",{"type":61,"tag":278,"props":616,"children":617},{"style":431},[618],{"type":75,"value":619}," --no-browser",{"type":61,"tag":278,"props":621,"children":622},{"style":431},[623],{"type":75,"value":624}," --port",{"type":61,"tag":278,"props":626,"children":627},{"style":431},[628],{"type":75,"value":629}," 8888\n",{"type":61,"tag":278,"props":631,"children":632},{"class":280,"line":452},[633],{"type":61,"tag":278,"props":634,"children":635},{"style":437},[636],{"type":75,"value":637},"# on your laptop\n",{"type":61,"tag":278,"props":639,"children":640},{"class":280,"line":471},[641,646,651,656],{"type":61,"tag":278,"props":642,"children":643},{"style":285},[644],{"type":75,"value":645},"ssh",{"type":61,"tag":278,"props":647,"children":648},{"style":431},[649],{"type":75,"value":650}," -L",{"type":61,"tag":278,"props":652,"children":653},{"style":291},[654],{"type":75,"value":655}," 8888:localhost:8888",{"type":61,"tag":278,"props":657,"children":658},{"style":291},[659],{"type":75,"value":660}," user@gpu-box\n",{"type":61,"tag":62,"props":662,"children":663},{},[664,666,671],{"type":75,"value":665},"Then open ",{"type":61,"tag":70,"props":667,"children":669},{"className":668},[],[670],{"type":75,"value":101},{"type":75,"value":672}," locally with the token. Nothing new is exposed.",{"type":61,"tag":62,"props":674,"children":675},{},[676,681,683,689,691,697],{"type":61,"tag":66,"props":677,"children":678},{},[679],{"type":75,"value":680},"LAN access:",{"type":75,"value":682}," ",{"type":61,"tag":70,"props":684,"children":686},{"className":685},[],[687],{"type":75,"value":688},"jupyter lab --ip 0.0.0.0 --no-browser",{"type":75,"value":690}," and open ",{"type":61,"tag":70,"props":692,"children":694},{"className":693},[],[695],{"type":75,"value":696},"http://SERVER-IP:8888/?token=...",{"type":75,"value":698},". Only on a network you trust, and only with the token on.",{"type":61,"tag":105,"props":700,"children":702},{"id":701},"share-jupyter-over-a-public-url",[703],{"type":75,"value":704},"Share Jupyter over a public URL",{"type":61,"tag":62,"props":706,"children":707},{},[708],{"type":75,"value":709},"When there's no SSH path (the box is behind NAT, or a collaborator doesn't have an account on it), a tunnel gives the server an HTTPS address without opening inbound ports:",{"type":61,"tag":268,"props":711,"children":713},{"className":270,"code":712,"language":272,"meta":7,"style":7},"relay connect --name team-notebook http://localhost:8888\n",[714],{"type":61,"tag":70,"props":715,"children":716},{"__ignoreMap":7},[717],{"type":61,"tag":278,"props":718,"children":719},{"class":280,"line":281},[720,725,730,735,740],{"type":61,"tag":278,"props":721,"children":722},{"style":285},[723],{"type":75,"value":724},"relay",{"type":61,"tag":278,"props":726,"children":727},{"style":291},[728],{"type":75,"value":729}," connect",{"type":61,"tag":278,"props":731,"children":732},{"style":431},[733],{"type":75,"value":734}," --name",{"type":61,"tag":278,"props":736,"children":737},{"style":291},[738],{"type":75,"value":739}," team-notebook",{"type":61,"tag":278,"props":741,"children":742},{"style":291},[743],{"type":75,"value":744}," http://localhost:8888\n",{"type":61,"tag":62,"props":746,"children":747},{},[748,750,756,758,764],{"type":75,"value":749},"Keep token or password authentication enabled. The tunnel only makes the server reachable; Jupyter's own login is what stops strangers running code on your machine. If notebooks load but kernels keep disconnecting, the WebSocket connection to ",{"type":61,"tag":70,"props":751,"children":753},{"className":752},[],[754],{"type":75,"value":755},"/api/kernels/...",{"type":75,"value":757}," is failing; check that nothing between the browser and Jupyter strips WebSocket upgrades. ",{"type":61,"tag":759,"props":760,"children":761},"a",{"href":23},[762],{"type":75,"value":763},"Dotscience runs thousands of tunnels like this",{"type":75,"value":765}," for hosted data science environments.",{"type":61,"tag":767,"props":768,"children":769},"style",{},[770],{"type":75,"value":771},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":452,"depth":452,"links":773},[774,775,776,777,778,779],{"id":107,"depth":443,"text":110},{"id":232,"depth":443,"text":235},{"id":367,"depth":443,"text":370},{"id":402,"depth":443,"text":405},{"id":571,"depth":443,"text":574},{"id":701,"depth":443,"text":704},"markdown","content:localhost:8888.md","content","localhost/8888.md","localhost/8888","md",{"loc":4},1793199809507]