# Install on one Linux server without Docker

Run HelixIAM in production on one Linux server with no Docker and no Kubernetes: the server as a systemd service, nginx
in front of it for HTTPS, and your own PostgreSQL, MySQL or MariaDB. The bundle is `helixiam-native.tar.gz`, in every
release on [download.helixiam.com](https://download.helixiam.com) (folder `v<version>/`).

!!! info "Requires a HelixIAM licence"
    Sign in to download.helixiam.com with the HelixIAM account you received from KubeDNA B.V. For a licence, contact
    [contact@helixiam.com](mailto:contact@helixiam.com).

**What runs:** the installer sets up and starts everything; you do not start the server or the console yourself.

| Part | How it runs | Where |
| --- | --- | --- |
| The server (sign-in, tokens, admin API) | systemd service `helixiam.service`, user `helixiam` | `127.0.0.1:8080`, health and metrics `127.0.0.1:8081` |
| The admin console | static files served by nginx | `127.0.0.1:8090` |
| HTTPS | nginx, one certificate for both host names | `https://<sign-in host>` and `https://<console host>` |
| Loopback firewall | `helixiam-firewall.service` (nftables): only root, `helixiam` and nginx reach the ports above | |

Other ways to install: [Kubernetes (Helm)](install.md#kubernetes-helm), [one Linux server with Docker](linux-server.md),
and the [standalone zip](quickstart.md) to evaluate on your own machine (H2, localhost only, not for production).

## Requirements

- A Linux server with systemd (tested on Ubuntu 24.04 LTS), and no untrusted local users on it.
- From the distribution: Java 25 or later, nginx and nftables. On Ubuntu 24.04:

    ```bash
    sudo apt install openjdk-25-jre-headless nginx nftables
    ```

- A database with an empty database for HelixIAM, on this server or another: PostgreSQL 14 or later, MySQL 8.0.19 or
  later, or MariaDB 11.4.7 or later. See [Database](database.md) for how to create it.
- Two host names whose DNS points at the server: one where users sign in (for example `id.example.com`) and one for the
  admin console (for example `admin.example.com`).
- One TLS certificate (full chain) and its key, valid for both names. Let's Encrypt works: see step 4.

## Install

1. **Download and check the bundle.** From download.helixiam.com, folder `v<version>/`, take
   `helixiam-native.tar.gz` and `helixiam-native.tar.gz.sigstore.json`, and verify it
   ([Verify the release files](linux-server.md#verify-the-release-files)):

    ```bash
    cosign verify-blob --bundle helixiam-native.tar.gz.sigstore.json \
      --certificate-identity https://github.com/melmarzgioui/helixiam/.github/workflows/release.yml@refs/tags/v<version> \
      --certificate-oidc-issuer https://token.actions.githubusercontent.com helixiam-native.tar.gz
    tar -xzf helixiam-native.tar.gz
    ```

2. **Add the JDBC driver of your database.** HelixIAM ships no driver. Put exactly one jar, the tested version, in
   `helixiam/drivers/`; the server checks its SHA-256 at start and refuses any other. The versions, checksums and
   download commands are on [The database driver](../operations/database-driver.md#6-linux-server-and-native-bundle),
   for example for PostgreSQL:

    ```bash
    curl -fLo helixiam/drivers/postgresql-<version>.jar \
      https://repo1.maven.org/maven2/org/postgresql/postgresql/<version>/postgresql-<version>.jar
    ```

3. **First run.** `sudo ./helixiam/install.sh` creates the system user `helixiam`, installs the server, the console
   and the scripts in `/opt/helixiam` (read-only to the service), writes `/etc/helixiam/helixiam.env` (root only,
   `0600`) and stops so you can fill it in.

4. **Fill in `/etc/helixiam/helixiam.env`.** Every empty value, one `KEY=VALUE` per line:

    | Setting | What to put |
    | --- | --- |
    | `HELIX_IDP_HOST`, `HELIX_ADMIN_HOST` | the sign-in host and the console host |
    | `HELIX_ADMIN_ALLOW` | who may open the console: IP addresses or CIDR ranges, separated by spaces |
    | `HELIX_TLS_CERT`, `HELIX_TLS_KEY` | the certificate (full chain) and its key. With Let's Encrypt: `certbot certonly --webroot -w /var/www/helixiam-acme -d <sign-in host> -d <console host> --deploy-hook 'systemctl reload nginx'`, then the `fullchain.pem` and `privkey.pem` of `/etc/letsencrypt/live/<sign-in host>/`. Until both files exist nginx serves only port 80 (the challenge and a redirect) |
    | `DB_VENDOR` | `postgresql`, `mysql` or `mariadb` (it must match the driver jar of step 2) |
    | `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USERNAME`, `DB_PASSWORD` | the database (`DB_PORT` 5432 for PostgreSQL, 3306 for MySQL and MariaDB) |
    | `DB_SSLMODE`, `DB_SSL_ROOT_CERT` | for a database on another host: `verify-full` and the CA's PEM file |
    | `DB_ENCRYPTION` | the key that encrypts secrets in the database: `openssl rand -hex 16`, once. **Keep a copy apart from the backups**: without it the data cannot be read |
    | `HELIX_ADMIN_PASSWORD` | leave empty: the first start generates the first administrator's password (step 6) |
    | `HELIX_SMTP_HOST`, `HELIX_SMTP_PORT`, `HELIX_SMTP_USERNAME`, `HELIX_SMTP_PASSWORD`, `HELIX_SMTP_TLS_MODE`, `HELIX_SMTP_FROM` | optional: outbound email for verification, password reset and notices |

5. **Second run.** `sudo ./helixiam/install.sh` again checks the settings first, then sets up the loopback firewall,
   the systemd service and nginx (checked with `nginx -t`), and starts HelixIAM.

6. **Sign in.** Read the generated password once, open `https://<console host>`, sign in as `admin`, change the
   password, then delete the file:

    ```bash
    sudo cat /var/lib/helixiam/helixiam-admin-password
    sudo rm /var/lib/helixiam/helixiam-admin-password
    ```

## Run it

```bash
systemctl status helixiam          # the service
journalctl -u helixiam -f          # its log
sudo systemctl restart helixiam    # after a change in /etc/helixiam/helixiam.env
```

## Backup and restore

`/opt/helixiam/bin/backup.sh` dumps the database while the server runs (`pg_dump`, `mysqldump` or `mariadb-dump`;
install the distribution's client tools, not older than the database), by default to
`/var/backups/helixiam/helixiam-<UTC time>.dump` (mode `0600`). `/opt/helixiam/bin/restore.sh <file>` stops the
service, empties the database, restores the dump and starts it again (it asks you to type the database name, unless
`--yes`). The dump holds the data encrypted with `DB_ENCRYPTION`, not the key: keep the key and `/etc/helixiam` apart
from the dumps.

```bash
sudo /opt/helixiam/bin/backup.sh
sudo /opt/helixiam/bin/restore.sh /var/backups/helixiam/helixiam-20261201T020000Z.dump
```

## Upgrade

Back up first, then unpack the new release's bundle and run its installer. It never overwrites
`/etc/helixiam/helixiam.env` (the new example goes to `/opt/helixiam/helixiam.env.example`) and keeps the installed
driver; a jar you put in the new bundle's `drivers/` replaces it, which you need when the tested driver version
changes ([The database driver](../operations/database-driver.md#11-each-helixiam-upgrade)). Read
[Upgrades](../operations/upgrades.md) for the release's notes first.

```bash
sudo /opt/helixiam/bin/backup.sh
tar -xzf helixiam-native.tar.gz && sudo ./helixiam/install.sh
```
