- Port forwarding brings a Devbox port to
localhostfor as long as the CLI keeps running. It stays private to you and works for any TCP service. - Shareable URLs publish an HTTP service on a
devbox.soaddress that you or your workspace can open in a browser, with no local process involved.
Port forwarding
Forward ports from your Devbox tolocalhost. Keep the command running for as long as you need the ports:
local:remote syntax:
devbox port-forward my-devbox without --ports forwards all of them automatically.
See devbox port-forward for every option.
Shareable URLs
Shareable URLs make an HTTP service running on a Devbox accessible through adevbox.so URL. Use them to access web applications, APIs, dashboards, and other HTTP endpoints from outside the Devbox.
Unlike port forwarding, a shareable URL does not require a local port or a running CLI process.
Expose a shareable URL
Expose an application running on port 3000 so you can open it in your browser:1
Start a service
Start the HTTP service on your Devbox.
For example, run a web project on port 3000.
2
Expose the service
Expose the service through a shareable URL:The CLI prints the URL to access the service.
- Specify Devbox name
- Select Devbox Interactively
Provide the Devbox name to expose the service:
Output
3
Access the service
Open the printed URL in your browser to access the service.Shareable URLs require authentication, so you will be prompted to log in with your Namespace account if you are not already logged in.
Opening a shareable URL wakes a sleeping Devbox automatically. To have the service ready when the Devbox starts, define a session in the Devbox spec that runs its startup command.
Manage shareable URLs
View exposed URLs
View details of exposed URLs with the following commands:- List all
- Get by port
- Get by name
View every shareable URL exposed by the Devbox:
Remove a shareable URL
When you no longer need a shareable URL, remove it by port or name:- Unexpose by port
- Unexpose by name
Remove the shareable URL for a specific port:
Manage access
Shareable URLs use one access mode for all exposed ports on a Devbox:privatelimits access to the Devbox owner.workspaceallows access to members of the workspace.
devbox url access:
- Check access
- Update access
Output
devbox url CLI reference.
Exposing ports from within a Devbox
You can also manage shareable URLs from within a Devbox with theboxctl utility. The commands work the same way, but you can omit the Devbox name because they run within the Devbox.
1
Connect to your Devbox
Open a shell in the Devbox where the HTTP service is running:
2
Run boxctl commands
Use
boxctl url to expose, inspect, or remove shareable URLs from within the Devbox:Tell your agent
An agent with the Namespace devboxes skill installed can expose a port and report the URL for you. Ask for the outcome rather than the command:Agent Prompt
devbox url expose, and asks before changing the access mode, since that setting applies to every URL on the Devbox.
Related topics
devbox url
Review all commands, options, and output formats.
devbox port-forward
Every option accepted by
port-forward.Remote Development
SSH access and SSH config for a Devbox.