Canonical: https://zela-web.nexusrun.app/docs/deployment-files/
Source: https://github.com/nexusrun/zela/blob/main/deploy/README.md

Find systemd and HAProxy templates for your installation.

# Deployment files

[All guides](https://zela-web.nexusrun.app/docs/) · [Installation instructions](https://zela-web.nexusrun.app/docs/installation/)

This folder contains examples for the person installing Zela as a Linux service or setting up backup managers. The files are templates: addresses, certificates, users, and secrets must match your installation.

**First time?** Use [Getting started](https://zela-web.nexusrun.app/docs/getting-started/) for a local dashboard or Compose setup. For production service setup, follow [Installation](https://zela-web.nexusrun.app/docs/installation/) in order instead of copying a unit file alone.

## Choose the right example

| File                                       | Where it is used                   | What it does                                                                                         |
| ------------------------------------------ | ---------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [zela-server.service](https://github.com/nexusrun/zela/blob/main/deploy/zela-server.service) | Manager running Linux with systemd | Starts Zela with HTTPS, `/var/lib/zela` state, and worker binaries in `/opt/zela/workers`            |
| [worker.service](https://github.com/nexusrun/zela/blob/main/deploy/worker.service)           | Manually installed Linux worker    | Starts a TLS worker agent. Automatic SSH provisioning installs its own `zela-worker.service` instead |
| [zela-server-ha.conf](https://github.com/nexusrun/zela/blob/main/deploy/zela-server-ha.conf) | Manager service override           | Adds active/standby manager options; requires shared PostgreSQL and credentials                      |
| [haproxy-ha.cfg](https://github.com/nexusrun/zela/blob/main/deploy/haproxy-ha.cfg)           | HAProxy load balancer              | Sends traffic to a manager that passes `/api/ready`                                                  |
| [HA.md](https://zela-web.nexusrun.app/docs/high-availability/)                             | Installation guide                 | Explains backup managers, common configuration, and takeover testing                                 |

## Install in this order

1. [Check prerequisites and build the binaries](https://zela-web.nexusrun.app/docs/installation/#1-prerequisites).
2. [Prepare storage and the manager service](https://zela-web.nexusrun.app/docs/installation/#3-prepare-postgresql), including certificates and a protected environment file.
3. Start the manager, then confirm that secure sign-in works.
4. [Connect workers](https://zela-web.nexusrun.app/docs/console-guide/#connect-your-first-worker) and deploy a test application.
5. If needed, follow [High availability](https://zela-web.nexusrun.app/docs/high-availability/) after the single-manager setup works.

## Before restarting a service

- Wait for cluster operations to finish and back up configuration before an upgrade.
- Keep the original administrator token and vault key; do not generate new keys as a routine restart step.
- Check that the service user can read its certificate/key and write its data directory.
- On SELinux systems, restore the installed files' contexts as described in the installation guide.

Use [Operations](https://zela-web.nexusrun.app/docs/operations/) for backups, upgrades, status checks, and troubleshooting. Use the [configuration reference](https://zela-web.nexusrun.app/docs/configuration/) to look up a flag or environment variable.
