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

> ## Agent Instructions
> Anchor Browser is cloud browser infrastructure for AI agents and automation: browser sessions you control over CDP or REST, natural-language web tasks, versioned automation tasks, managed authentication into third-party web apps (identities with MFA), persistent volumes and profiles, recordings, live view, batch sessions, webhooks, and network options including residential proxies, extra stealth, and captcha solving for sites that block standard browsers. The for-agents page (https://docs.anchorbrowser.io/for-agents) covers authentication and the first API calls. API keys are created at https://app.anchorbrowser.io/api-keys. Append .md to any page URL for its Markdown version. The SDKs read the API key from ANCHORBROWSER_API_KEY, and REST calls send it in the anchor-api-key header. End every session you create with DELETE /v1/sessions/{id}, because a session is billed until it ends. Location targeting, captcha solving and managed authentication need the Starter plan, and extra stealth needs the Growth plan; on the Free plan, create a session with an empty body. Plans and limits are at https://docs.anchorbrowser.io/pricing. The hosted MCP server is https://api.anchorbrowser.io/v1/mcp.

# Anchor Dock

> Use Anchor browsers from a network that allows no inbound connections and limited outbound access

Anchor Dock is a single binary you run on a host inside a restricted network. Machines on that network talk only to the Dock; the Dock is the one host allowed to reach Anchor over HTTPS. Clients keep using the normal Anchor API, and every URL Anchor returns (`cdp_url`, `live_view_url`) is rewritten to point at the Dock, so CDP, VNC and the live view page all work without any client reaching the internet. The Dock can also let Anchor browsers open pages hosted on your network; see [Reach your intranet](#reach-your-intranet-from-anchor-browsers).

> [!NOTE]
>
> Contact Anchor to get the binary. Builds are available for Linux (x86-64 and arm64) and Windows (x86-64).

## Where traffic stays

![Two dashed boxes. On the left, the on-prem network: a client points at the Dock, and intranet sites sit below. On the right, Anchor cloud: the Dock sends API and control traffic to the Anchor app, which runs the browsers. The browsers reach public sites directly and intranet sites through an intranet tunnel back to the Dock.](https://mintcdn.com/anchor-b3ec2715/VP52UCP8ArguZA6z/images/anchor-on-prem-architecture-diagram-v2.png?fit=max\&auto=format\&n=VP52UCP8ArguZA6z\&q=85\&s=308df01669142b86042afa5194b2ed62)

Clients talk to the Dock, on your network. The Dock carries API and control traffic to the Anchor app; the browsers themselves run in Anchor cloud, so all compute and rendering happens there. They load public websites directly, and, if you allow it, reach intranet hosts back on your network through a tunnel that the Dock opens outbound. The Dock is the only host that opens a connection out, and a small machine is enough for it: it relays traffic and never runs a browser.

## Network requirements

| Direction | Requirement |
| - | - |
| Inbound to the Dock host | The port you choose (default `8080`), from your clients only |
| Outbound from the Dock host | TCP 443 to `api.anchorbrowser.io`, `connect.anchorbrowser.io` and `live.anchorbrowser.io` |
| Inbound from the internet | None |

Allow the three hostnames rather than IP addresses; `live.anchorbrowser.io` is served from a CDN and its addresses rotate. If your network requires an egress proxy, the Dock supports `HTTPS_PROXY` (see [Configuration](#configuration)).

If a firewall blocks clients from reaching the Dock, open the listen port to them.

## Install

Run these on the Dock host: with `sudo` on Linux, from a PowerShell window opened as Administrator on Windows. The wizard is the same on both; only paths and the way the Dock is kept running differ.

> [tab] Linux
>
> **1. Fetch the binary**
>
> Copy `anchor-dock` onto the host and install it:
>
> ```bash theme={null}
> sudo install -D -m 0755 anchor-dock /opt/anchor/anchor-dock
> /opt/anchor/anchor-dock version
> ```
>
> **2. Run the setup wizard**
>
> ```bash theme={null}
> sudo /opt/anchor/anchor-dock setup
> ```
>
> The wizard asks for three things: the listen port, the bind address, and whether Anchor browsers may reach hosts on your network. It then writes `/etc/anchor/dock.env`, creates the Dock's identity key at `/etc/anchor/id_ed25519` if missing, checks that all three Anchor hosts are reachable, asks for a connection token to [register](#register-the-dock) the Dock, and offers to start serving. Answer `n` to that if you are about to set up the service below. There is one env file and one key per host, whichever user runs the commands.
>
> Everything else (TLS, intranet allowlists, a private Anchor region, an egress proxy) is set by editing the env file. See [Configuration](#configuration).
>
> **3. Run it as a service**
>
> A shell session that closes takes the Dock with it. Use systemd:
>
> ```ini theme={null}
> [Unit]
> Description=Anchor Dock
> After=network-online.target
> Wants=network-online.target
>
> [Service]
> ExecStart=/opt/anchor/anchor-dock serve
> Restart=always
> RestartSec=3
> NoNewPrivileges=true
> ProtectSystem=strict
> ProtectHome=true
> PrivateTmp=true
>
> [Install]
> WantedBy=multi-user.target
> ```
>
> ```bash theme={null}
> sudo systemctl daemon-reload
> sudo systemctl enable --now anchor-dock
> journalctl -u anchor-dock -f
> ```
>
> The service runs as root by default so it can read `/etc/anchor`, which `setup` creates with mode `0700`. To run it as an unprivileged user instead, give that user the directory and name it in the unit:
>
> ```bash theme={null}
> sudo useradd --system --no-create-home anchor
> sudo chown -R anchor:anchor /etc/anchor
> ```
>
> Then add `User=anchor` under `[Service]`. A log line `env file: open /etc/anchor/dock.env: permission denied` means the service user cannot read the directory.

> [tab] Windows
>
> **1. Fetch the binary**
>
> Extract `anchor-dock.exe` into `C:\Program Files\Anchor` and clear the download mark so SmartScreen does not hold it back:
>
> ```powershell theme={null}
> New-Item 'C:\Program Files\Anchor' -ItemType Directory -Force
> Expand-Archive .\anchor-dock-windows-amd64.zip -DestinationPath 'C:\Program Files\Anchor' -Force
> Unblock-File 'C:\Program Files\Anchor\anchor-dock.exe'
> & 'C:\Program Files\Anchor\anchor-dock.exe' version
> ```
>
> **2. Allow clients in**
>
> If a firewall blocks clients from reaching the Dock, open the listen port:
>
> ```powershell theme={null}
> New-NetFirewallRule -DisplayName "Anchor Dock" -Direction Inbound -Action Allow `
>   -Protocol TCP -LocalPort 8080 -Program 'C:\Program Files\Anchor\anchor-dock.exe'
> ```
>
> Add `-RemoteAddress 10.20.0.0/16` to limit the rule to your clients' range. On a host managed by Intune or Group Policy, local firewall rules may be ignored; the rule then has to be delivered through that policy.
>
> **3. Create the settings folder**
>
> The env file and the identity key live in one folder per host. Windows does not apply the Unix file modes the Dock sets, so restrict the folder yourself before the key is created; otherwise every local account can read it.
>
> ```powershell theme={null}
> New-Item C:\ProgramData\Anchor -ItemType Directory -Force
> icacls C:\ProgramData\Anchor /inheritance:r /grant:r "SYSTEM:(OI)(CI)F" "BUILTIN\Administrators:(OI)(CI)F"
> ```
>
> **4. Run the setup wizard**
>
> ```powershell theme={null}
> & 'C:\Program Files\Anchor\anchor-dock.exe' setup --env-file C:\ProgramData\Anchor\dock.env
> ```
>
> The wizard asks for three things: the listen port, the bind address, and whether Anchor browsers may reach hosts on your network. It then writes `C:\ProgramData\Anchor\dock.env`, creates the Dock's identity key at `C:\ProgramData\Anchor\id_ed25519` if missing, checks that all three Anchor hosts are reachable, asks for a connection token to [register](#register-the-dock) the Dock, and offers to start serving. Answer `n` to that if you are about to set up the scheduled task below. Pass the same `--env-file` to `check` and `serve`.
>
> Everything else (TLS, intranet allowlists, a private Anchor region, an egress proxy) is set by editing the env file. See [Configuration](#configuration).
>
> **5. Run it at startup**
>
> A PowerShell window that closes takes the Dock with it. Register a scheduled task that runs as `SYSTEM`, starts at boot and restarts on failure:
>
> ```powershell theme={null}
> $cmd = '/c ""C:\Program Files\Anchor\anchor-dock.exe" serve --env-file C:\ProgramData\Anchor\dock.env 2>> C:\ProgramData\Anchor\dock.log"'
> $action    = New-ScheduledTaskAction -Execute 'cmd.exe' -Argument $cmd
> $trigger   = New-ScheduledTaskTrigger -AtStartup
> $principal = New-ScheduledTaskPrincipal -UserId 'SYSTEM' -LogonType ServiceAccount -RunLevel Highest
> $settings  = New-ScheduledTaskSettingsSet -RestartCount 999 -RestartInterval (New-TimeSpan -Minutes 1) -ExecutionTimeLimit ([TimeSpan]::Zero)
> Register-ScheduledTask -TaskName 'AnchorDock' -Action $action -Trigger $trigger -Principal $principal -Settings $settings -Force
> Start-ScheduledTask -TaskName 'AnchorDock'
> Get-Content C:\ProgramData\Anchor\dock.log -Tail 20 -Wait
> ```
>
> The Dock appends its log to `C:\ProgramData\Anchor\dock.log`. Stop and start it with `Stop-ScheduledTask AnchorDock` and `Start-ScheduledTask AnchorDock`.

## Register the Dock

A Dock joins your project by spending a one-time connection token. Until it is registered, Anchor refuses to create sessions for requests that come through it.

**1. Create a connection token**

In the dashboard, open **Connectors** and select **Create token**, or call the API:

```bash theme={null}
curl -X POST https://api.anchorbrowser.io/v1/connectors/tokens \
  -H "anchor-api-key: $ANCHORBROWSER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "office-dock"}'
```

The token starts with `act_` and is shown once. The name you give it becomes the Dock's name. A token registers one machine and expires after an hour if unused; a project can hold up to five unused tokens at a time. The same tokens register connectors too.

**2. Spend it on the Dock host**

Paste the token when `setup` asks for it, or run `register`:

```bash Linux theme={null}
sudo /opt/anchor/anchor-dock register --token act_…
```

```powershell Windows theme={null}
& 'C:\Program Files\Anchor\anchor-dock.exe' register --token act_… --env-file C:\ProgramData\Anchor\dock.env
```

The Dock sends its public key with the token and prints the id it was given:

```
Registered dock "office-dock" (3f1c2a9e-5b7d-4c61-9a0e-2d8f4b6c1e73).
```

`anchor answered 401` means the token is wrong, expired or already used; create a new one. `anchor answered 409` means the project already has a connector or Dock with that name, or a Dock with this public key.

To print the Dock's public key, for example to match it against the dashboard:

```bash Linux theme={null}
sudo /opt/anchor/anchor-dock setup-keys
```

```powershell Windows theme={null}
& 'C:\Program Files\Anchor\anchor-dock.exe' setup-keys --signing-key C:\ProgramData\Anchor\id_ed25519
```

### Several Docks

A project can register several Docks, for example one per site. Each host runs its own Dock with its own identity key and registers with its own token. A public key registers once; to move a Dock to a new key, delete it and register again. Sessions created outside your network name the Dock they use with [`dock_id`](#sessions-created-outside-your-network).

### Manage Docks

The **Connectors** page lists your Docks with their id, status and last connection, and deletes them. The same is available from the API:

| Request | Purpose |
| - | - |
| `GET /v1/docks` | List the project's Docks |
| `GET /v1/docks/{dock_id}` | Get one Dock |
| `DELETE /v1/docks/{dock_id}` | Delete a Dock. It stops accepting sessions under this id; the host must register again with a new token |

```json theme={null}
{
  "data": {
    "id": "3f1c2a9e-5b7d-4c61-9a0e-2d8f4b6c1e73",
    "name": "office-dock",
    "kind": "dock",
    "public_key": "Jq3v8m1Qe0cT2yRZb5nW7kXo9sLd4uHfA6gPiCzN0Ew=",
    "created_at": "2026-10-15T10:57:57.144Z",
    "last_attached_at": "2026-10-15T11:24:40.449Z",
    "online": true
  }
}
```

`online` and `last_attached_at` track the [lasting connection](#sessions-created-outside-your-network). A Dock that does not open one shows as offline, while sessions created through it on your network keep working.

## Commands

| Command | Purpose |
| - | - |
| `setup` | Interactive setup: writes the env file, checks connectivity, offers to start |
| `serve` | Run the Dock. Flags such as `--listen` and `--public-url` override the env file |
| `check` | Re-check connectivity without starting the server. Exits non-zero on any failure and prints the reason (DNS, TLS trust, egress proxy, timeout) |
| `setup-keys` | Create the identity key if missing and print the public key |
| `register --token act_…` | Register this Dock with your project using a one-time connection token. See [Register the Dock](#register-the-dock) |
| `check-cdp --url ws://dock.corp:8080/cdp?sessionId=…` | Open a CDP socket through a running Dock and print the browser version, to confirm a session is reachable from a client machine. For a session that uses [scoped access tokens](#scoped-access-tokens), pass its `?token=…` URL |
| `version` | Print the build version |

`setup`, `check`, `serve` and `register` accept `--env-file PATH`. The default is `/etc/anchor/dock.env`, which is why they run under `sudo` on Linux. On Windows that default resolves to `C:\etc\anchor\dock.env`; the steps above pass `--env-file C:\ProgramData\Anchor\dock.env` instead so the settings live where Windows keeps machine-wide state.

## Use it

Point your client at the Dock instead of `api.anchorbrowser.io`. Authentication is unchanged: send your Anchor API key.

```bash theme={null}
curl -X POST http://dock.corp:8080/v1/sessions \
  -H "anchor-api-key: $ANCHORBROWSER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```json theme={null}
{
  "data": {
    "id": "…",
    "cdp_url": "ws://dock.corp:8080/cdp?sessionId=…",
    "live_view_url": "http://dock.corp:8080/live/?host=dock.corp%3A8080&encrypt=0&sessionId=…"
  }
}
```

The URLs point at whatever address your client used to reach the Dock: a request to `http://10.20.0.5:8080` gets `ws://10.20.0.5:8080/cdp?…` back.

Connect Playwright or Puppeteer to `cdp_url` and open `live_view_url` in a browser on your network, exactly as you would with the cloud URLs. Every `/v1` and `/v2` endpoint is available through the Dock; requests to any other path are refused.

### Scoped access tokens

[Scoped access tokens](https://docs.anchorbrowser.io/advanced/scoped-access-tokens.md) work through the Dock. Create the session or mint tokens through the Dock, and every token URL points at the Dock: `cdp_url`, `live_view_url`, `live_view_read_only_url`, and the `url` of each entry in `scoped_access_tokens` or `tokens`.

```json theme={null}
{
  "data": {
    "live_view_read_only_url": "http://dock.corp:8080/live/?host=dock.corp%3A8080&encrypt=0&token=…&viewOnly=1",
    "tokens": [
      {
        "id": "tok_…",
        "scope": "live_view_read_only",
        "token": "…",
        "url": "http://dock.corp:8080/live/?host=dock.corp%3A8080&encrypt=0&token=…&viewOnly=1"
      }
    ]
  }
}
```

List, get and revoke tokens by id through the Dock as you would against Anchor.

`allowed_ips` is checked against the address Anchor sees. For a connection through the Dock, that is the Dock's public address, not the client's address on your network: to restrict a token to clients that reach it through the Dock, list every address the Dock's traffic leaves your network from.

## How traffic moves

```mermaid actions={false} theme={null}
sequenceDiagram
    participant Client
    participant Dock as Anchor Dock
    participant App as Anchor browser app
    participant Browser as Browser

    Client->>Dock: POST /v1/sessions
    Dock->>App: signed request
    App-->>Dock: cdp_url and live_view_url
    Note over Dock: rewrite those WebSocket URLs onto the Dock
    Dock-->>Client: cdp_url and live_view_url on the Dock
    Client->>Dock: open CDP and the live view
    Dock->>Browser: relay the WebSockets

    Client-->Browser: Optional: allow Anchor browsers onto your network

    Dock->>App: open a WebSocket and wait for connections
    Browser->>App: open an internal host through the proxy
    Note over App: proxy connection is attached
    Browser->>Dock: forward the dial on the pipe
    Note over Dock: the browser is seen as an insider IP
```

The client asks the Dock for a session. The Anchor browser app answers with cloud WebSocket URLs. The Dock rewrites `cdp_url` and `live_view_url`, and the sockets the client opens stay on the Dock. The Dock relays them to the app, which carries them to the browser.

The steps below the dashed line apply when Anchor browsers are allowed onto your network. The Dock dials the app to attach the proxy, and the browser opens internal hosts through it. The Dock places the TCP connection, so the intranet host sees the Dock's address.

## Configuration

Settings live in the env file (`/etc/anchor/dock.env` on Linux, `C:\ProgramData\Anchor\dock.env` in the Windows steps above) as `KEY=VALUE` lines. `setup` writes every key; edit the file for anything the wizard does not ask about, then restart the service. Rerunning `setup` keeps your values but rewrites the file, so comments you add are lost. Environment variables named `DOCK_*` and `dock serve` flags override the file.

`setup` asks for `DOCK_LISTEN` and `DOCK_INTRANET_ACCESS`. Set the rest in the file.

| Key | Default | Meaning |
| - | - | - |
| `DOCK_LISTEN` | `0.0.0.0:8080` | Address and port the Dock listens on |
| `DOCK_SIGNING_KEY` | `id_ed25519` next to the env file | The Dock's identity key. Never leaves the host |
| `DOCK_INTRANET_ACCESS` | `off` | `on` lets Anchor browsers reach hosts on your network. See [Reach your intranet](#reach-your-intranet-from-anchor-browsers) |
| `DOCK_OPEN_LASTING_CONNECTION` | `off` | `on` keeps one outbound connection so Anchor can start dock sessions from outside your network. Requires `DOCK_INTRANET_ACCESS=on` |
| `DOCK_ALLOW_DOMAINS` | empty | Comma-separated domains, subdomains included, that Anchor browsers may reach |
| `DOCK_ALLOW_CIDRS` | empty | Comma-separated IP ranges or single addresses that Anchor browsers may reach |
| `DOCK_PUBLIC_URL` | empty | `https://` address to hand back when TLS ends in front of the Dock. Applies only to requests whose `Host` header matches it |
| `DOCK_API_URL` | `https://api.anchorbrowser.io` | Change only for a private Anchor region |
| `DOCK_CONNECT_URL` | `wss://connect.anchorbrowser.io` | Change only for a private Anchor region |
| `DOCK_LIVE_URL` | `https://live.anchorbrowser.io` | Change only for a private Anchor region |
| `DOCK_MAX_REQUEST_BYTES` | `1536k` | Largest request body accepted from clients |
| `DOCK_MAX_JSON_RESPONSE_BYTES` | `12m` | Largest JSON response the Dock will rewrite |
| `HTTPS_PROXY`, `HTTP_PROXY`, `NO_PROXY` | unset | Egress proxy for the Dock's connections to Anchor. Read from this file only; the process environment is ignored |

Sizes accept plain bytes or a `k`/`m` suffix.

The egress proxy comes from this file only. The Dock does not read the operating system's proxy settings or PAC files, and the proxy must accept unauthenticated or Basic-authenticated connections; NTLM and Kerberos proxies are not supported. If yours requires them, ask for a rule that lets the Dock host reach the three Anchor hostnames directly.

## Reach your intranet from Anchor browsers

Off by default. With `DOCK_INTRANET_ACCESS=on`, a session that uses the `dock` proxy type sends its browser traffic out through the Dock, so it can open pages hosted on your network. The browsers still run in Anchor's cloud; only their traffic leaves through the Dock, and the intranet host sees the Dock's address. Nothing inbound is opened on your firewall.

The proxy is `{"active": true, "type": "dock"}`, with an optional `dock_id` naming the Dock to use. Any other proxy field is rejected.

```bash theme={null}
curl -X POST http://dock.corp:8080/v1/sessions \
  -H "anchor-api-key: $ANCHORBROWSER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"session": {"proxy": {"active": true, "type": "dock"}}}'
```

`DOCK_ALLOW_DOMAINS` and `DOCK_ALLOW_CIDRS` limit where those browsers may connect. A destination passes when its name is a listed domain or a subdomain of one, or when every address it resolves to falls inside a listed range. The lists cover all of the session's traffic, so public sites that are not listed will not load. With both empty, any host the Dock can reach is allowed, and `setup` and `serve` warn about it. Link-local and cloud metadata addresses are always refused; loopback is refused unless you list it. The Dock's connection for a session closes when the session ends.

### Sessions created on your network

Send the create through the Dock, as in the example above. The session uses the Dock the request came through, so `dock_id` is not needed; if you send it, it must be that Dock's id. The Dock reads the session id from the response and opens that session's connection itself. Async session creation does not accept the `dock` proxy type on requests sent through the Dock.

### Sessions created outside your network

Set `DOCK_OPEN_LASTING_CONNECTION=on` in the env file and restart the Dock. It requires `DOCK_INTRANET_ACCESS=on`. The Dock then keeps one outbound connection to Anchor, and sessions started from the API, the dashboard or a task run can use the same proxy. Anchor asks the Dock over that connection to open the session's pipe. Ask Anchor to enable this for your project. The same proxy can be saved on an application, so a task linked to that application uses the Dock.

With one Dock in the project, `dock_id` can be left out. With several, name the Dock by the id `register` printed, or the one listed on the **Connectors** page:

```bash theme={null}
curl -X POST https://api.anchorbrowser.io/v1/sessions \
  -H "anchor-api-key: $ANCHORBROWSER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"session": {"proxy": {"active": true, "type": "dock", "dock_id": "3f1c2a9e-5b7d-4c61-9a0e-2d8f4b6c1e73"}}}'
```

`cdp_url` and `live_view_url` in that response point at Anchor, because the client is not on your network. The browser's own traffic still goes through the Dock. If the Dock cannot carry the session, the create fails instead of starting a session with no network; see [Dock proxy errors](#dock-proxy-errors).

### Dock proxy errors

A create that uses the `dock` proxy and cannot be served answers with an `error` message that starts with one of these codes:

| Code | Status | Meaning |
| - | - | - |
| `DOCK_ID_REQUIRED` | 400 | Sent from outside your network, the project has several Docks, and the request named none |
| `DOCK_NOT_FOUND` | 404 | No Dock in the project has this `dock_id` |
| `DOCK_ID_MISMATCH` | 400 | Sent through one Dock, the request named another Dock's id |
| `DOCK_OFFLINE` | 400 | The Dock's lasting connection is down |
| `DOCK_UNAVAILABLE` | 502 | The Dock did not open the session's pipe |
| `DOCK_SIGNATURE_REQUIRED` | 401 | Sent from outside your network, and sessions from outside are not enabled for the project, or the project is locked to its Docks |
| `DOCK_SIGNATURE_INVALID` | 401 | Sent through a Dock that is not registered with the project or was deleted, or whose signature did not verify; check the Dock host's clock |
| `DOCK_REMOTE_SESSIONS_DISABLED` | 400 | A task or application uses the `dock` proxy, and sessions from outside your network are not enabled for the project |

## Security notes

* The Dock does not hold your API key. Clients present it on every request, and the Dock forwards it to Anchor together with a signature from the Dock's own identity key.
* The Dock serves plain HTTP. On a network you do not fully trust, terminate TLS in a reverse proxy that passes the original `Host` header and WebSocket upgrades, and set `DOCK_PUBLIC_URL` to the `https://` address; rewritten URLs then use `wss://` and the live view connects encrypted.
* With intranet access on, set an allowlist. Without one, a browser in a dock session can reach any host the Dock can.
* Anchor can lock your project so that sessions are created only through your Docks; ask Anchor to enable it once they are running.
* Delete a Dock you retire, from the **Connectors** page or with `DELETE /v1/docks/{dock_id}`. Its key can no longer create sessions for your project.
* `live_view.one_time_url` is not enforced for links opened through the Dock. The single-use check is made by the viewer page against the Anchor API, which clients on your network cannot reach.
* The headless (DevTools) live view is returned unchanged and requires direct access to Anchor. Use the default headful live view on restricted networks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.