# Install the relay

> A single command installs Pulse Relay on Ubuntu or Debian. You then create the first account and connect your apps, and you can add a domain.

- Section: Teams
- Availability: Free license for everyone. Ubuntu or Debian server, amd64 or arm64.
- URL: https://pulse-app.si/en/docs/team/relay-install

## What you need

- An Ubuntu or Debian server, amd64 or arm64, with root access.
- Port 11118 free. It’s the relay’s HTTPS port.
- Port 80 only if you enable a domain later.

The script installs Docker if it’s missing and opens the ports in ufw if it’s active. The script answers in English; the relay’s interface is in French.

## Run the install

**On the server**

```bash
curl -fsSL https://get.pulse-app.si/relay | sudo sh
```

At the end, the script prints the address (`Adresse`), the certificate’s fingerprint (`Empreinte`) and a first sign-in code, valid for 30 minutes. Keep this output handy for the next step.

**Sample output**

```text
Pulse Relay is ready.
  Address:     https://203.0.113.10:11118
  Fingerprint: 3F:9A:0C:41:D2:E8:B7:A6:5C:11:7E:02:9B:44:C8:D1:…
  First sign-in code, valid for 30 minutes: 482-913
```

## Create the first account

1. Open the address in a browser. It warns that the certificate is self-signed. Compare its fingerprint with the script’s, then continue.
2. On **Bienvenue sur ton relais** (Welcome to your relay), enter the **Code de première connexion** (First sign-in code).
3. Fill in **Ton nom** (Your name), **E-mail** and **Mot de passe** (Password), at least 12 characters. This account becomes the relay’s owner.

After 5 wrong codes or once the 30 minutes are up, request a new one on the server.

**New code**

```bash
docker exec pulse-relay setup-code
```

## Connect an app

1. On the relay’s **Apps** page, choose **Ajouter une app** (Add an app), then enter the name, environment, and server.
2. Copy the key, which is only shown once.
3. In the project, run the command with the relay’s address and fingerprint.

**In the project**

```bash
npx @pulse-si/init pk_live_… --endpoint https://203.0.113.10:11118 --fingerprint 3F:9A:0C:…
```

The command writes `PULSE_KEY`, `PULSE_ENDPOINT` and `PULSE_RELAY_FINGERPRINT` to `.env`: see [npx @pulse-si/init](https://pulse-app.si/en/docs/packages/init).

To monitor the server itself, choose **Brancher Pulse Agent** (Connect Pulse Agent) on its row and use the `pk_agent_…` key: see [Pulse Agent](https://pulse-app.si/en/docs/servers/agent). To follow the relay from the app, see [Link a relay](https://pulse-app.si/en/docs/team/relay#link-a-relay).

## Add a domain

1. Create an A record pointing to the server’s IP address, for example `relay.helio.app`.
2. On the relay, open **Réglages › Domaine** (Settings, Domain), enter the name, then **Vérifier et activer** (Verify and enable).
3. Let’s Encrypt issues the certificate through port 80. The address becomes `https://relay.helio.app:11118`.

Apps already connected through the IP address keep working.

## Install variables

| Variable | Purpose |
| --- | --- |
| `PULSE_RELAY_HOST` | Public address, to set behind NAT or if the script only finds a private address |
| `PULSE_RELAY_TAG` | Image version to install |
| `PULSE_RELAY_DIR` | Install folder, `/opt/pulse-relay` by default |
| `PULSE_RELAY_DATA` | Data folder, `/var/lib/pulse-relay` by default |

## Where the files are

| Folder | Contents |
| --- | --- |
| `/opt/pulse-relay/` | `docker-compose.yml`, `.env`, `updater.sh` |
| `/var/lib/pulse-relay/` | `relay.db`, `identity.json`, `tls/`, `backups/`, `updates/` |

## Uninstall

**On the server**

```bash
curl -fsSL https://get.pulse-app.si/relay | sudo sh -s -- --uninstall
```

The data stays in place. Add `--purge` to erase it too. This can’t be undone.

## If the install stops

| Script message | What to do |
| --- | --- |
| **le port 11118 est déjà pris sur ce serveur.** (port already in use) | Stop the service using it, then run the script again. |
| **Pulse Relay s'installe sur Ubuntu ou Debian** (wrong system) | Use one of these two systems. |
| **Docker Compose est absent : installe le paquet docker-compose-plugin.** (Compose is missing) | Install this package, then run the script again. |
| **le relais ne répond pas. Regarde : docker logs pulse-relay** (relay not responding) | Read the container’s logs with this command. |
| The script reports a private address | Run it again with `PULSE_RELAY_HOST` and the public address. If port 80 is taken, the relay still starts, without a domain. |

- [Pulse Relay](https://pulse-app.si/en/docs/team/relay): Licenses, alerts, following from the app.
- [Updates and backups](https://pulse-app.si/en/docs/team/relay-ops): Versions, copies, disk space.
- [npx @pulse-si/init](https://pulse-app.si/en/docs/packages/init): Every option of the command.
