# Beszel & Gotify Integration

This guide outlines the process for integrating **Beszel** with a self-hosted **Gotify** instance to receive real-time server health alerts. This setup ensures your notification data remains within your own infrastructure while providing reliable push notifications to mobile devices.

---

### Overview

Beszel utilizes the **Shoutrrr** library to handle notifications, allowing it to send alerts to various services via a standardized URL format. By connecting it to Gotify, you gain a private, lightweight notification server that operates independently of third-party cloud providers.

### Step 1: Create a Gotify Application

To allow Beszel to communicate with Gotify, you must generate a unique API token.

1. Log in to your **Gotify Web UI** (e.g., `https://gotify.yourdomain.com`).
2. Navigate to the **Apps** tab in the top header.
3. Click **Create Application**.
4. Name the application (e.g., "Beszel Alerts") and click **Create**.
5. **Copy the Token:** A string of characters will appear in the "Token" column. Save this for the next step.

### Step 2: Configure Beszel Notification URL

Now, provide Beszel with the connection string for your Gotify server.

1. Open your **Beszel Dashboard**.
2. Go to **Settings** &gt; **Notifications**.
3. Under the **Webhook / Push notifications** section, click **+ Add URL**.
4. Enter the URL using the following format (replace the placeholders with your actual domain and token):

```
gotify://godify.yourdomain.com/YOUR_APP_TOKEN_HERE
```

*Note: If testing strictly on a local network without a reverse proxy, use `gotify://[LOCAL_IP]:[PORT]/[TOKEN]`.*

5. Click **Save Settings**.
6. Click **Test URL** to confirm a "Test Message" appears in your Gotify dashboard.

### Step 3: Enable Alert Thresholds

Notifications are only dispatched when specific triggers are met.

1. On the Beszel **All Systems** page, click the **Bell Icon (🔔)** next to the server you wish to monitor.
2. Toggle **Status** to "ON" (alerts you if the server goes offline).
3. Set thresholds for **CPU**, **Memory**, or **Disk Usage** (e.g., "Average exceeds 90% for 10 minutes").
4. Click **Save**.

### Step 4: Mobile Integration

To receive these alerts as push notifications on your mobile device, link the mobile app to your server.

**For Android:**

- Download **Gotify** from the Play Store or F-Droid.
- Enter your server URL: `https://godify.yourdomain.com`.
- Log in with your Gotify user credentials.
- **Crucial:** Navigate to phone **Settings &gt; Apps &gt; Gotify &gt; Battery** and set it to **Unrestricted** to prevent the OS from killing the background process.

**For iOS:**

- Download **iGotify** from the App Store.
- Enter your server URL and login credentials.
- Follow the in-app prompts to enable push certificates.

---

### Security Best Practices

- **SSL/HTTPS:** Always route Gotify through a reverse proxy (like Nginx Proxy Manager) with a valid SSL certificate.
- **WebSockets:** Ensure your reverse proxy has "Websockets Support" enabled, as Gotify relies on them for real-time delivery.
- **Privacy:** Avoid sharing your App Tokens publicly, as they allow any service to push messages to your devices.