# Pulse Agent

> Pulse Agent is a 9 MB probe, shipped as a Docker image, for servers Pulse can’t read through an API. It calls out to Pulse, so you don’t open any ports.

- Section: Servers and providers
- Availability: From the Free plan, with a report every 5 minutes; every minute on Pro and Team. Install it from iPhone, iPad, Mac and Android.
- URL: https://pulse-app.si/en/docs/servers/agent

Add it as another service in your `docker-compose.yml` and Pulse gets the machine’s resources and the state of its containers. Use it for a server in an office, a NAS, a machine at an unsupported host, or a connected host that needs more metrics.

Diagram: No arrow enters your server.

## Install

### iPhone and iPad

1. Open the server. Until Pulse Agent has reported, the **Containers** section offers **Install Pulse Agent**, as does **Server Settings**.
2. Tap **Install Pulse Agent**. If the server isn’t in Pulse yet, open **Settings › Connected Providers › Other Server**, give it a name, then tap **Add and Install Pulse Agent**.
3. Copy the snippet now, because the `pk_agent_…` key is shown only once.
4. Add these services to the server’s `docker-compose.yml`, then run the command.

![The vps-paris-01 server page on the unfolded iPhone Duo and, in front, on the folded Duo: its three apps, then the Containers section with the Install Pulse Agent row.](https://pulse-app.si/media/en/ecrans/serveur-agent-ouvert.webp)

Until a first report arrives, the Containers section offers the install.

![The Install Pulse Agent screen on the unfolded iPhone Duo and on the folded Duo: the server and Pulse joined by a line, the docker-compose.yml snippet, then Waiting for First Report.](https://pulse-app.si/media/en/ecrans/agent-installation-ouvert.webp)

The snippet is ready to paste, key included (masked in this screenshot). The screen waits for the first report.

### Mac

1. Open the server. Until Pulse Agent has reported, the **Containers** card offers **Install Pulse Agent…**, as does **Settings…** in the server’s menu.
2. Click **Install Pulse Agent…**. If the server isn’t in Pulse yet, open **Settings › Providers**, click **+**, choose **Other Server**, give it a name, then click **Add and Install Pulse Agent**.
3. Copy the snippet now, because the `pk_agent_…` key is shown only once.
4. Add these services to the server’s `docker-compose.yml`, then run the command.

### Android

1. Open the server. Until Pulse Agent has reported, the **Containers** section offers **Install Pulse Agent**, as does **Server Settings**.
2. Tap **Install Pulse Agent**. If the server isn’t in Pulse yet, open **Settings › Connected Providers › Other Server**, give it a name, then tap **Add and Install Pulse Agent**.
3. Copy the snippet now, because the `pk_agent_…` key is shown only once.
4. Add these services to the server’s `docker-compose.yml`, then run the command.

**docker-compose.yml**

```yaml
services:
  pulse-agent:
    image: ghcr.io/charles-bally/pulse-agent:latest
    restart: unless-stopped
    read_only: true
    security_opt: ['no-new-privileges:true']
    cap_drop: [ALL]
    environment:
      PULSE_KEY: pk_agent_…
      PULSE_ENDPOINT: https://api.pulse-app.si
      DOCKER_HOST: tcp://pulse-socket-proxy:2375
    volumes:
      - /proc:/host/proc:ro
      - /:/host/root:ro
    depends_on: [pulse-socket-proxy]
    networks: [pulse-socket, pulse-egress]

  pulse-socket-proxy:
    image: tecnativa/docker-socket-proxy:v0.5.0
    restart: unless-stopped
    environment:
      CONTAINERS: 1
      POST: 0
      DISABLE_IPV6: 1
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks: [pulse-socket]

networks:
  pulse-socket:
    internal: true
  pulse-egress:
```

**zsh**

```bash
docker compose up -d
```

The first report goes out a few seconds after startup and the app moves to **Pulse Agent Is Connected**. **Later** closes the screen, and the server stays in the list.

- To keep the key out of the file, put `PULSE_KEY=pk_agent_…` in the Compose `.env` and write `PULSE_KEY: ${PULSE_KEY}` in the snippet.
- If the machine has no Docker, remove the proxy and `DOCKER_HOST`. The agent then sends resources only.
- On Docker Desktop, the host’s root isn’t mounted, so set the machine’s name with `PULSE_HOSTNAME`.
- Pulse doesn’t read the Kubernetes API. Monitor your services by their public or ingress address, and each node through its provider or with Pulse Agent, which then sends the machine’s resources.

> **Keep the proxy on its own network**
>
> `pulse-socket` is an internal network that only the probe joins. On the Compose default network, any app on the server could query the proxy and read container configuration, environment variables included.

## What the agent reads

| Source | What the agent takes from it |
| --- | --- |
| `/host/proc` | Kernel, uptime, load, CPU, memory, network rate (Docker interfaces excluded) |
| `/host/root` | Machine name (`/etc/hostname`), operating system (`/etc/os-release`), space used on the `PULSE_DISKS` disks |
| socket-proxy | Container name, image, state, health and exit code, plus Compose project and service |
| Never read | Processes, environment variables, your apps’ files, container logs |

Volumes are mounted read-only, the container is `read_only` and runs with no privileges (user 65534), in a `scratch` image with no shell or packages. The proxy allows only the container list. The connection always starts from the agent, over HTTPS.

By default, the agent only reads. It can also [restart a container](https://pulse-app.si/en/docs/servers/agent-restart) if you allow it on the server.

## The key

`pk_agent_…` only lets the agent send this server’s metrics and, if you turned it on, pick up its restart commands. Pulse keeps only its fingerprint, so a lost key can’t be recovered. It never appears in the agent’s logs.

- **Recreate Key**: the old one stops working right away. Put the new one on the server.
- **Revoke Key**: the agent can no longer send metrics for this server.

## When Pulse warns you

| What happens | Alert |
| --- | --- |
| CPU or memory at 90% and above for 5 minutes, disk at 90% and above | Server resources ([details](https://pulse-app.si/en/docs/servers/resources)) |
| Container unhealthy, restarting in a loop, dead, or exited with a code other than 0 | “Container down”, with its name |
| No report for 3 times your plan’s frequency | Server down (only with no connected host) |

A container that exited with code 0, like a finished migration, isn’t an outage. With Swarm, only the latest task of each service counts. If the server is connected to a host, that host’s API says whether it’s up.

## Choose what gets sent

| Variable | Default | Example |
| --- | --- | --- |
| `PULSE_CONTAINERS` | `true` | `false`: the agent doesn’t read Docker at all |
| `PULSE_CONTAINERS_INCLUDE` | (all) | `helio-*,caddy`: only these containers |
| `PULSE_CONTAINERS_EXCLUDE` | (none) | `*-migrate,backup`: these are ignored |
| `PULSE_NETWORK` | `true` | `false`: no network rate |
| `PULSE_DISKS` | `/` | `/,/data`: mount points to follow, the fullest one counts |

Names accept `*` and ignore case. With a [Pulse Relay](https://pulse-app.si/en/docs/team/relay), `PULSE_ENDPOINT` points to the relay; if it has no domain, `PULSE_RELAY_FINGERPRINT` gives its certificate fingerprint.

## If nothing arrives

**zsh**

```bash
docker compose logs pulse-agent
```

| Log | What to do |
| --- | --- |
| `PULSE_KEY is missing or malformed` | The variable isn’t reaching the container. Check the Compose `.env`. |
| `Pulse key refused` | The key was recreated or revoked. Paste the new one, then run `docker compose up -d`. Until then, the agent retries every 10 minutes. |
| `Docker unreachable` | The `pulse-socket-proxy` service isn’t running. Resources still go out, without the containers. |
| `Docker answered 403` | The proxy doesn’t have `CONTAINERS: 1`. |
| `PULSE_ENDPOINT must use https` | Only a local Pulse accepts `http`. |

Pulse stops accepting reports for a paused server or one over your plan’s limit. For anything else, see [No signal received](https://pulse-app.si/en/docs/help/no-signal).

- [Restart a container](https://pulse-app.si/en/docs/servers/agent-restart): An option you turn on at the server.
- [Resources](https://pulse-app.si/en/docs/servers/resources): What happens to the metrics.
