# Deploy and verify

Canonical: https://auggy.dev/docs/deploy
Status: Published
Package: auggy 0.5.0

Deploy the agent to **Railway** and verify its health, route, console, and application client.

## Before you deploy

- Install the **Railway** CLI and run railway login.
- Run from the agent project, not the application repository.
- Keep webTransport on port 8080 for the generated **Railway** container.
- Commit application source normally, but keep the agent's .env out of Git.

## First deploy

**Validate and deploy**

```bash
cd my-agent
auggy doctor
auggy deploy
```

1. Choose or create the **Railway** workspace, project, and service.
2. Review the redacted environment-variable diff.
3. Confirm deployment; **Auggy** stages the agent without local-only files and syncs secrets.
4. **Auggy** mounts persistent data at /app/data, assigns a domain, and deploys the service.
5. The command verifies /health and records the deployment in .auggy-cloud.json.

## Verify the production path

**Health, route, and logs**

```bash
curl "https://<agent-domain>/health"
curl "https://<agent-domain>/services?need=gift&maxBudgetUsd=200"
auggy logs
```

1. Confirm /health returns a successful response.
2. Confirm the deployed /services route returns the same result as local development.
3. Open the deployed `/console/integrations` with creator credentials and inspect route and auth state.
4. Set NEXT_PUBLIC_AUGGY_BASE_URL in the application deployment to the agent domain and redeploy the application.
5. Run the service search from the production application.

## Persistent state

**Railway** mounts a volume at /app/data. Startup verifies that exact advertised mount and proves atomic write/fsync/rename durability before stateful augments boot. Core SQLite paths resolve directly onto the volume; they do not depend on root-level symlinks.

| Path | Augment |
| --- | --- |
| /app/data/memory.db | layeredMemory |
| /app/data/budgets.db | budgets |
| /app/data/visitor-auth.db | visitorAuth |
| /app/data/link.db | link |
| /app/data/agent-mail/<augment-name>/agent-mail.db | AgentMail, isolated per augment instance |

> **Warning: Fail closed on ephemeral storage**
>
> **Railway** startup refuses a missing, differently mounted, or symlinked runtime root. Do not add /app/*.db compatibility symlinks for new state; only Link retains its legacy symlink.

> **Note: The tutorial catalog is stateless**
>
> The catalog example does not require a volume. Persistent storage matters when you add memory, visitor authentication, budgets, or other SQLite-backed augments.

## Related

- [Connect an application](https://auggy.dev/docs/connect-application/markdown)
- [Logs and recovery](https://auggy.dev/docs/logs-and-recovery/markdown)
- [Console](https://auggy.dev/docs/console/markdown)