> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.islo.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.islo.dev/_mcp/server.

# Sharing

> Share sandbox ports with teammates or the public using islo share.

Islo lets you create shareable URLs for HTTP services running inside your sandbox. Use shares for preview servers, demos, or any port serving HTTP traffic.

## Creating a Share

```bash
islo share <sandbox-name> [port]
```

| Argument       | Required | Default | Description         |
| -------------- | -------- | ------- | ------------------- |
| `sandbox-name` | Yes      | -       | Name of the sandbox |
| `port`         | No       | `8080`  | Port to share       |

### Options

| Option             | Default | Description                               |
| ------------------ | ------- | ----------------------------------------- |
| `--ttl <duration>` | `24h`   | Auto-expire the share after this duration |

### Examples

```bash
# Share port 8080 (default)
islo share my-sandbox

# Share a specific port
islo share my-sandbox 3000

# Share with a short expiration
islo share my-sandbox 3000 --ttl 1h

# Share for a demo (expires in 30 minutes)
islo share demo-sandbox 8080 --ttl 30m

# JSON output for scripting
islo share my-sandbox 8080 --output json
```

### TTL Duration Format

| Format | Duration           |
| ------ | ------------------ |
| `30m`  | 30 minutes         |
| `1h`   | 1 hour             |
| `24h`  | 24 hours (default) |
| `7d`   | 7 days             |

### Output

```
Share created for my-sandbox:8080
  URL: https://abc123.share.islo.dev
  Expires: <Date-Time>
```

## Listing Shares

View all active shares for a sandbox:

```bash
islo shares <sandbox-name>
```

The table has four columns — `SHARE ID`, `PORT`, `URL`, `EXPIRES`. Use `--output json` for a machine-readable array.

## Revoking Shares

Remove a share to stop external access:

```bash
islo unshare <sandbox-name> <share-id-or-url>
```

### Examples

```bash
# Using the share ID
islo unshare my-sandbox sh_abc123

# Using the full URL
islo unshare my-sandbox https://sh_abc123.example.islo
```

## Use Cases

### Preview Server

Share a development server for review:

```bash
# Start your dev server in the sandbox
islo use my-sandbox -- npm run dev

# Share it
islo share my-sandbox 3000
```

### Demo Link

Create a short-lived URL for a client demo:

```bash
islo share demo-sandbox 8080 --ttl 2h
```

Hand the URL to your client. It stops working automatically after the TTL.

### API Testing

Share an HTTP API endpoint so external systems (webhooks, integration tests) can reach your sandbox:

```bash
islo share api-sandbox 8000 --ttl 4h
```

> Shares are HTTPS endpoints — they're only useful for ports serving HTTP. Non-HTTP protocols (raw Postgres/Redis/SSH) won't work over a share. For non-HTTP debugging, use [`islo port-forward`](/cli/sandbox-commands/#islo-port-forward) instead.

## Quick Reference

| Command                             | Description                                         |
| ----------------------------------- | --------------------------------------------------- |
| `islo share <name> [port]`          | Create a share (default port 8080, default TTL 24h) |
| `islo share <name> <port> --ttl 1h` | Create a share that expires in 1 hour               |
| `islo shares <name>`                | List active shares for a sandbox                    |
| `islo unshare <name> <id-or-url>`   | Revoke a share                                      |

## Notes

* Shares persist until revoked or expired by `--ttl`.
* Multiple shares can exist for the same sandbox on different ports.
* Share URLs are unique and don't change once created.
* Deleting a sandbox automatically removes all its shares.
* Anyone with the URL can reach the shared port until it expires — pick a TTL that matches how long the share actually needs to be live.