# Deploy Blnk Watch

Deploy Blnk Watch for production using the compiled binary and the start command.

For production deployments, install or build the Watch binary and run it with the `start` command. This gives you the standard long-running Watch process: the HTTP service starts, and when `DB_URL` is set, Watch also runs continuous Core sync in the same process.

## Standard deployment

<Tabs>
<Tab title="Direct download" icon="download">
Use direct download to fetch and install the Watch binary on your system. No Git or Go is required for the binary itself.

<Steps titleSize="h3">
<Step title="Install Watch">
Install the Watch binary without cloning the repo or building from source:

```bash Install Watch
curl -fsSL https://blnkfinance.xyz/install/watch | bash
```

This installs the `blnk-watch` binary on your machine.
</Step>

<Step title="Set environment variables">
Set the environment variables Watch needs:

```bash .env wrap
# PostgreSQL database connection string
DB_URL=postgres://user:password@localhost:5432/blnk?sslmode=disable

# GitHub repo containing your .ws rule files (required when not using a local rules directory)
WATCH_SCRIPT_GIT_REPO=https://github.com/your-org/watch-rules.git
WATCH_SCRIPT_GIT_BRANCH=main

# Private HTTPS repos only
WATCH_SCRIPT_GIT_USERNAME=x-access-token
WATCH_SCRIPT_GIT_TOKEN=
```

See [Configuration](/watch/configuration) for the full list, including Git authentication for private repos.
</Step>

<Step title="Start Watch">
Run Watch with the `start` command:

```bash start
blnk-watch start
```
</Step>
</Steps>
</Tab>

<Tab title="Build from source" icon="terminal">
Build the Watch binary from the source repository. Use this when you have Go installed and want to compile locally (for example, to pin a version or run from the project directory).

<Steps titleSize="h3">
<Step title="Build the binary">
From the Watch project root, build the binary:

```bash build
go build -o blnk-watch ./cmd/blnk-watch
```

This produces a `blnk-watch` binary in the current directory.
</Step>

<Step title="Set environment variables">
Set the environment variables Watch needs:

```bash .env wrap
DB_URL=postgres://user:password@localhost:5432/blnk?sslmode=disable
```

See [Configuration](/watch/configuration) for the full list.
</Step>

<Step title="Start Watch">
From the Watch project root, run the binary with the `start` command:

```bash start
./blnk-watch -command=start
```
</Step>
</Steps>
</Tab>
</Tabs>

## For PaaS deployments (Railway, Render, Fly.io, etc)

The same deployment steps apply, but you need to attach a persistent volume to the container. Watch stores its data on disk.

However, most PaaS platforms have a temporary disk that is wiped on redeploys. To prevent this, attach a persistent volume mounted at `./blnk_watch_db` so that data survives restarts and redeploys.

<RelatedTopics
  items={[
    { title: "Quick start", href: "/watch/quick-start" },
    { title: "Configuration", href: "/watch/configuration" },
    { title: "Integration", href: "/watch/integration" },
  ]}
/>