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

# Installing OMNI on your own server

> How to install a FireFlo OMNI release on a Linux server you run, put its two domains behind TLS, choose its modules, and upgrade it.

An OMNI release is one file per processor type. It carries the API, the panel and every
channel, battery and plugin, with its own Python and Node.js, so the server needs no build
tools and downloads nothing while it installs. You choose which modules the server runs at
install time, and change that later on the server.

Releases are delivered by FireFlo under your licence. Ask
[support@fireflo.au](mailto:support@fireflo.au) for the current release and its files.

## Before you begin

| | Requirement |
| - | - |
| **Processor** | Linux on x86-64, or aarch64 (ARM, such as AWS Graviton). There is one release file for each |
| **Operating system** | Ubuntu 22.04, 24.04 or 26.04, or Debian 12 or 13, with systemd and root access |
| **PostgreSQL** | 14 or newer, with the `pg_trgm` extension, and `pgvector` when AI Agents or Calendar is loaded |
| **Redis** | 6 or newer, or Valkey |
| **Domains** | two names pointing at the server: one for the API and one for the panel. They can't share a name |
| **In front** | a reverse proxy with TLS, such as nginx, Apache or Caddy, which you set up |

The release files are:

* the release itself, `fireflo-omni-<version>-single-amd64.tar.gz` or `…-arm64.tar.gz`;
* `SHA256SUMS` and `SHA256SUMS.asc`, its checksum and FireFlo's signature over it;
* `SIGNING-KEY.asc`, FireFlo's public signing key;
* `setup.sh`, which installs the services OMNI needs on a fresh server.

## Install

**1. Copy the files to the server**

```bash theme={null}
scp fireflo-omni-<version>-single-amd64.tar.gz SHA256SUMS SHA256SUMS.asc SIGNING-KEY.asc setup.sh root@your-server:/root/
```

**2. Verify them**

The checksum proves the download is intact; the signature proves it came from FireFlo.

```bash theme={null}
gpg --import SIGNING-KEY.asc
gpg --verify SHA256SUMS.asc SHA256SUMS
sha256sum -c SHA256SUMS
```

Check the key's fingerprint rather than trusting the file beside the release:
`3A9B 256F DE50 75CA 5F76  ADAF 42D7 A01A ED0D 03BA`.

**3. Prepare the server**

`setup.sh` installs PostgreSQL with `pgvector` and `pg_trgm`, and Redis. It creates no
database, role or password. `--dry-run` shows what it would do.

```bash theme={null}
sudo ./setup.sh --dry-run
sudo ./setup.sh
```

**4. Unpack and install**

Type the two passwords at prompts and put them in an answers file only root can read,
so neither appears in the shell history or the process list:

```bash theme={null}
read -rsp 'Database password: ' DB_PW; echo; read -rsp 'Admin password: ' ADMIN_PW; echo
sudo install -m 600 /dev/null /root/omni-answers.env
printf 'DB_PASSWORD=%s\nADMIN_PASSWORD=%s\n' "$DB_PW" "$ADMIN_PW" | sudo tee /root/omni-answers.env >/dev/null
```

Then one command installs everything:

```bash theme={null}
tar xzf fireflo-omni-<version>-single-amd64.tar.gz && cd fireflo-omni-<version>-single-amd64
sudo ./install.sh --env-file /root/omni-answers.env --modules all \
  --api-domain api.example.com --panel-domain app.example.com \
  --db-name omni --db-user omni \
  --admin-email you@example.com --admin-name "Your name"
sudo rm /root/omni-answers.env
```

Name the modules instead of `all` to run only some, for example `--modules
        sms,whatsapp,crm`. A module that needs another brings it, and the installer says so.
A set that couldn't start is refused before anything is installed.

**5. Put a reverse proxy in front**

The installer writes no web-server configuration. The API and the panel listen only on
the server itself, and your reverse proxy forwards each domain to its port. The
installer prints the same list when it finishes.

| Domain | Forward to, on the server itself | Request bodies up to |
| - | - | - |
| the API's, over HTTPS | port 8200 | 215 MB, for audience uploads |
| the panel's, over HTTPS | port 3200 | 6 MB |

For both domains:

* serve HTTPS only. The panel's sign-in cookie is secure-only, so over plain HTTP
  nobody stays signed in;
* pass the `Host` header through unchanged;
* set `X-Forwarded-Proto: https`, `X-Forwarded-For` and `X-Real-IP`;
* use HTTP/1.1 to the backend with a read timeout of at least 65 seconds, and leave
  redirects as they are.

Webhooks from SMS gateways and Meta arrive on the API's domain, so it must be reachable
from the internet over HTTPS. See [An nginx configuration](#an-nginx-configuration)
for a complete example.

**6. Sign in**

Open the panel's domain and sign in as the admin address you gave. That login is
platform staff: it sees the **Platform** section, where you set up products, prices
and channel connections. See [Running OMNI for your customers](https://cpaas.fireflo.au/operators/overview.md).

Everyone signs in on the panel's domain. The API's domain has no sign-in or account
pages for customers or resellers (from 1.9.3).

### What the installer asks for

Anything you leave out is asked for, or read from an answers file given with
`--env-file` (the release carries an example with every key). A flag given on the command
line wins over the same key in the file.

| Flag | What | Default |
| - | - | - |
| `--modules` | the channels, batteries and plugins to run, or `all` | asked |
| `--api-domain`, `--panel-domain` | the two domains | asked |
| `--db-host`, `--db-port`, `--db-name`, `--db-user` | the database; its password is `DB_PASSWORD` in the answers file. Or one `--database-url` | this server, `5432`, `omni`, `omni` |
| `--redis-url` | Redis | the local one |
| `--admin-email`, `--admin-name` | the first staff login. Its password is `ADMIN_PASSWORD` in the answers file | none |
| `--prefix` | the folder OMNI is installed in | `/opt/fireflo` |
| `--user` | the Linux user the services run as, created if missing | `omni` |
| `--api-port`, `--panel-port` | the ports the API and the panel listen on, on the server itself | `8200`, `3200` |

**The database.** With PostgreSQL on the same server, the installer creates the role and
the database when they're missing, with both extensions. A role that already exists keeps
its password, so give the one it has. With PostgreSQL on another server, create the role,
the database and both extensions there first. `--no-create-db` skips the creating
altogether.

> [!WARNING]
>
> Back up `/opt/fireflo/shared/.env` (`<prefix>/shared/.env` with `--prefix`). Its secret
> key encrypts the provider credentials OMNI stores, such as SMS logins and WhatsApp
> tokens. Without it, those can't be read again, and a restored database won't send.

## Install under a hosting account

On a server where each site lives under its own Linux user, such as the account behind a
virtual host, OMNI can live inside that account and run as that user. Give the folder
with `--prefix` and the user with `--user`:

```bash theme={null}
sudo ./install.sh --prefix /srv/acme/omni --user acme \
  --env-file /root/omni-answers.env --modules all --yes
```

The user isn't created when it already exists, and its home is left as it is. OMNI's
services are system services that run as that user.

From release 1.5.2, an upgrade finds the folder and the user by itself: `sudo ./upgrade.sh`
is enough, and it says what it found under "Checking this server".

> [!WARNING]
>
> An install on 1.5.1 or earlier: upgrade with the same folder **and** the same user,
> `sudo ./upgrade.sh --prefix /srv/acme/omni --user acme`. Without `--user`, those
> releases run the services as the default `omni` user instead.

If the virtual host's web server is managed by a hosting control panel, that panel owns
its configuration files. Put the proxy settings below into the panel's custom
configuration for each domain rather than into your own file, which the panel may
overwrite.

## An nginx configuration

A complete configuration for both domains, with Let's Encrypt certificates. Replace
`api.example.com` and `app.example.com` with your two domains; both must already point at
the server.

**1. Get a certificate for both domains**

```bash theme={null}
sudo apt install -y nginx certbot python3-certbot-nginx
sudo certbot certonly --nginx -d api.example.com -d app.example.com
```

**2. Write the configuration**

Save it as `/etc/nginx/sites-available/omni.conf`:

```nginx theme={null}
map $http_upgrade $omni_connection_upgrade {
    default upgrade;
    ''      close;
}

# plain HTTP only sends people to HTTPS and lets certbot renew
server {
    listen 80;
    listen [::]:80;
    server_name api.example.com app.example.com;
    location /.well-known/acme-challenge/ { root /var/www/html; }
    location / { return 301 https://$host$request_uri; }
}

# the API
server {
    listen 443 ssl;
    listen [::]:443 ssl;
    http2 on;
    server_name api.example.com;

    ssl_certificate     /etc/letsencrypt/live/api.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/api.example.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    client_max_body_size 215m;

    location / {
        proxy_pass http://127.0.0.1:8200;
        proxy_http_version 1.1;
        proxy_set_header Host              $host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header Upgrade           $http_upgrade;
        proxy_set_header Connection        $omni_connection_upgrade;
        proxy_redirect off;
        proxy_read_timeout 120s;
        proxy_send_timeout 120s;
        proxy_request_buffering off;
    }
}

# the panel
server {
    listen 443 ssl;
    listen [::]:443 ssl;
    http2 on;
    server_name app.example.com;

    ssl_certificate     /etc/letsencrypt/live/api.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/api.example.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    client_max_body_size 6m;

    location / {
        proxy_pass http://127.0.0.1:3200;
        proxy_http_version 1.1;
        proxy_set_header Host              $host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header Upgrade           $http_upgrade;
        proxy_set_header Connection        $omni_connection_upgrade;
        proxy_redirect off;
        proxy_read_timeout 120s;
        proxy_buffering off;
    }
}
```

Certbot saves the one certificate for both names under the first one, so both blocks
point at `api.example.com`. Change the ports if you installed with `--api-port` or
`--panel-port`.

**3. Turn it on**

```bash theme={null}
sudo ln -s /etc/nginx/sites-available/omni.conf /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
```

**4. Check it from outside**

```bash theme={null}
curl -s -o /dev/null -w "API %{http_code}\n" https://api.example.com/api/health/
curl -s -o /dev/null -w "panel %{http_code}\n" https://app.example.com/login
```

Both should answer `200`.

> [!NOTE]
>
> `http2 on;` needs nginx 1.25.1 or newer. On an older nginx, remove that line and write
> `listen 443 ssl http2;` instead.

## Choose modules on the server

```bash theme={null}
sudo fireflo-omni modules list
sudo fireflo-omni modules enable tickets calendar
sudo fireflo-omni modules disable tickets
```

Enabling a module brings along what it needs, runs its database changes and switches it on.
Disabling switches it off and keeps its data. Either restarts the services for a few seconds.
**Platform → Modules** in the panel shows the same switches, and is where a module's data is
backed up and removed. See [Modules](https://cpaas.fireflo.au/operators/modules.md).

Loading a module gives it to no one yet: customers get it through their product, or one at
a time from their page under **Platform → Customers**.

## Upgrade to a new release

Copy the new release to the server, verify it as above, then:

```bash theme={null}
tar xzf fireflo-omni-<new-version>-single-amd64.tar.gz && cd fireflo-omni-<new-version>-single-amd64
sudo ./upgrade.sh
```

The server keeps its modules, ports, bind address and settings, and from 1.5.2 its folder
and the user its services run as (see
[Install under a hosting account](#install-under-a-hosting-account) for earlier releases).
The new release installs beside the running one,
applies its database changes, switches over and restarts in stages: the API, then the
panel, then the background workers, waiting for each to answer. **If one isn't healthy
within 180 seconds, it switches back** to the release that was running
(`--health-timeout` changes the wait). Database changes only ever add, so switching back is
safe. The last three releases are kept.

Take a database dump before an upgrade all the same:

```bash theme={null}
sudo -u postgres pg_dump -Fc omni > /root/omni-before-upgrade-$(date +%F).dump
```

`sudo fireflo-omni status` shows what runs, and `sudo fireflo-omni logs` its recent logs.

### Upgrading to 1.21.1 from 1.11.0

Release **1.21.1** goes straight on from any 1.11.x and works with any FireFlo gateway
1.11.0 works with. Run the upgrade as usual, at a quiet time, and **not around 20 past
the hour**: a table it changes waits behind the hourly recount. No setting has to be added.

* **Installed as root:** after the upgrade, run `sudo fireflo-omni status` once. It ends
  with one line for every service that should run and doesn't, and exits with an error
  when there is one.
* **`sudo fireflo-omni services`** makes the services match the settings: what they call
  for is written, enabled and running, and what they no longer call for is stopped and
  removed. Restarting, enabling or disabling a module and switching the queue engine run
  it too.
* **The API** runs 2 processes of 6 threads: 12 requests at a time. The upgrade rewrites
  the service files, so send slots raised by hand there must be raised again.
* **SMS callbacks are accepted only from the gateway**: from the addresses the account's
  gateway host name resolves to, or from this server. If the gateway reaches OMNI through
  NAT, a load balancer or from another address, set `SMS_CALLBACK_ALLOWED_IPS` to that
  address (comma-separated; `*` accepts any). The gateway retries meanwhile. Receipts over
  the gateway's gRPC stream are not affected.
* **New modules are off until you enable them**: Email, Social, Meta, Google Ads, Short
  links (`shorturl`), Queues (`kafka`, see [Queues](https://cpaas.fireflo.au/operators/queues.md)) and Lead finder
  (`leadfinder`), with `sudo fireflo-omni modules enable <name>`. Lead finder needs no
  platform key: each customer enters its own.
* **Short links needs a short domain**, saved on **Platform → Short links**, that has
  passed its check once: a DNS record pointing it at the API's server, a valid
  certificate for that exact name, the name in `DJANGO_ALLOWED_HOSTS`, and a
  reverse-proxy rule sending that host to the API (not the panel) with the Host header
  unchanged and the visitor's address passed on. The page shows the rule for nginx, Caddy
  or Apache, filled in. Customers also need "Short links" on their plan.
* **Files sent with messages**: the reverse proxy in front of the API must pass `/api/f/`
  through without any sign-in, and allow request bodies up to 100 MB (the 215 MB for
  audience uploads covers it). Uploads are refused until the API has a public HTTPS
  address.

Optional settings, set on the server:

| Setting | What it does |
| :- | :- |
| `OMNI_API_RATE` | Calls a minute per API key. 600 unless set. |
| `OMNI_API_ACCOUNT_RATE` | Calls a minute across all of an account's keys. 1,200 unless set. |
| `OMNI_API_MAX_KEYS` | API keys an account may have in use. 25 unless set. |
| `THROTTLE_EVENTS_IP` | Website tracking events a minute from one address. 300 unless set. |
| `FORMS_FIRST_MESSAGES_PER_FORM_DAY` | A public form's first messages a day. 500 unless set. |
| `FORMS_FIRST_MESSAGES_PER_ACCOUNT_DAY` | First messages from all of an account's forms a day. 2,000 unless set. |
| `BOOKING_CODES_PER_ACCOUNT_DAY` | Booking codes an account sends a day. 500 unless set. |
| `SENT_FILES_PUBLIC_URL` | The address files sent with messages are served from. The API's public address unless set. |
| `SHORTURL_API_UPSTREAM` | The API address shown in the short domain's reverse-proxy rule. Read from the install unless set. |
| `OMNI_DIAG_*` | What [Diagnostics](https://cpaas.fireflo.au/operators/diagnostics.md#optional-settings) keeps. |

Email also has optional settings for how long email events are kept (30 days) and the
largest arrived attachment kept (10 MB); Queues has its own, on [Queues](https://cpaas.fireflo.au/operators/queues.md#optional-settings).

Read before upgrading — what customers, staff and API clients notice:

* **A customer's or reseller's people page is called Users.** "Team" is the platform's
  own people, on **Platform → Users**.
* **With the Team module, each staff login has a level.** At the upgrade every superuser
  becomes Owner and every other staff login Admin. A password link or two-factor reset
  for a staff login then needs the Owner. See [Team](https://cpaas.fireflo.au/operators/team.md).
* **Send is one page for every channel**; each channel's old Send address lands there.
* **The Delivery report lists sent messages only**, and opens on the last 7 days. Replies
  stay in the Inbox.
* **The Routes API is removed**: `/v1/routes` answers 410. A message carries its own steps.
* **Test keys never send**, on any request that would reach people.
* **`/v1` follows a person's panel roles**, and nobody can make a key wider than their
  own roles.
* **API limits per account**: 1,200 calls a minute across all keys, and at most 25 keys.
* **SMS callbacks come only from the gateway** (see above).

### Upgrading to 1.11.0

Release **1.11.0** makes SMS, WhatsApp, RCS, the Inbox and resellers behave
alike, adds Jio Business Messaging as a second RCS provider, and adds gateway account
tags. It works with any FireFlo gateway 1.10.3 works with; **gateway account tags need
FireFlo gateway 0.17.0**, and on an older gateway the tag screens don't appear.

Run the upgrade as usual, at a quiet time. It creates one new table (RCS callbacks
received) and a few new fields, and turns the countries typed on RCS bots into country
codes; a country it can't match is kept and marked for staff. Nothing has to be set.
Existing RCS bot access stays as staff gave it, and every customer may still connect its
own WhatsApp or RCS until its reseller switches that off.

Two optional settings, set on the server:

| Setting | What it does |
| :- | :- |
| `RCS_CALLBACK_LOG_DAYS` | Days RCS callbacks received are kept. 7 unless set. |
| `RCS_MEDIA_MAX_BYTES` | The largest incoming RCS file kept. 100 MB unless set. |

Read before upgrading — what customers and API clients notice:

* **A suspended account, or one below a suspended reseller, sends nothing** on any
  channel. Single sends are refused; its broadcasts wait instead of failing.
* **An account awaiting approval is refused on WhatsApp and RCS too**, as it already was
  on SMS.
* **RCS needs RCS in the plan**, or switched on for the account by staff, on every path,
  the Inbox and the API included. An account that sent RCS without it is now refused.
* **SMS broadcasts pause instead of failing** when a reseller's customer runs out of
  units or the reseller out of credit, and carry on when units arrive. A refusal the
  gateway reports late, and sends over the gateway's gRPC stream, still fail.
* **A message type with no price is free below a reseller too**: no units are needed.
* **A reseller's own WhatsApp number is never held by the reseller's balance**: Meta bills
  the reseller, and OMNI takes no money for it.
* **Replies to a platform RCS bot that several customers share reach no customer.** They
  are recorded for staff under Callbacks received. A bot given to exactly one account
  works as before; unsubscribes are still applied.
* **A marketing WhatsApp template sent from the Inbox or Send WhatsApp honours a
  marketing STOP.** It was treated as transactional.
* **One STOP or START confirmation per person** on a shared WhatsApp number.
* **Refusal codes are the same on every channel.** A reseller's customer without units
  now gets `no_units` instead of `insufficient_balance`. API clients that match on the
  old code need the new one. See [Errors](https://cpaas.fireflo.au/developers/errors.md#why-a-send-was-refused).
* **An RCS suggested-reply tap is a reply** in the Inbox.
* **An SMS reply sent from the Inbox no longer appears in the broadcasts list.**
* **RCS routing reads a number's country from the country list used for prices.**
* **Moving a customer to another reseller** returns its unused units to the reseller
  that gave them and drops the old reseller's shared number and passed-on bots.

### Upgrading to 1.10.1

Install **1.10.1** rather than 1.10.0; from 1.9.7 or 1.10.0 it is the usual upgrade. The
1.10 releases create the tables for WhatsApp shared numbers and their unsubscribes, and
turn each connection's shared number into its default shared number.

* **Shared WhatsApp numbers become send-only.** A customer who sends from a shared
  number no longer gets replies in the Inbox. Customers who need replies connect their
  own number or get a hosted one. See
  [Shared WhatsApp numbers](https://cpaas.fireflo.au/operators/channel-connections.md#shared-whatsapp-numbers).
* Since 1.9.7, WhatsApp template headers, the file chosen on Send WhatsApp and profile
  pictures go from the browser straight to the API, at Meta's sizes (images up to 5 MB,
  video up to 16 MB, PDF up to 100 MB). As for contact imports, the panel must
  know the API's public address (`API_PUBLIC_URL`), and the web server in front of the
  API must accept bodies of that size.

Optional settings, set on the server:

| Setting | What it does |
| :- | :- |
| `WHATSAPP_WEBHOOK_LOG_DAYS` | Days WhatsApp webhooks received are kept. 7 unless set. |
| `WHATSAPP_MEDIA_MAX_BYTES` | The largest incoming WhatsApp file kept. 100 MB unless set. |

### Upgrading to 1.5.4

Release 1.5.4 brings price history, the [country directory](https://cpaas.fireflo.au/operators/countries.md), SMS
prices applied by staff, allowed countries and [units](https://cpaas.fireflo.au/using/units.md) for resellers'
customers. After `./upgrade.sh`, run its two setup commands once:

```bash theme={null}
sudo fireflo-omni manage countries_seed           # fills the country directory
sudo fireflo-omni manage pricing_record_opening   # records today's prices as opening prices
```

Both are safe to run again: the first adds only countries the directory lacks and never
changes one staff edited, and the second skips any price that already has history.

What changes for you after the upgrade:

* **Prices no longer reach the SMS gateway by themselves.** A saved or imported price,
  a change of price list and the nightly check all wait under **Waiting to apply** on
  **Platform → Pricing** until staff review and apply them. See
  [Pricing](https://cpaas.fireflo.au/operators/pricing.md#apply-sms-prices-to-the-gateway).
* **Resellers' customers send with units.** Resellers no longer set prices or a markup,
  and their customers no longer have message pockets or prices. A reseller's existing
  customers can't send until the reseller gives them units. See
  [Resellers](https://cpaas.fireflo.au/operators/resellers.md).
* **Import previews live in the shared cache.** A price import's preview is kept in
  OMNI's cache until it is confirmed. The installer's Redis cache serves this; if you run
  the API on more than one server, point them all at the same cache, or a confirm can
  land where the preview isn't.
* **An install whose message history was partitioned online:** run
  `sudo fireflo-omni manage partition_messages` once more. It removes leftover links from
  the old copy of the history that stopped contacts with old messages being deleted. On
  an install never partitioned, don't run it: there is nothing to fix, and it would start
  partitioning.

## ARM servers

The ARM release carries the panel ready to build rather than built, because the panel's
server packages are compiled for one processor type. `install.sh` builds it on the server
with the Node.js inside the release, which adds a few minutes to the install and to each
upgrade. Nothing else differs.

## Without root

`--user-mode --prefix ~/omni` installs under your own home and runs OMNI as your user's
services, with no root at all. It suits a trial or a staging server. The database must
already exist, because creating one needs PostgreSQL's administrator.

## Next

* Set up products, prices and the connections customers send through:
  [Products and plans](https://cpaas.fireflo.au/operators/products-and-plans.md), [Pricing](https://cpaas.fireflo.au/operators/pricing.md) and
  [Channel connections](https://cpaas.fireflo.au/operators/channel-connections.md).
* Give your panel your own domain and mail: [Domains and email](https://cpaas.fireflo.au/operators/domains-and-email.md).

Questions about a release or an install: [support@fireflo.au](mailto:support@fireflo.au).


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