Files
NetAlertX/docs/DOCKER_PORTAINER.md
jokob-sk 093d595fc5 DOCS: path cleanup, TZ removal
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
2025-11-16 09:26:18 +11:00

3.0 KiB
Executable File
Raw Blame History

Deploying NetAlertX in Portainer (via Stacks)

This guide shows you how to set up NetAlertX using Portainers Stacks feature.

Portainer > Stacks


1. Prepare Your Host

Before deploying, make sure you have a folder on your Docker host for NetAlertX data. Replace APP_FOLDER with your preferred location, for example /local_data_dir here:

mkdir -p /local_data_dir/netalertx/config
mkdir -p /local_data_dir/netalertx/db
mkdir -p /local_data_dir/netalertx/log

2. Open Portainer Stacks

  1. Log in to your Portainer UI.
  2. Navigate to StacksAdd stack.
  3. Give your stack a name (e.g., netalertx).

3. Paste the Stack Configuration

Copy and paste the following YAML into the Web editor:

services:
  netalertx:
    container_name: netalertx

    # Use this line for stable release
    image: "ghcr.io/jokob-sk/netalertx:latest"      

    # Or, use this for the latest development build
    # image: "ghcr.io/jokob-sk/netalertx-dev:latest" 

    network_mode: "host"
    restart: unless-stopped

    volumes:
      - ${APP_FOLDER}/netalertx/config:/data/config
      - ${APP_FOLDER}/netalertx/db:/data/db
      # Optional: logs (useful for debugging setup issues, comment out for performance)
      - ${APP_FOLDER}/netalertx/log:/tmp/log

      # API storage options:
      # (Option 1) tmpfs (default, best performance)
      - type: tmpfs
        target: /tmp/api

      # (Option 2) bind mount (useful for debugging)
      # - ${APP_FOLDER}/netalertx/api:/tmp/api

    environment:
      - PORT=${PORT}
      - APP_CONF_OVERRIDE=${APP_CONF_OVERRIDE}

4. Configure Environment Variables

In the Environment variables section of Portainer, add the following:

  • APP_FOLDER=/local_data_dir (or wherever you created the directories in step 1)
  • PORT=22022 (or another port if needed)
  • APP_CONF_OVERRIDE={"GRAPHQL_PORT":"22023"} (optional advanced settings, otherwise the backend API server PORT defaults to 20212)

5. Ensure permissions

Tip

If you are facing permissions issues run the following commands on your server. This will change the owner and assure sufficient access to the database and config files that are stored in the /local_data_dir/db and /local_data_dir/config folders (replace local_data_dir with the location where your /db and /config folders are located).

sudo chown -R 20211:20211 /local_data_dir
sudo chmod -R a+rwx  /local_data_dir

6. Deploy the Stack

  1. Scroll down and click Deploy the stack.
  2. Portainer will pull the image and start NetAlertX.
  3. Once running, access the app at:
http://<your-docker-host-ip>:22022

7. Verify and Troubleshoot

  • Check logs via Portainer → ContainersnetalertxLogs.
  • Logs are stored under ${APP_FOLDER}/netalertx/log if you enabled that volume.

Once the application is running, configure it by reading the initial setup guide, or troubleshoot common issues.