[{"data":1,"prerenderedAt":356},["ShallowReactive",2],{"page-\u002Finstances\u002Fports":3,"surround-\u002Finstances\u002Fports":347},{"id":4,"title":5,"body":6,"description":339,"extension":340,"meta":341,"navigation":342,"path":343,"seo":344,"stem":345,"__hash__":346},"docs\u002Finstances\u002Fports.md","Expose ports",{"type":7,"value":8,"toc":331},"minimark",[9,13,18,145,154,158,171,175,198,201,254,258,264,300,304,307,311,327],[10,11,12],"p",{},"This page shows how to expose a port, find its address, make your service reachable and protect it.",[14,15,17],"h2",{"id":16},"expose-a-port","Expose a port",[19,20,22,59],"tabs",{"sync":21},"interface",[23,24,26],"tabs-item",{"label":25},"Console",[27,28,29,38,52],"ol",{},[30,31,32,33,37],"li",{},"Open the instance and select the ",[34,35,36],"strong",{},"Connect"," tab.",[30,39,40,41,44,45,47,48,51],{},"Under ",[34,42,43],{},"Exposed ports",", click ",[34,46,5],{}," (or ",[34,49,50],{},"Edit ports",").",[30,53,54,55,58],{},"Enter the ports and click ",[34,56,57],{},"Save ports",".",[23,60,62,135],{"label":61},"CLI",[63,64,69],"pre",{"className":65,"code":66,"language":67,"meta":68,"style":68},"language-bash shiki shiki-themes github-dark-default","featherless-cloud instance update my-instance --port 8000\nfeatherless-cloud instance update my-instance --port 8000 --port 8888\nfeatherless-cloud instance update my-instance --port none\n","bash","",[70,71,72,98,119],"code",{"__ignoreMap":68},[73,74,77,81,85,88,91,95],"span",{"class":75,"line":76},"line",1,[73,78,80],{"class":79},"sQhOw","featherless-cloud",[73,82,84],{"class":83},"s9uIt"," instance",[73,86,87],{"class":83}," update",[73,89,90],{"class":83}," my-instance",[73,92,94],{"class":93},"sFSAA"," --port",[73,96,97],{"class":93}," 8000\n",[73,99,101,103,105,107,109,111,114,116],{"class":75,"line":100},2,[73,102,80],{"class":79},[73,104,84],{"class":83},[73,106,87],{"class":83},[73,108,90],{"class":83},[73,110,94],{"class":93},[73,112,113],{"class":93}," 8000",[73,115,94],{"class":93},[73,117,118],{"class":93}," 8888\n",[73,120,122,124,126,128,130,132],{"class":75,"line":121},3,[73,123,80],{"class":79},[73,125,84],{"class":83},[73,127,87],{"class":83},[73,129,90],{"class":83},[73,131,94],{"class":93},[73,133,134],{"class":83}," none\n",[10,136,137,140,141,144],{},[70,138,139],{},"--port"," replaces the whole list. ",[70,142,143],{},"none"," removes every port.",[10,146,147,148,151,152,58],{},"Changes apply right away, without restarting the instance. You can also set ports when you deploy, under ",[34,149,150],{},"Public ports"," or with ",[70,153,139],{},[14,155,157],{"id":156},"find-the-address","Find the address",[10,159,160,161,163,164,166,167,170],{},"Each port's address is listed under ",[34,162,43],{}," on the instance's ",[34,165,36],{}," tab, and ",[70,168,169],{},"featherless-cloud instance get my-instance"," prints it. The address is made from the instance ID and the port, so it stays the same when the instance stops and starts again. It responds only while the instance is running.",[14,172,174],{"id":173},"make-your-service-reachable","Make your service reachable",[176,177,178,192],"ul",{},[30,179,180,187,188,191],{},[34,181,182,183,186],{},"Listen on ",[70,184,185],{},"0.0.0.0",","," not ",[70,189,190],{},"127.0.0.1",". A service that listens only on localhost can't be reached.",[30,193,194,197],{},[34,195,196],{},"Keep it running after you disconnect."," Start the service from the browser terminal or in tmux, or make it the instance's start command. A program started by a one-off SSH command stops when that SSH session ends.",[10,199,200],{},"To check a port end to end, serve a test page and open the address:",[63,202,204],{"className":65,"code":203,"language":67,"meta":68,"style":68},"mkdir -p \u002Ftmp\u002Fsite && cd \u002Ftmp\u002Fsite && echo \"hello\" > index.html\npython -m http.server 8000\n",[70,205,206,241],{"__ignoreMap":68},[73,207,208,211,214,217,221,224,226,228,231,234,238],{"class":75,"line":76},[73,209,210],{"class":79},"mkdir",[73,212,213],{"class":93}," -p",[73,215,216],{"class":83}," \u002Ftmp\u002Fsite",[73,218,220],{"class":219},"sZEs4"," && ",[73,222,223],{"class":93},"cd",[73,225,216],{"class":83},[73,227,220],{"class":219},[73,229,230],{"class":93},"echo",[73,232,233],{"class":83}," \"hello\"",[73,235,237],{"class":236},"suJrU"," >",[73,239,240],{"class":83}," index.html\n",[73,242,243,246,249,252],{"class":75,"line":100},[73,244,245],{"class":79},"python",[73,247,248],{"class":93}," -m",[73,250,251],{"class":83}," http.server",[73,253,97],{"class":93},[14,255,257],{"id":256},"protect-your-service","Protect your service",[259,260,261],"warning",{},[10,262,263],{},"Anyone with the address can reach the port. Protect the service with its own authentication.",[176,265,266,281,294],{},[30,267,268,271,272,275,276,58],{},[34,269,270],{},"JupyterLab:"," set ",[70,273,274],{},"JUPYTER_TOKEN",". See ",[277,278,280],"a",{"href":279},"\u002Fexamples\u002Fjupyterlab","Develop in JupyterLab",[30,282,283,271,286,289,290,58],{},[34,284,285],{},"vLLM:",[70,287,288],{},"VLLM_API_KEY",", and clients send it as a bearer token. See ",[277,291,293],{"href":292},"\u002Fexamples\u002Fvllm-server","Serve an LLM with vLLM",[30,295,296,299],{},[34,297,298],{},"Your own app:"," require a token or a password before serving anything.",[14,301,303],{"id":302},"what-public-ports-carry","What public ports carry",[10,305,306],{},"Public ports carry HTTP, including WebSocket and server-sent events. Raw TCP and UDP aren't supported. A connection with no traffic for 300 seconds is closed.",[14,308,310],{"id":309},"next-steps","Next steps",[312,313,314,321],"card-group",{},[315,316,318],"card",{"icon":317,"title":293,"to":292},"i-lucide-message-square",[10,319,320],{},"Serve an OpenAI-compatible API on a public port.",[315,322,324],{"icon":323,"title":280,"to":279},"i-lucide-notebook-pen",[10,325,326],{},"Open JupyterLab through a public port.",[328,329,330],"style",{},"html pre.shiki code .sQhOw, html code.shiki .sQhOw{--shiki-default:#FFA657}html pre.shiki code .s9uIt, html code.shiki .s9uIt{--shiki-default:#A5D6FF}html pre.shiki code .sFSAA, html code.shiki .sFSAA{--shiki-default:#79C0FF}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);}html pre.shiki code .sZEs4, html code.shiki .sZEs4{--shiki-default:#E6EDF3}html pre.shiki code .suJrU, html code.shiki .suJrU{--shiki-default:#FF7B72}",{"title":68,"searchDepth":100,"depth":100,"links":332},[333,334,335,336,337,338],{"id":16,"depth":100,"text":17},{"id":156,"depth":100,"text":157},{"id":173,"depth":100,"text":174},{"id":256,"depth":100,"text":257},{"id":302,"depth":100,"text":303},{"id":309,"depth":100,"text":310},"Reach a web app, notebook or API on your instance at its own HTTPS address, without SSH.","md",{},true,"\u002Finstances\u002Fports",{"title":5,"description":339},"instances\u002Fports","9rFI5qjd7tdmRgEek583Zp8oI_jdH9znixGil2JA44E",[348,352],{"title":349,"path":350,"description":351},"Connect to an instance","\u002Finstances\u002Fconnect","Work on your instance from the browser, your own terminal or your IDE, without losing your session.",{"title":353,"path":354,"description":355},"Logs and metrics","\u002Finstances\u002Flogs-and-metrics","See what your instance is doing, from its output and resource use to its history.",1794932598293]