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

# Deploy on DigitalOcean

> An App Platform worker that runs the agent on your own DigitalOcean account.

The Observer Agent runs on your own DigitalOcean account as a small
always-on App Platform worker. It makes outbound HTTPS calls to
Observer and listens on no public port. Your platform's pricing
applies.

[![Deploy to DigitalOcean](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/useobserver/agent/tree/main)

## Before you start

Create the agent in Observer: **Agents**, **Add agent**, then **Cloud
platforms**. Copy the key. Observer shows it once. You paste it when
DigitalOcean asks for `AGENT_KEY`.

> [!WARNING]
>
> **No persistent volume**
>
> App Platform has no persistent volumes. The agent keeps its
> [local queue](https://docs.use.observer/agent/concepts/local-queue.md) in `/tmp`, so readings
> that are still queued when the app redeploys are lost. Readings
> collected while the agent runs are not affected.

## Deploy with the button

**1. Open the template**

Choose **Deploy to DigitalOcean** above and sign in. DigitalOcean reads
`.do/deploy.template.yaml` from the agent repository: one worker,
`agent`, on an `apps-s-1vcpu-0.5gb` instance.

**2. Set the key**

Paste your agent key into `AGENT_KEY`. Leave `CLOUD_SERVER_URL` and
`BUFFER_PATH` as they are.

**3. Create the app**

Create the app. It deploys in a few minutes.

## Deploy with doctl

If the button does not offer the worker, create the app from the same
spec with
[doctl](https://docs.digitalocean.com/reference/doctl/how-to/install/):

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/useobserver/agent/main/.do/deploy.template.yaml \
  | sed -e '/^spec:$/d' -e 's/^  //' > observer-agent.yaml
doctl apps create --spec observer-agent.yaml
```

Then open the app, set `AGENT_KEY` on the `agent` worker under
**Settings**, **Environment variables**, and save. The app redeploys
with the key.

## Settings

To change the key, for example after a
[key rotation](https://docs.use.observer/agent/guides/rotate-agent-key.md), edit `AGENT_KEY` on the
`agent` worker's environment variables. Add other
[environment variables](https://docs.use.observer/agent/reference/environment-variables.md), such
as `PROMETHEUS_SERVER_URL`, in the same place.

## Check that it connected

The Add agent screen shows **Connected** within a minute of the agent
starting, and the Agents page marks the agent as **running**. If it
does not, open the app's **Runtime Logs**, or run
`doctl apps logs <app-id> agent --type run`. The agent logs every
failed call to Observer with the reason. The most common cause is a
wrong or replaced `AGENT_KEY`.

## Upgrades

The template runs `ghcr.io/useobserver/agent:1`, which moves to each
new 1.x release. Redeploy the app to pick up a new release.

## Remove

Destroy the app from its **Settings** page, or run
`doctl apps delete <app-id>`. Delete the agent in Observer
(**Agents**) too if you no longer need it.


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