> ## Documentation Index
> Fetch the complete documentation index at: https://namespace.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Shareable URL

> Expose HTTP services running on a Devbox through devbox.so URLs.

Shareable URLs make an HTTP service running on a Devbox accessible through a `devbox.so` URL. Use them to access web applications, APIs, dashboards, and other HTTP endpoints from outside the Devbox.

Unlike [port forwarding](/docs/devbox/remote-development#port-forwarding), a shareable URL does not require a local port or a running CLI process.

<h2 id="expose-url">
  Expose a shareable URL
</h2>

Expose an application running on port 3000 so you can open it in your browser:

<Steps titleSize="h3">
  <Step title="Start a service">
    Start the HTTP service on your Devbox.
    For example, run a web project on port 3000.
  </Step>

  <Step title="Expose the service">
    Expose the service through a shareable URL:

    <Tabs>
      <Tab title="Specify Devbox name">
        Provide the Devbox name to expose the service:

        ```bash theme={null}
        devbox url expose my-devbox --port 3000 --name web
        ```
      </Tab>

      <Tab title="Select Devbox Interactively">
        Skip the Devbox name to select it interactively:

        ```bash theme={null}
        devbox url expose --port 3000 --name web
        ```
      </Tab>
    </Tabs>

    The CLI prints the URL to access the service.

    ```text nocopy Output theme={null}
     ╭───────────────────────────────────────────────────────╮ 
     │ Port Name URL                                         │ 
     │───────────────────────────────────────────────────────│ 
     │ 3000 web  https://dbxobe71pivgcufc-p3000.devbox.so/   │ 
     ╰───────────────────────────────────────────────────────╯ 
    ```
  </Step>

  <Step title="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.

    <Info>
      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](/docs/devbox/managing#sessions) that runs its startup command.
    </Info>
  </Step>
</Steps>

<h2 id="manage-urls">
  Manage shareable URLs
</h2>

### View exposed URLs

View details of exposed URLs with the following commands:

<Tabs>
  <Tab title="List all">
    View every shareable URL exposed by the Devbox:

    ```bash theme={null}
    devbox url list my-devbox
    ```
  </Tab>

  <Tab title="Get by port">
    Retrieve the shareable URL for a specific port:

    ```bash theme={null}
    devbox url get my-devbox --port 3000
    ```
  </Tab>

  <Tab title="Get by name">
    Retrieve a shareable URL by its assigned name:

    ```bash theme={null}
    devbox url get my-devbox --name web
    ```
  </Tab>
</Tabs>

<h3 id="remove-url">
  Remove a shareable URL
</h3>

When you no longer need a shareable URL, remove it by port or name:

<Tabs>
  <Tab title="Unexpose by port">
    Remove the shareable URL for a specific port:

    ```bash theme={null}
    devbox url unexpose my-devbox --port 3000
    ```
  </Tab>

  <Tab title="Unexpose by name">
    Remove the shareable URL for a specific name:

    ```bash theme={null}
    devbox url unexpose my-devbox --name web
    ```
  </Tab>
</Tabs>

<h3 id="manage-access">
  Manage access
</h3>

Shareable URLs use one access mode for all exposed ports on a Devbox:

* `private` limits access to the Devbox owner.
* `workspace` allows access to members of the workspace.

Set the access mode while exposing a port:

```bash theme={null}
devbox url expose my-devbox --port 3000 --access workspace
```

To inspect or change the access mode later, use `devbox url access`:

<Tabs>
  <Tab title="Check access">
    ```bash theme={null}
    devbox url access my-devbox
    ```

    ```text nocopy Output theme={null}
    devbox.so access: workspace
    ```
  </Tab>

  <Tab title="Update access">
    ```bash theme={null}
    devbox url access my-devbox --mode private
    ```

    ```text nocopy Output theme={null}
    devbox.so access changed from workspace to private
    ```
  </Tab>
</Tabs>

For all available commands and options, see the [`devbox url` CLI reference](/docs/reference/devbox-cli/url).

<h2 id="expose-from-devbox">
  Exposing ports from within a Devbox
</h2>

You can also manage shareable URLs from within a Devbox with the `boxctl` utility. The commands work the same way, but you can omit the Devbox name because they run within the Devbox.

<Steps>
  <Step title="Connect to your Devbox">
    Open a shell in the Devbox where the HTTP service is running:

    ```bash ssh theme={null}
    devbox ssh my-devbox
    ```
  </Step>

  <Step title="Run boxctl commands">
    Use `boxctl url` to expose, inspect, or remove shareable URLs from within the Devbox:

    <CodeGroup>
      ```bash Expose theme={null}
      boxctl url expose --port 3000 --name web
      ```

      ```bash List theme={null}
      boxctl url list
      ```

      ```bash Get theme={null}
      boxctl url get --port 3000
      ```

      ```bash Remove theme={null}
      boxctl url unexpose --port 3000
      ```

      ```bash View access theme={null}
      boxctl url access
      ```

      ```bash Update access theme={null}
      boxctl url access --mode workspace
      ```
    </CodeGroup>
  </Step>
</Steps>

<h2 id="tell-agent">
  Tell your agent
</h2>

Agents running on your Devbox can manage shareable URLs with `boxctl url`. Ask the agent to expose the port used by your application and return its shareable URL:

```text wrap Agent Prompt theme={null}
Use `boxctl url` to expose the port used by the web application, then print the shareable URL.
```

## Related topics

<CardGroup cols={2}>
  <Card title="Devbox URL CLI reference" icon="terminal" href="/docs/reference/devbox-cli/url">
    Review all commands, options, and output formats.
  </Card>

  <Card title="Remote development" icon="monitor" href="/docs/devbox/remote-development">
    Connect to a Devbox and forward ports to your local machine.
  </Card>
</CardGroup>
