Start a service inside the sandbox and expose it to your host:
from celesto import Celestowith Celesto() as vm: vm.run("python3 -m http.server 8000 &") host_port = vm.expose_local(guest_port=8000, host_port=8000) print(f"Service available at http://127.0.0.1:{host_port}/")
Omit host_port to let Celesto pick an available port automatically:
host_port = vm.expose_local(guest_port=8080)print(f"Guest port 8080 exposed on localhost:{host_port}")
QEMU keeps expose_local() available when outbound access is off or restricted. On the default slirp network it uses QEMU forwarding; on Linux TAP it uses localhost forwarding to the guest IP. Ordinary HTTP, WebSocket, and file-transfer traffic does not require SSH or a guest agent.Have the application listen on 0.0.0.0 inside the sandbox. If it listens only on the guest’s 127.0.0.1, pass guest_loopback=True; this option requires guest SSH because it uses an SSH tunnel.
If you already have a running sandbox, you can forward ports from your terminal — no Python required:
celesto sandbox port expose my-vm 8080:3000celesto sandbox port list my-vmcelesto sandbox port close my-vm 8080:3000
CLI forwards are non-blocking and persist after the command exits. See celesto sandbox port for the full reference.
Last modified on November 5, 2026
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Celesto AI","description":"Celesto runs your GitHub Actions builds and tests on managed runners. Choose a runner size, keep your existing workflows, and measure runtime and cost.","colors":{"primary":"#52525B","light":"#A1A1AA","dark":"#3F3F46"},"logo":{"light":"https://mintcdn.com/celestoai/LDwunL2Vt9Pis6a0/assets/celesto-logo.png?fit=max\u0026auto=format\u0026n=LDwunL2Vt9Pis6a0\u0026q=85\u0026s=c21396f68593db7d457f2e5477c89d78","dark":"https://mintcdn.com/celestoai/LDwunL2Vt9Pis6a0/assets/celesto-logo.png?fit=max\u0026auto=format\u0026n=LDwunL2Vt9Pis6a0\u0026q=85\u0026s=c21396f68593db7d457f2e5477c89d78"},"favicon":{"light":"https://mintcdn.com/celestoai/_KrDBqGM7BwH7_KV/favicon.png?fit=max\u0026auto=format\u0026n=_KrDBqGM7BwH7_KV\u0026q=85\u0026s=42350ed1a82c10328a4f80146196f5a1","dark":"https://mintcdn.com/celestoai/KTxjKnCVde3ZGE8i/images/logo-v2.png?fit=max\u0026auto=format\u0026n=KTxjKnCVde3ZGE8i\u0026q=85\u0026s=fcd49a67a17fdab035b626a455d198e9"},"appearance":{"default":"dark"},"background":{"decoration":"grid"},"navbar":{"links":[{"icon":"envelope","href":"mailto:aniket@celesto.ai","label":"Support"},{"icon":"discord","href":"https://discord.gg/KNb5UkrAmm","label":"Discord"},{"icon":"github","href":"https://github.com/celestoai","label":"GitHub"}],"primary":{"type":"button","label":"Home","href":"https://celesto.ai"}},"footer":{"socials":{"x":"https://x.com/celestoai","github":"https://github.com/celestoai","linkedin":"https://linkedin.com/company/celestoai","discord":"https://discord.gg/KNb5UkrAmm"}},"seo":{"indexing":"navigable"},"fonts":{"heading":{"family":"Geist"}},"styling":{"latex":false},"integrations":{"gtm":{"tagId":"G-EYNQCSCZVJ"},"posthog":{"apiKey":"phc_vjIHlkZ5iOYWdZx0LXiifLKGl53QehS8LjudWiuSRND","sessionRecording":true}},"banner":{"content":"Celesto is open source. ⭐ [Star Celesto on GitHub →](https://github.com/CelestoAI/celesto)","dismissible":true},"errors":{"404":{"redirect":false,"title":"I can't be found","description":"\u003cimg src='/assets/undraw_page-eaten_b2rt.svg'/>"}},"contextual":{"options":["copy","chatgpt","mcp","claude"],"display":"header"},"interaction":{"drilldown":true},"metadata":{"timestamp":true},"navigation":{"global":{},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"celestoai","hasAudioNarration":false,"actualSubdomain":"celestoai","customDomains":["celesto.ai"],"gitSource":{"type":"github","owner":"celestoai","repo":"mintlify-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":false,"issues":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aeccc2bbba8b341cc926c67","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"Open source","count":68},{"language":"default","tag":"Reference","count":43},{"language":"default","tag":"CLI commands","count":22},{"language":"default","tag":"Python API","count":20},{"language":"default","tag":"Sandboxes","count":19},{"language":"default","tag":"GitHub Actions","count":12},{"language":"default","tag":"Get started","count":7},{"language":"default","tag":"Run sandboxes","count":6},{"language":"default","tag":"How it works","count":5},{"language":"default","tag":"Connect AI agents","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"aniket@celesto.ai","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[{"_id":"69d0086691d46a89b83ff9ce","deploymentId":"68fc2513e3244c7a0ec6558e","questionText":"Docker vs microVM","status":"active","generatedBy":"manual","createdAt":"2026-04-03T18:35:18.161Z","updatedAt":"2026-04-03T18:35:18.161Z","__v":0},{"_id":"69d0085191d46a89b83ff98d","deploymentId":"68fc2513e3244c7a0ec6558e","questionText":"What is computer-use agent?","status":"active","generatedBy":"manual","createdAt":"2026-04-03T18:34:57.827Z","updatedAt":"2026-04-03T18:34:57.827Z","__v":0},{"_id":"69d0084791d46a89b83ff96f","deploymentId":"68fc2513e3244c7a0ec6558e","questionText":"Does it support on-prem deployment?","status":"active","generatedBy":"manual","createdAt":"2026-04-03T18:34:47.327Z","updatedAt":"2026-04-03T18:34:47.327Z","__v":0}],"googleFontsInlined":true},"customCss":[{"filePath":"language-selector.css","content":"#sdk-language-selector-slot{display:inline-flex;align-items:center;gap:0.625rem;max-width:100%;margin:1.125rem 0 1.5rem;padding:0;border:0;background:transparent}#sdk-language-selector-slot:empty{display:none!important;margin:0!important}html[data-current-path^=\"/celesto-sdk/\"] #table-of-contents #multi-view-dropdown{display:none!important}#sdk-language-selector-slot #multi-view-dropdown{width:12.5rem!important;max-width:min(12.5rem, calc(100vw - 3rem))!important;margin-bottom:0!important;z-index:30}#multi-view-dropdown[data-sdk-language-selector-extra=\"true\"]{display:none!important}#sdk-language-selector-slot .multi-view-dropdown-trigger{min-height:2.5rem;padding:0.375rem 0.625rem!important;border-color:rgba(255, 255, 255, 0.09)!important;background:rgba(255, 255, 255, 0.035)}html.dark #sdk-language-selector-slot .multi-view-dropdown-trigger{border-color:rgba(255, 255, 255, 0.1)!important;background:rgba(255, 255, 255, 0.04)}html:not(.dark) #sdk-language-selector-slot .multi-view-dropdown-trigger{border-color:rgba(17, 24, 39, 0.1)!important;background:rgba(255, 255, 255, 0.86)}#sdk-language-selector-slot .multi-view-dropdown-trigger span{font-size:0.9375rem!important;line-height:1.25rem!important}@media (max-width: 768px){#sdk-language-selector-slot{display:flex;width:100%;margin-top:1.25rem}#sdk-language-selector-slot #multi-view-dropdown{width:100%!important;max-width:100%!important}}"}],"page":{"pagePath":"celesto/features/port-forwarding","slug":"/celesto/features/port-forwarding","pageMetadata":{"title":"Port Forwarding","sidebarTitle":"Forward ports","description":"Forward ports from a Celesto sandbox to your host so you can reach web servers, databases, and APIs running inside the sandbox as if they were local.","href":"/celesto/features/port-forwarding"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Forward ports from a Celesto sandbox to your host so you can reach web servers, databases, and APIs running inside the sandbox as if they were local.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`When you run a web server, database, or API inside a sandbox, port forwarding lets you access it from your host machine as if it were running locally.`}),`\n`,_jsx(Heading,{level:`2`,id:`expose-a-port`,children:`Expose a port`}),`\n`,_jsx(_components.p,{children:`Start a service inside the sandbox and expose it to your host:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` celesto `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Celesto`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Celesto() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vm:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vm.run(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"python3 -m http.server 8000 \u0026\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` host_port `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vm.expose_local(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`guest_port`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`host_port`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Service available at http://127.0.0.1:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`host_port`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Omit `,_jsx(_components.code,{children:`host_port`}),` to let Celesto pick an available port automatically:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`host_port `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vm.expose_local(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`guest_port`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8080`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Guest port 8080 exposed on localhost:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`host_port`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`QEMU keeps `,_jsx(_components.code,{children:`expose_local()`}),` available when outbound access is off or restricted. On the default `,_jsx(_components.code,{children:`slirp`}),` network it uses QEMU forwarding; on Linux TAP it uses localhost forwarding to the guest IP. Ordinary HTTP, WebSocket, and file-transfer traffic does not require SSH or a guest agent.`]}),`\n`,_jsxs(_components.p,{children:[`Have the application listen on `,_jsx(_components.code,{children:`0.0.0.0`}),` inside the sandbox. If it listens only on the guest’s `,_jsx(_components.code,{children:`127.0.0.1`}),`, pass `,_jsx(_components.code,{children:`guest_loopback=True`}),`; this option requires guest SSH because it uses an SSH tunnel.`]}),`\n`,_jsx(Heading,{level:`2`,id:`multiple-ports`,children:`Multiple ports`}),`\n`,_jsx(_components.p,{children:`Expose multiple services from the same sandbox:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Celesto() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vm:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vm.run(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"python3 -m http.server 8000 \u0026\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vm.run(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"python3 -m http.server 9000 \u0026\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` port1 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vm.expose_local(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`guest_port`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`host_port`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` port2 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` vm.expose_local(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`guest_port`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`9000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`host_port`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`9000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Service 1: http://127.0.0.1:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`port1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Service 2: http://127.0.0.1:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`port2`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`remove-a-port-forward`,children:`Remove a port forward`}),`\n`,_jsx(_components.p,{children:`Port forwards are automatically cleaned up when the sandbox stops. To remove one manually:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`vm.unexpose_local(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`host_port`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8080`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`guest_port`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8080`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`expose_local()`}),` only binds to `,_jsx(_components.code,{children:`127.0.0.1`}),` (localhost). Services are not exposed to your network.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`from-the-cli`,children:`From the CLI`}),`\n`,_jsx(_components.p,{children:`If you already have a running sandbox, you can forward ports from your terminal — no Python required:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`celesto`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sandbox`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` port`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` expose`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` my-vm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 8080:3000`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`celesto`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sandbox`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` port`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` my-vm`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`celesto`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sandbox`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` port`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` close`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` my-vm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 8080:3000`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`CLI forwards are non-blocking and persist after the command exits. See `,_jsx(_components.a,{href:`/celesto/cli/port`,children:_jsx(_components.code,{children:`celesto sandbox port`})}),` for the full reference.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Port Forwarding","sidebarTitle":"Forward ports","description":"Forward ports from a Celesto sandbox to your host so you can reach web servers, databases, and APIs running inside the sandbox as if they were local.","href":"/celesto/features/port-forwarding"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Expose a port","slug":"expose-a-port","depth":2,"children":[]},{"title":"Multiple ports","slug":"multiple-ports","depth":2,"children":[]},{"title":"Remove a port forward","slug":"remove-a-port-forward","depth":2,"children":[]},{"title":"From the CLI","slug":"from-the-cli","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/celestoai/57979735173e757b/language-selector.js"],"subdomain":"celestoai","siteName":"Celesto AI","title":"Port Forwarding - Celesto AI","relatedPagesConfig":{"enabled":true,"limit":5,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-27T21:41:27.598Z","gitLastModified":"2026-11-05T08:22:06.000Z","originalFileLocation":"celesto/features/port-forwarding.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Forward ports from a Celesto sandbox to your host so you can reach web servers, databases, and APIs running inside the sandbox as if they were local.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Celesto AI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/celestoai/-bRUTa7-LfylkDcu/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/celestoai/-bRUTa7-LfylkDcu/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/celestoai/-bRUTa7-LfylkDcu/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/celestoai/-bRUTa7-LfylkDcu/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/celestoai/-bRUTa7-LfylkDcu/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/celestoai/-bRUTa7-LfylkDcu/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/celestoai/-bRUTa7-LfylkDcu/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/celestoai/-bRUTa7-LfylkDcu/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/celestoai/-bRUTa7-LfylkDcu/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Port Forwarding - Celesto AI\">\u003cmeta data-mint-head property=\"og:description\" content=\"Forward ports from a Celesto sandbox to your host so you can reach web servers, databases, and APIs running inside the sandbox as if they were local.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Celesto AI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://celesto.ai/docs/celesto/features/port-forwarding\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://celestoai.mintlify.site/docs/_mintlify/api/og/v2?division=Files+and+networking\u0026amp;title=Port+Forwarding\u0026amp;description=Forward+ports+from+a+Celesto+sandbox+to+your+host+so+you+can+reach+web+servers%2C+databases%2C+and+APIs+running+inside+the+sandbox+as+if+they+were+local.\u0026amp;theme=87418bc7e82b6efc9a409775\u0026amp;signature=fa27749de725a16cc3d21a38d8111af88b7ea08943dca2da63bd07265e6effe3\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Port Forwarding - Celesto AI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Forward ports from a Celesto sandbox to your host so you can reach web servers, databases, and APIs running inside the sandbox as if they were local.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://celestoai.mintlify.site/docs/_mintlify/api/og/v2?division=Files+and+networking\u0026amp;title=Port+Forwarding\u0026amp;description=Forward+ports+from+a+Celesto+sandbox+to+your+host+so+you+can+reach+web+servers%2C+databases%2C+and+APIs+running+inside+the+sandbox+as+if+they+were+local.\u0026amp;theme=87418bc7e82b6efc9a409775\u0026amp;signature=fa27749de725a16cc3d21a38d8111af88b7ea08943dca2da63bd07265e6effe3\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/celestoai/-bRUTa7-LfylkDcu/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Celesto AI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#52525B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://celesto.ai/docs/celesto/features/port-forwarding\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/celesto/features/port-forwarding.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://celesto.ai/#organization\",\"name\":\"Celesto AI\",\"url\":\"https://celesto.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/celestoai/LDwunL2Vt9Pis6a0/assets/celesto-logo.png?fit=max\u0026auto=format\u0026n=LDwunL2Vt9Pis6a0\u0026q=85\u0026s=c21396f68593db7d457f2e5477c89d78\"}},{\"@type\":\"WebSite\",\"@id\":\"https://celesto.ai/docs#website\",\"name\":\"Celesto AI\",\"url\":\"https://celesto.ai/docs\",\"publisher\":{\"@id\":\"https://celesto.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://celesto.ai/docs/celesto/features/port-forwarding#webpage\",\"url\":\"https://celesto.ai/docs/celesto/features/port-forwarding\",\"name\":\"Port Forwarding\",\"description\":\"Forward ports from a Celesto sandbox to your host so you can reach web servers, databases, and APIs running inside the sandbox as if they were local.\",\"dateModified\":\"2026-11-05T08:22:06.000Z\",\"isPartOf\":{\"@id\":\"https://celesto.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://celesto.ai/docs/celesto/features/port-forwarding#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://celesto.ai/docs/celesto/features/port-forwarding#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Files and networking\",\"item\":\"https://celesto.ai/docs/celesto/features/host-mounts\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Port Forwarding\",\"item\":\"https://celesto.ai/docs/celesto/features/port-forwarding\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://celesto.ai/docs/celesto/features/port-forwarding#article\",\"headline\":\"Port Forwarding\",\"name\":\"Port Forwarding\",\"description\":\"Forward ports from a Celesto sandbox to your host so you can reach web servers, databases, and APIs running inside the sandbox as if they were local.\",\"url\":\"https://celesto.ai/docs/celesto/features/port-forwarding\",\"mainEntityOfPage\":{\"@id\":\"https://celesto.ai/docs/celesto/features/port-forwarding#webpage\"},\"dateModified\":\"2026-11-05T08:22:06.000Z\",\"publisher\":{\"@id\":\"https://celesto.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://celesto.ai/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Celesto AI\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Celesto AI","nav":{"global":{},"tabs":[{"tab":"GitHub Actions","pages":[{"title":"GitHub Actions","href":"/ci"}]},{"tab":"Sandboxes","pages":[{"title":"Sandboxes","href":"/cloud/overview"}]},{"tab":"Open source","groups":[{"group":"Get started","pages":[{"title":"Celesto: secure microVM sandboxes for AI agents","sidebarTitle":"Introduction","href":"/celesto/introduction"},{"title":"Install Celesto on Linux or macOS","sidebarTitle":"Installation","href":"/celesto/installation"},{"title":"Basic usage","sidebarTitle":"Run your first commands","href":"/celesto/guides/basic-usage"}]},{"group":"Run sandboxes","pages":[{"title":"VM lifecycle management","sidebarTitle":"Start, pause, and stop","href":"/celesto/guides/vm-lifecycle"},{"title":"Environment variables in Celesto sandboxes","sidebarTitle":"Environment variables","href":"/celesto/guides/environment-variables"},{"title":"Run Docker in a Celesto sandbox","sidebarTitle":"Docker","href":"/celesto/features/docker"},{"title":"Browser sandboxes","sidebarTitle":"Browser sandboxes","href":"/celesto/features/browser-sandboxes"},{"title":"Disposable macOS environments","sidebarTitle":"macOS sandboxes","href":"/celesto/guides/macos-sandboxes"},{"title":"Windows sandboxes in Celesto","sidebarTitle":"Windows sandboxes","href":"/celesto/guides/windows-guests"}]},{"group":"Images and snapshots","pages":[{"title":"Published images","href":"/celesto/concepts/published-images"},{"title":"Custom Sandbox Images with Docker","sidebarTitle":"Custom images","href":"/celesto/guides/custom-images"},{"title":"Snapshot and restore Celesto sandboxes","sidebarTitle":"Save and restore snapshots","href":"/celesto/features/snapshots"}]},{"group":"Files and networking","pages":[{"title":"Mount Folders and Data","sidebarTitle":"Share local folders","description":"Share local folders and project files with a Celesto sandbox using read-only or writable host mounts so agents can explore code without copying it first.","href":"/celesto/features/host-mounts"},{"title":"Port Forwarding","sidebarTitle":"Forward ports","href":"/celesto/features/port-forwarding"},{"title":"Control sandbox internet access","sidebarTitle":"Internet access rules","description":"Set an egress allowlist for local Linux sandboxes, allow specific destination addresses, or turn outbound internet access off.","href":"/celesto/features/network-controls"},{"title":"Bridged networking","href":"/celesto/features/bridged-networking"}]},{"group":"Connect AI agents","pages":[{"title":"Framework Integration","sidebarTitle":"Agent frameworks","href":"/celesto/guides/ai-agent-integration"},{"title":"Run callbacks and safety hooks","sidebarTitle":"Command hooks","href":"/celesto/features/callbacks"}]},{"group":"How it works","pages":[{"title":"Celesto architecture overview","sidebarTitle":"Architecture","href":"/celesto/concepts/overview"},{"title":"Security model","href":"/celesto/concepts/security"},{"title":"Firecracker, QEMU, and libkrun backends","sidebarTitle":"Runtime backends","href":"/celesto/concepts/backends"},{"title":"Network configuration","href":"/celesto/concepts/networking"},{"title":"Control channel","href":"/celesto/concepts/control-channel"}]},{"group":"Performance and troubleshooting","pages":[{"title":"Performance benchmarks","href":"/celesto/advanced/performance"},{"title":"Troubleshooting guide","sidebarTitle":"Troubleshooting","href":"/celesto/advanced/troubleshooting"}]},{"group":"Reference","pages":[{"title":"Use the Celesto HTTP API and TypeScript SDK","sidebarTitle":"HTTP API and TypeScript SDK","href":"/celesto/guides/http-api-typescript-sdk"},{"group":"Python API","expanded":false,"pages":[{"title":"Celesto Python class reference","href":"/celesto/api/celesto"},{"title":"Browser and desktop sandboxes","href":"/celesto/api/browsersession"},{"title":"Browser and desktop options","href":"/celesto/api/browsersessionconfig"},{"title":"Display sandbox object","href":"/celesto/api/browsersessioninfo"},{"title":"Callback hooks Python reference","href":"/celesto/api/callbacks"},{"title":"CommandResult","href":"/celesto/api/commandresult"},{"title":"Exceptions","href":"/celesto/api/exceptions"},{"title":"HostManager","href":"/celesto/api/hostmanager"},{"title":"BootImage and boot helpers","href":"/celesto/api/bootimage"},{"title":"DockerRootfsBuilder","href":"/celesto/api/dockerrootfsbuilder"},{"title":"ImageBuilder","href":"/celesto/api/imagebuilder"},{"title":"ImageManager","href":"/celesto/api/imagemanager"},{"title":"ImageSource","href":"/celesto/api/imagesource"},{"title":"InternetSettings","href":"/celesto/api/internetsettings"},{"title":"Kernel helpers","href":"/celesto/api/kernelhelpers"},{"title":"NetworkConfig","href":"/celesto/api/networkconfig"},{"title":"SnapshotInfo","href":"/celesto/api/snapshotinfo"},{"title":"SSHClient","href":"/celesto/api/sshclient"},{"title":"VMConfig Python reference","href":"/celesto/api/vmconfig"},{"title":"VMInfo","href":"/celesto/api/vminfo"}]},{"group":"CLI commands","expanded":false,"pages":[{"title":"CLI overview","href":"/celesto/cli/overview"},{"title":"celesto sandbox create","href":"/celesto/cli/create"},{"title":"celesto sandbox list","href":"/celesto/cli/list"},{"title":"celesto sandbox shell","href":"/celesto/cli/shell"},{"title":"celesto sandbox ssh","href":"/celesto/cli/ssh"},{"title":"celesto sandbox exec","href":"/celesto/cli/exec"},{"title":"celesto sandbox logs","href":"/celesto/cli/logs"},{"title":"celesto sandbox stop","href":"/celesto/cli/stop"},{"title":"celesto sandbox delete","href":"/celesto/cli/cleanup"},{"title":"celesto sandbox prune","href":"/celesto/cli/sandbox-prune"},{"title":"celesto sandbox file","href":"/celesto/cli/file"},{"title":"celesto sandbox env","href":"/celesto/cli/env"},{"title":"celesto sandbox port","href":"/celesto/cli/port"},{"title":"celesto sandbox snapshot","href":"/celesto/cli/snapshot"},{"title":"celesto server","href":"/celesto/cli/server"},{"title":"celesto ui","href":"/celesto/cli/ui"},{"title":"celesto doctor","href":"/celesto/cli/doctor"},{"title":"celesto update","href":"/celesto/cli/update"},{"title":"celesto image","href":"/celesto/cli/image"},{"title":"celesto prune","href":"/celesto/cli/prune"},{"title":"celesto completion","href":"/celesto/cli/completion"},{"title":"celesto windows","href":"/celesto/cli/windows"}]}]}]}]},"basePath":"","title":"Port Forwarding - Celesto AI","buildId":"dpl_BSPUBxEoKhhK7HzXVDPxdPvWx4xc","deploymentId":"dpl_BSPUBxEoKhhK7HzXVDPxdPvWx4xc","dynamics":["10e4515597"],"chunks":["BannerMarkdown--rjwFo9x.js","dist-qmLwQyWY.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-apD-Q0Oo.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}