diff --git a/docs/DOCKER_PORTAINER.md b/docs/DOCKER_PORTAINER.md new file mode 100755 index 00000000..056c1961 --- /dev/null +++ b/docs/DOCKER_PORTAINER.md @@ -0,0 +1,97 @@ +# Deploying NetAlertX in Portainer (via Stacks) + +This guide shows you how to set up **NetAlertX** using Portainer’s **Stacks** feature. + +![Portainer > Stacks](./img/DOCKER/DOCKER_PORTAINER.png) + +--- + +## 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 `/opt` here: + +```bash +mkdir -p /opt/netalertx/config +mkdir -p /opt/netalertx/db +mkdir -p /opt/netalertx/log +``` + +--- + +## 2. Open Portainer Stacks + +1. Log in to your **Portainer UI**. +2. Navigate to **Stacks** → **Add 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**: + +```yaml +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:/app/config + - ${APP_FOLDER}/netalertx/db:/app/db + # Optional: logs (useful for debugging setup issues, comment out for performance) + - ${APP_FOLDER}/netalertx/log:/app/log + + # API storage options: + # (Option 1) tmpfs (default, best performance) + - type: tmpfs + target: /app/api + + # (Option 2) bind mount (useful for debugging) + # - ${APP_FOLDER}/netalertx/api:/app/api + + environment: + - TZ=${TZ} + - PORT=${PORT} + - APP_CONF_OVERRIDE=${APP_CONF_OVERRIDE} +``` + +--- + +## 4. Configure Environment Variables + +In the **Environment variables** section of Portainer, add the following: + +* `APP_FOLDER=/opt` (or wherever you created the directories in step 1) +* `TZ=Europe/Berlin` (replace with your timezone) +* `PORT=22022` (or another port if needed) +* `APP_CONF_OVERRIDE={"GRAPHQL_PORT":"22023"}` (optional advanced settings) + +--- + +## 5. 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://:22022 +``` + +--- + +## 6. Verify and Troubleshoot + +* Check logs via Portainer → **Containers** → `netalertx` → **Logs**. +* 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](INITIAL_SETUP.md) guide, or [troubleshoot common issues](COMMON_ISSUES.md). diff --git a/docs/img/DOCKER/DOCKER_PORTAINER.png b/docs/img/DOCKER/DOCKER_PORTAINER.png new file mode 100755 index 00000000..e29a0699 Binary files /dev/null and b/docs/img/DOCKER/DOCKER_PORTAINER.png differ diff --git a/mkdocs.yml b/mkdocs.yml index 41338c66..f6a18c44 100755 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -19,6 +19,7 @@ nav: - Docker Updates: UPDATES.md - Other: - Synology Guide: SYNOLOGY_GUIDE.md + - Portainer Stacks: DOCKER_PORTAINER.md - Community Guides: COMMUNITY_GUIDES.md - Bare-metal (Experimental): HW_INSTALL.md - Migration Guide: MIGRATION.md