Skip to content

Installation

This guide covers the manual installation of Suricatavel with full control over each component.

For a quick automated installation, see the Quickstart Guide.

Step 1: Install PostgreSQL 18 and TimescaleDB

Section titled “Step 1: Install PostgreSQL 18 and TimescaleDB”
  1. Add repositories

    Terminal window
    # Add PostgreSQL repository
    apt-get install -y gnupg2 wget lsb-release
    mkdir -p /usr/share/keyrings
    wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg
    echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
    # Add TimescaleDB repository
    wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | gpg --dearmor -o /usr/share/keyrings/timescaledb-archive-keyring.gpg
    echo "deb [signed-by=/usr/share/keyrings/timescaledb-archive-keyring.gpg] https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/timescaledb.list
  2. Install packages

    Terminal window
    apt-get update
    apt-get install -y postgresql-18 postgresql-client-18 timescaledb-2-postgresql-18
    # Ensure PostgreSQL 18 cluster exists (optional if already created by install)
    # If the cluster 'main' already exists, this command will safely error out or can be skipped
    if ! pg_lsclusters | grep -q "18 main"; then
    pg_createcluster 18 main --start
    fi
    # Optimize PostgreSQL configuration
    # --quiet --yes runs it non-interactively with recommended settings
    timescaledb-tune --quiet --yes
    systemctl restart postgresql
  3. Create Database

    Terminal window
    # Create database and user
    sudo -u postgres psql -c "CREATE USER suricatavel WITH PASSWORD 'secret_password';"
    sudo -u postgres psql -c "CREATE DATABASE suricataveldb OWNER suricatavel;"
Terminal window
# Add Ondřej Surý PHP PPA
apt install -y lsb-release ca-certificates apt-transport-https software-properties-common
add-apt-repository ppa:ondrej/php -y
apt update
# Install PHP 8.5 and extensions
apt install -y php8.5-cli \
php8.5-pgsql php8.5-pdo \
php8.5-mbstring php8.5-xml php8.5-curl \
php8.5-zip php8.5-bcmath php8.5-intl \
php8.5-redis php8.5-opcache
# Optional: Kafka extension (only if using Kafka transport)
apt install -y php8.5-rdkafka

Verify PHP installation:

Terminal window
php -v
php -m | grep -E "pdo|pgsql|pcntl|posix"
Terminal window
apt install -y nginx

Nginx site: the package installs /etc/nginx/conf.d/suricatavel.conf when there is none (it never overwrites yours), from the same template Ansible uses:

  • The host of APP_URL is the server name; an IP address or localhost answers on any name.
  • With an https APP_URL and the certificate and key in /etc/ssl/certs/suricatavel.crt and /etc/ssl/private/suricatavel.key, it serves HTTPS with HSTS and redirects port 80. Otherwise it serves plain HTTP and warns about it.
  • Requests up to 10 MB reach the application.

Install Nginx before the package, and configure APP_URL and the certificate first, so the site is right from the start. Debian’s default site is also the default server on port 80: disable it (rm /etc/nginx/sites-enabled/default) or the generated site is set aside as suricatavel.conf.rejected. To render the site again (after changing APP_URL or adding the certificate), remove it and run sh /usr/share/suricatavel/support/nginx/web-vhost-setup.sh as root.

The agent channel (port 8443, mutual TLS with Suricatavel’s internal CA) is not part of this site: the package installs it as /etc/nginx/conf.d/suricatavel-agent-channel.conf. Do not add a server block on port 8443 to this site.

Terminal window
apt install -y supervisor
systemctl enable --now supervisor
Terminal window
# Import GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repository.suricatavel.org/pubkey.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/suricatavel.gpg
# Add repository source (.sources)
sudo tee /etc/apt/sources.list.d/suricatavel.sources << 'EOF'
Types: deb
URIs: https://repository.suricatavel.org/
Suites: stable
Components: suricatavel
Signed-By: /etc/apt/keyrings/suricatavel.gpg
EOF
# Update package cache
sudo apt update
Terminal window
apt install -y suricatavel

What the package does:

  1. Creates system user suricatavel (no login shell).
  2. Installs the code to /usr/share/suricatavel.
  3. Creates the configuration, state, cache and log directories with their permissions (see below).
  4. Generates APP_KEY and the Reverb credentials in /etc/suricatavel/.env.
  5. Runs database migrations (if DB is accessible).
  6. Configures Supervisor workers.

Directory layout:

Path Contents Owner
/usr/share/suricatavel Code, with its package, icon and component caches already built root, read-only for the application
/etc/suricatavel/.env Configuration suricatavel, mode 0600
/var/lib/suricatavel State: internal CA and channel certificate (certs/ca), secrets, SSH keys, backups; home of the suricatavel user suricatavel
/var/cache/suricatavel Compiled views suricatavel
/var/log/suricatavel Logs of the application and its workers suricatavel

The configuration is read at every start: there is no configuration or route cache to rebuild after editing .env.

Edit the environment file:

Terminal window
nano /etc/suricatavel/.env

Essential configuration:

Terminal window
APP_NAME=Suricatavel
APP_ENV=production
APP_DEBUG=false
APP_URL=http://your-domain.com
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=suricataveldb
DB_USERNAME=suricatavel
DB_PASSWORD=secret_password
# Optional: Kafka configuration (high throughput)
#KAFKA_BROKERS=localhost:9092
#KAFKA_CONSUMER_GROUP_ID=suricatavel
# Optional: HTTP configuration (simpler setup)
#SURICATAVEL_AGENT_TRANSPORT=http
#SURICATAVEL_AGENT_HTTP_ENDPOINT=http://your-domain.com/api/v1/events
#SURICATAVEL_AGENT_HTTP_TOKEN=your-agent-token
# Optional: Redis for cache
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
# Mail configuration
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=[email protected]
MAIL_PASSWORD=your-smtp-password
MAIL_ENCRYPTION=tls

If the database was not accessible during installation, run migrations manually:

Terminal window
suricatavel deploy --migrate

Rebuild caches after configuration changes:

Terminal window
suricatavel maintenance cache

The suricatavel package automatically configures Supervisor. Check the status:

Terminal window
suricatavel status

You should see processes like web, worker, scheduler in RUNNING state. If Kafka is enabled, kafka should also be running.

Initialize the application:

Terminal window
suricatavel boot

Or in non-interactive mode (creates default admin user):

Terminal window
suricatavel boot -s

Default credentials:

Sensors register and send telemetry to port 8443/tcp. The package opens it in firewalld or ufw when one of them is active; allow it in any router, NAT or cloud security list in front of the controller. The package creates the internal CA, issues the channel certificate for the host of APP_URL (and of the Agent channel URL setting) and enables the Nginx server block; each upgrade re-issues the certificate when one of those hosts is missing. Check that it listens on the controller:

Terminal window
ss -ltn | grep 8443
curl -sk -o /dev/null -w '%{http_code}\n' https://localhost:8443/api/v1/agent/ca # 200

When sensors use another name or address (a private IP, or a public one behind NAT), add it and reload Nginx:

Terminal window
suricatavel pki channel --host=controller.example.com --host=203.0.113.10
systemctl reload nginx

Pass --missing to keep the hosts the certificate already covers and only re-issue it when it is missing or lacks any of the configured or --host entries (for example after changing APP_URL or Agent channel URL):

Terminal window
suricatavel pki channel --missing
# or adding a new host while preserving existing ones:
suricatavel pki channel --host=agent.example.com --missing
systemctl reload nginx

If you configured APP_URL after installing the package, run sh /usr/share/suricatavel/support/nginx/agent-channel-setup.sh as root (or reinstall the package) so the certificate covers it.

For zero-downtime updates with automatic rollback, use the CLI:

Terminal window
suricatavel update

The update command will handle backup, maintenance mode, package updates, and migrations automatically.

For manual updates via package manager:

Terminal window
apt update
apt upgrade suricatavel

When the system updates TimescaleDB (apt upgrade or dnf upgrade), the database keeps the previous version of the extension until it is updated, and meanwhile its background jobs fail: the hourly aggregates stop refreshing and the dashboard statistics freeze. Suricatavel status and the system health panel report it. Update the extension in each database that uses it, as the first command of a new session (-X skips .psqlrc), with the workers stopped:

Terminal window
suricatavel workers stop all
sudo -u postgres psql -X suricataveldb -c "ALTER EXTENSION timescaledb UPDATE;"
suricatavel workers start all

See the quickstart guide for common issues.

For questions or issues, consult the FAQ or contribute.