> ## 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.

# devbox url

> Expose Devbox ports through devbox.so URLs and manage their access.

Use `devbox url` to expose HTTP ports through `devbox.so`, retrieve or remove exposed URLs, and inspect or change access for all exposed URLs on a Devbox.

<h2 id="url-usage">
  Usage
</h2>

```bash theme={null}
devbox url [command]
```

<h2 id="url-options">
  Options
</h2>

<ResponseField name="--show-all" type="boolean" default="false">
  Include Devboxes owned by other workspace members when selecting a Devbox. This option is inherited by each `devbox url` subcommand.
</ResponseField>

## `devbox url expose`

Expose one or more ports. Repeating an existing matching exposure returns it instead of creating a duplicate. A name can only be used when exposing one port.

<Info>
  `devbox url create` is an alias for `devbox url expose`.
</Info>

<h3 id="expose-usage">
  Usage
</h3>

<CodeGroup>
  ```bash Canonical theme={null}
  devbox url expose [devbox-name] --port <port> [--port <port>...] [flags]
  ```

  ```bash Alias theme={null}
  devbox url create [devbox-name] --port <port> [--port <port>...] [flags]
  ```
</CodeGroup>

### Expose an HTTP port

<CodeGroup>
  ```bash Canonical theme={null}
  devbox url expose main --port 3000
  ```

  ```bash Alias theme={null}
  devbox url create main --port 3000
  ```
</CodeGroup>

<h3 id="expose-options">
  Options
</h3>

<ResponseField name="--port" type="uints" default="[]" required>
  Specify a port to expose. Repeat the option or use a comma-separated value to expose multiple ports. Ports must be between `1` and `65535` without duplicates.
</ResponseField>

<ResponseField name="--access" type="string">
  Set access for all exposed URLs to `private` or `workspace` after exposing the requested ports.
</ResponseField>

<ResponseField name="--name" type="string">
  Assign a name to a single exposed port.
</ResponseField>

<ResponseField name="-o, --output" type="string">
  Set the output format to `json` or `table`. Leave empty for the default table.
</ResponseField>

***

## `devbox url unexpose`

Remove exposed URLs by port or by name. Specify exactly one selector form. Ports or names that are not currently exposed are ignored.

<Info>
  `devbox url delete` is an alias for `devbox url unexpose`.
</Info>

<h3 id="unexpose-usage">
  Usage
</h3>

<CodeGroup>
  ```bash Canonical theme={null}
  devbox url unexpose [devbox-name] (--port <port> [--port <port>...] | --name <name>) [flags]
  ```

  ```bash Alias theme={null}
  devbox url delete [devbox-name] (--port <port> [--port <port>...] | --name <name>) [flags]
  ```
</CodeGroup>

### Remove an exposed URL

<CodeGroup>
  ```bash Canonical theme={null}
  devbox url unexpose main --port 3000
  ```

  ```bash Alias theme={null}
  devbox url delete main --port 3000
  ```
</CodeGroup>

<h3 id="unexpose-options">
  Options
</h3>

<ResponseField name="--name" type="string">
  Remove the URL with this name. Specify exactly one of `--name` or `--port`.
</ResponseField>

<ResponseField name="-o, --output" type="string">
  Accept an output format of `json` or `table`. This version produces no output when URLs are removed.
</ResponseField>

<ResponseField name="--port" type="uints" default="[]">
  Remove URLs for these ports. Repeat the option or use a comma-separated value. Specify exactly one of `--port` or `--name`.
</ResponseField>

***

## `devbox url get`

Return exposed URLs selected by port or by name. Specify exactly one selector form. Every requested port, or the requested name, must have an exposed URL.

<h3 id="get-usage">
  Usage
</h3>

```bash theme={null}
devbox url get [devbox-name] (--port <port> [--port <port>...] | --name <name>) [flags]
```

### Get a URL by name

```bash theme={null}
devbox url get main --name web
```

<h3 id="get-options">
  Options
</h3>

<ResponseField name="--name" type="string">
  Return the exposed URL with this name. Specify exactly one of `--name` or `--port`.
</ResponseField>

<ResponseField name="-o, --output" type="string">
  Set the output format to `json` or `table`. Leave empty for the default table.
</ResponseField>

<ResponseField name="--port" type="uints" default="[]">
  Return URLs for these ports. Repeat the option or use a comma-separated value. Specify exactly one of `--port` or `--name`.
</ResponseField>

***

## `devbox url list`

List all exposed HTTP URLs for a Devbox, sorted by port number.

<h3 id="list-usage">
  Usage
</h3>

```bash theme={null}
devbox url list [devbox-name] [flags]
```

### List exposed URLs as JSON

```bash theme={null}
devbox url list main --output json
```

<h3 id="list-options">
  Options
</h3>

<ResponseField name="-o, --output" type="string">
  Set the output format to `json` or `table`. Leave empty for the default table.
</ResponseField>

***

## `devbox url access`

Print the current access mode for a Devbox's exposed URLs. Pass `--mode` to change the mode to owner-only `private` access or workspace-wide `workspace` access.

<h3 id="access-usage">
  Usage
</h3>

```bash theme={null}
devbox url access [devbox-name] [flags]
```

### Set workspace access

```bash theme={null}
devbox url access main --mode workspace
```

<h3 id="access-options">
  Options
</h3>

<ResponseField name="--mode" type="string">
  Set the access mode to `private` or `workspace`. Leave empty to inspect the current mode without changing it.
</ResponseField>

<ResponseField name="-o, --output" type="string">
  Set the output format to `json` or `text`. Leave empty for the default text output.
</ResponseField>

## Related topics

<Card title="Remote development" icon="monitor" href="/docs/devbox/remote-development">
  Access services running on a Devbox.
</Card>
