# Administer Vectory

Run your Vectory server: manage people and sign-in security, back up and restore, upgrade, and keep an eye on the instance. To install a server, see [Install the server](/help/install-server/).

## Create workspace accounts

Open **Settings → People & security** and choose **Add person**.

- **Invite link** (recommended): Vectory creates a single-use link that expires after 24 hours. Send it through a channel you trust. The person chooses their own password and is offered two-factor sign-in.
- **Set a password now:** choose a password of 12 characters or more and share it privately. Vectory doesn't send email.

Before adding anyone, confirm with your own administrator password. If you set the new person's password now and the request is refused, enter both passwords again; Vectory does not keep them for a retry.

Pick the role the person's work needs:

| Role | Can do |
| --- | --- |
| **Viewer** | View devices, pipelines, deployments and activity; export the audit log. |
| **Editor** | Viewer access, plus create, edit, check and organize pipeline drafts. Cannot publish or deploy. |
| **Operator** | Viewer access, plus publish and deploy, and manage schedules, groups, agent settings, enrollment tokens and device access. Review, start, pause and cancel [agent update](/help/agent-updates/) rollouts, and stop all updates. Cannot edit drafts. |
| **Administrator** | Everything, including managing people and recovering device identities. Turn agent updates on, hold or change the release key, and prepare and sign releases. |

Editor and Operator are separate jobs, not levels. Someone who both builds and ships pipelines needs Administrator.

## Change access or offboard a person

In **People & security**, find the person and choose **Edit**. You can change their name, role or whether they can sign in. The dialog lists what saving will do. Confirm with your own password and choose **Save changes**.

- Changing someone's role or turning off their access signs them out everywhere and cancels their unused reset links. Changing only their name doesn't.
- Their pipelines, deployments and history stay.
- At least one active administrator must remain. Promote someone else first.
- Changing your own role signs you out.

Offboarding someone from Vectory doesn't revoke credentials they hold elsewhere, such as device access or secrets on hosts. Review those separately.

## Change your password or close other sessions

In **People & security**, under your account:

- **Change password** keeps this browser signed in and signs out every other session. It also cancels unused reset links you created for others.
- **Sign out other sessions** keeps this browser signed in and ends the rest, without changing your password.

The sessions list shows where you're signed in. Sign out any session you don't recognize, then change your password.

## Help someone reset a forgotten password

1. In **People & security**, open the person's actions and choose **Reset password**. Confirm with your own password and choose **Create reset link**.
2. Send the link privately. It works once, for 15 minutes, and replaces any earlier link.
3. The person opens it, chooses a new password and signs in. Two-factor sign-in stays on.

A reset link changes only the password. Disabled accounts can't use reset links. If no administrator can sign in at all, use [`vectory-admin reset-password`](/help/vectory-admin/#reset-password) on the stopped server.

## Set up an authenticator

1. In **People & security**, find **Two-factor authentication** under your account and choose **Set up**. Confirm your password and choose **Continue**.
2. Scan the QR code with your authenticator app. On a phone, choose **Open authenticator app**; to type it instead, use the setup key shown below the code, which **Copy key** copies. The QR code is generated in your browser, without any outside service.
3. Enter the app's current 6-digit code and choose **Turn on two-factor**. The QR code expires after 10 minutes; the dialog counts them down.
4. Save the eight single-use recovery codes somewhere safe, outside Vectory, with **Copy**, **Download** or **Print**, then choose **I've saved these codes**. They can't be shown again. Each shows in groups of four characters so you can type it from paper; the spaces are optional.

From then on, sign-in asks for your password, then a code from the app. If you don't have the app, choose **Use a recovery code**. After a recovery-code sign-in, Vectory says how many codes are left, for example "You used a recovery code; 7 left", and suggests generating new ones under **People & security** when two or fewer remain. **New recovery codes**, next to **Two-factor authentication**, does that.

> [!IMPORTANT]
> **Keep recovery codes somewhere else**
> If you lose both your authenticator and your recovery codes, another administrator must reset two-factor sign-in for you. Keep the server's and your phone's clocks accurate.

To replace a lost authenticator, sign in with a recovery code, then choose **Turn off** next to **Two-factor authentication**. The dialog asks for your password and a code: with no app, choose **Use a recovery code instead** and give another unused recovery code. Choose **Turn off two-factor**, then set up the new authenticator. Turning two-factor sign-in on or off signs out your other sessions.

An administrator can choose **Reset two-factor** for a person who lost both, confirmed with the administrator's password. If no administrator can sign in, use [`vectory-admin disable-mfa`](/help/vectory-admin/#disable-mfa) on the stopped server.

## Back up the complete state

The data volume holds the database and the server's keys, and they only work together. Back them up together with the supplied tool, which uses SQLite's backup API and checks integrity. Copying a running database file can miss recent changes.

With Compose, from your server kit folder (or `deploy` for a contributor source build):

```sh
docker compose exec server python3 /app/operations/backup.py backup \
  --state /var/lib/vectory --out /var/lib/vectory/backup-2026-09-29
docker compose cp server:/var/lib/vectory/backup-2026-09-29 /srv/backups/
```

Use a new folder name for each backup.

- Keep backups encrypted and access-restricted, off the server: they contain the server's private keys. With [agent updates](/help/agent-updates/) on and **This server signs** chosen, that includes the release key: whoever holds the backup can approve builds that hosts install as root. A key kept offline is never in a backup.
- Back up `.env`, the retained secrets volume and any agent download mirror separately. With the server kit, `vectory_secrets` holds the agent listener's certificate, private issuer and setup secret. Automatic HTTPS also retains public certificate state in `vectory_caddy_data`; keep that volume too. Use your own project prefix if you changed it. These are separate from the complete database and server-identity backup.
- Avoid rotating signing keys or upgrading while a backup runs. For the strongest guarantee, stop the server first.
- The backup's manifest lists file hashes. It detects damage; it isn't a signature.

## Restore a backup

Restore into a new, empty folder while the server is stopped, and keep the current state untouched:

```sh
image=$(sed -n 's/^VECTORY_SERVER_IMAGE=//p' .env)
sudo install -d -m 0700 -o 10001 -g 10001 /srv/vectory-restore
docker run --rm --network none --user 10001:10001 --read-only \
  --cap-drop ALL --security-opt no-new-privileges:true \
  --mount type=bind,src=/srv/backups/backup-2026-09-29,dst=/backup,readonly \
  --mount type=bind,src=/srv/vectory-restore,dst=/restore \
  --entrypoint python3 "$image" /app/operations/backup.py restore \
  --from /backup --out /restore/state
```

Run from the verified kit directory. The backup input must be readable by UID/GID 10001 with private permissions; decrypt or copy it into such a directory first if your backup system uses another owner. The output is `/srv/vectory-restore/state`, which must not already exist. The tool runs inside the prebuilt image, so no Python installation or source checkout is needed on your host. It checks the manifest, hashes and database integrity and writes private restored files for the server identity, including `keys/` and `mfa-sealing.key`.

An old backup also restores old decisions: accounts that were disabled, old roles and passwords, revoked devices, used codes and tokens. For [agent updates](/help/agent-updates/) that means a release key you revoked since is back in use, releases you withdrew are ready again, rollouts that ended are running again and a stop you set since is gone. Before anyone reconnects:

1. Confirm an administrator can sign in to the restored state, with a working authenticator if they use one.
2. With the server stopped, end old sessions and revoke old codes and tokens: [`vectory-admin invalidate-restored-access`](/help/vectory-admin/#invalidate-restored-access), first without and then with `--apply`. With agent updates on, `--apply` also stops all updates, so nothing is offered to a host until step 5.
3. Start the server on an isolated network. Re-apply every access change made since the backup: offboarding, roles, passwords and device revocations.
4. If devices accepted newer configurations than the backup knows, [raise the generation counters](/help/vectory-admin/#recover-generations) before resuming rollouts.
5. If agent updates are on, review what the backup brought back: the release keys in **Settings → Agent updates**, the releases and the rollouts in **Devices → Agent updates**. Revoke a key you had revoked, withdraw a release you had withdrawn and cancel a rollout that shouldn't run. Then an administrator chooses **Clear the stop** in **Settings → Agent updates**, which resumes nothing. See [Stop all updates](/help/agent-updates/#stop-all-updates).
6. Reconnect people and devices, and confirm fresh check-ins.

> [!CAUTION]
> Never delete a device's state, lower its counters or re-enroll it to make it accept an older server. Devices refuse older configurations on purpose.

If you rotated or rolled over the release key after the backup was made, hosts can pin a newer key than the restored server knows. The review lists them as **This host doesn't pin the key that signed this release** until you run their **Upgrade agent** command with the key the restored server signs with. See [Agent updates](/help/agent-updates/#rotate-or-replace-the-release-key).

If the server's log says it holds a release key whose sealed private half can't be read or opened, the `keys/` folder doesn't match the database. Restore the `keys/` folder from a backup that holds both the sealed key and the sealing key. Until then no release can be signed, and the server deletes none of the sealed key files in that folder.

## Upgrade the server

1. [Back up](/help/administer/#back-up-the-complete-state) and test restoring the backup.
2. Note the current image digests and keep a copy of your server kit's `.env` and Compose configuration.
3. Try the new version against a copy of the restored state first. Confirm the database migrated, people can sign in and representative devices check in.
4. Verify and extract the new release's [server kit](/help/install-server/) into a new directory. Retain the existing `.env`, agent-download mirror, Docker project name and state/certificate volumes, then run the new kit's `./start.sh`. Preserve an offline installation's authenticated `.cache` too. The starter authenticates the new image references and preserves optional settings while selecting the correct automatic or custom certificate stack. Do not run a bare `docker compose up` for an automatic HTTPS kit: its default Compose file is the custom-certificate stack.

Server upgrades use signed prebuilt images; no source checkout or compilation is needed. Test your exact transition against restored state before changing an installation, and retain a complete backup for recovery.

The first start after an upgrade migrates the database before the server answers. Some upgrades build an index over stored telemetry, so that start can take a while when the telemetry table is large. Let it finish.

If a migration fails, nothing from it is kept: the database stays at the previous migration, and the server stops with a message that names the failed migration, its cause and where the database stands. Fix the cause and start again, or restore the pre-upgrade backup.

Migrations only move forward. An older server refuses a database that a newer one migrated, so going back to a previous version means restoring its backup: if an upgrade fails, stop and restore the pre-upgrade backup into a new volume with the previous image.

## Rotate the signing key

Devices check manifests with the server's signing key. To rotate it, back up, stop the server and run [`vectory-admin rotate-signing-key`](/help/vectory-admin/#rotate-signing-key). Devices move to the new key at their next certificate renewal.

## Rotate the device certificate authority

The server's device certificate authority (CA), `keys/device-ca.pem`, signs every device's certificate. It's valid for 10 years. Rotate it before it expires, or when your policy asks for a new one. Devices keep working throughout.

1. [Back up](/help/administer/#back-up-the-complete-state), then stop the server.
2. Run [`vectory-admin rotate-device-ca`](/help/vectory-admin/#rotate-device-ca). It prints the new and previous CA fingerprints and how many devices hold certificates from the previous CA.
3. Start the server. Certificates from either CA are accepted. New devices, and devices that renew, get certificates from the new CA.
4. Watch **Settings → General → Device certificates** until no device uses the previous CA. Devices renew in their certificate's last day, so this takes up to 30 days; a device that renewed keeps its old certificate as a fallback for another 24 hours. To stop waiting for a device that won't come back, revoke it on its device page.
5. Stop the server and run [`vectory-admin retire-device-ca`](/help/vectory-admin/#retire-device-ca). It checks, and names any device still on the previous CA. When it says **Ready**, run it again with `--apply`, then start the server.

After retirement the server refuses certificates from the previous CA. A device that missed the move needs [identity recovery](/help/agents/#recover-a-device-identity).

The CA key alone can't impersonate a device: every request also needs a certificate the server issued and still has on record. If you suspect the CA key leaked, rotate, then revoke any device you don't recognize.

## Monitor the instance

- **Disk:** watch free space and the database's growth.
- **Database load:** with `RUST_LOG=vectory_server=info,vectory_server::sqlite=debug`, the server logs once a minute how busy its single database writer was (`busy_percent`) and how long writes waited. A share that stays high means check-ins are queuing for the writer. See [Server settings](/help/server-config/#server-settings).
- **Backups:** track the age of your last good backup.
- **Logs:** `docker compose logs --tail 100 server proxy validator`.
- **Metrics history** is kept for [`VECTORY_TELEMETRY_RETENTION_DAYS`](/help/server-config/#server-settings) (7 days by default, up to 30).
- **The audit log** is never pruned, and each event takes about 0.8 KB. A busy fleet of 1,000 devices that takes five deployments a day adds about 8 MB a day (an estimate: [Audit log storage](/help/telemetry/#audit-log-storage) has the rules and a table). A device can add at most 4 events a minute of each kind about itself, besides the start and the result of each version it is sent, so a device that misbehaves can't grow it at will. To keep a copy elsewhere before you archive the database, [export the events](/help/administer/#review-and-export-audit-events) as JSONL, a date range at a time. Vectory has no command that deletes events.
- **Device check results** (**Check on devices**) are kept for 24 hours. A check's candidate configuration is removed when the device answers, when a newer check for that device replaces it, when the device is revoked, and within a minute after the check expires ten minutes after it was requested.
- **Connections:** `VECTORY_MAX_AGENT_CONNECTIONS` (16,384 by default) limits concurrent agent connections. It protects the server; it isn't a supported fleet size.

A load test on 2026-09-30 ran a release build on a shared Linux virtual machine with 4 vCPUs and 16 GB of RAM, with 10,000 simulated devices, an all-at-once rollout to all of them and 5 enrollments a second. Unassigned devices checking in every minute (about 170 check-ins a second) kept the database writer half busy, with a typical 99th-percentile latency of 34 ms. Once every device had an assignment, the writer saturated at 140 to 160 check-ins a second: latency rose to seconds, the rest were refused and retried, and after 14 minutes 9,035 of the 10,000 devices had reported the rollout applied. The simulated devices ran no Vector, so there is no supported fleet size yet: test with your own fleet before relying on large numbers, and watch the database load line above.

## Review and export audit events

**Activity → Audit log** records who changed what, and when: pipelines, deployments, devices, settings and access. Every role can read and export it.

- Search, then filter the **Event**, **Result** and **Time** columns. Dates cover whole days in UTC.
- Select an event for its details, including the reason and request ID when recorded. **Event link** copies a link to it.
- Names show each person's and resource's current name; the recorded ID is what the event refers to. An issue reads as its title on its device, and a device recovery as completed by the token that authorized it.
- A run of device results from a rollout shares one row. For one device the row reads its last state, such as **edge-nyc-02 · rolled back**, and counts its steps (**12 results**); for several devices it reads, for example, **4 results for 2 devices**, with each device's last state counted. Select the row to read every step in order.
- [Agent updates](/help/agent-updates/) record who turned them on or off, stopped them, rotated, rolled over or revoked a key, prepared, signed or withdrew a release, and started, paused, resumed or cancelled a rollout. Filter the **Event** column by **Agent updates**, **Release keys**, **Agent releases** or **Agent update rollouts**. Each device's result (updated, rolled back, failed or refused) is **Device agent update**, at most four rows a minute per device. Details hold versions, counters, digests, fingerprints and codes, never key material.

To export:

1. Choose **Export results** and check **Included events**.
2. Choose **Prepare export**. Vectory takes a consistent snapshot; later events aren't included.
3. When **File ready** appears, check the event count and size, then choose **Download JSONL**.

The file has one JSON object per line: snapshot details, the events and a completion record. **File verification** shows the file's SHA-256, so you can check you have all of it. An export holds up to 100,000 events or 128 MiB and must finish within two minutes; narrow the dates if you hit a limit. Prepared files expire after 10 minutes and download only in the session that created them.

Dashboard views named in this guide are available in your own installed Vectory server. The public documentation does not host those views.
