Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Home
  2. Guides
  3. Server notifications: Telegram, Slack, e-mail and webhooks done right
Operations

Server notifications: Telegram, Slack, e-mail and webhooks done right

Set up Cipi notifications from scratch, explained for beginners: which channels exist, which events trigger them, how to route urgent alerts to your phone and the rest to a quiet channel, how to verify signed webhooks, and how to avoid alert fatigue.

By Updated 3 min read

A server that fails quietly is the worst kind. Cipi can tell you when something needs your attention (a failed deploy, a backup that didn't run, a full disk, an SSH login) on the channels you already use. This guide explains how notifications work and how to set them up so they help instead of becoming noise.

How it works#

Step 1 of 5Something happens

An event happens on the server: a deploy finishes, a backup fails, disk fills up, someone logs in.

TermMeaning
EventSomething that happened on the server: deploy_fail, backup_stale, ssh_login…
TriggerAn on/off switch per event type. All are on by default
ChannelA destination: an e-mail address, a Telegram chat, a Slack channel, a webhook URL
Event log/var/log/cipi/events.log, written for every event, muted or not

1. Choose your channels#

ChannelGood forYou need
smtp, resend, sesA searchable record of everythingSMTP credentials, a Resend key, or SES keys
telegramAlerts on your phone, freeA bot token and a chat id
slack, mattermost, googlechat, discordTeam channelsAn incoming webhook URL
ntfy, pushoverPush notifications with prioritiesA topic URL, or Pushover keys
webhookYour own automation (PagerDuty, n8n, a Laravel route)A URL and a shared secret

A sensible start: e-mail for the record, Telegram or Slack for action.

2. Add e-mail#

bash
sudo cipi notification add smtp --host=smtp.example.com --port=587 \
    --user=alerts@example.com --password=… --from=alerts@example.com --to=ops@example.com --tls=on

Use a transactional provider (Postmark, Mailgun, Brevo, SES): mail sent directly from a VPS usually lands in spam.

3. Add Telegram#

Step 1 of 4@BotFather

In Telegram, open @BotFather, send /newbot, choose a name. It answers with the bot token.

  1. In Telegram, open @BotFather, send /newbot, pick a name. Copy the token.
  2. Send /start to your new bot (or add it to a group and write something there).
  3. Open https://api.telegram.org/bot<TOKEN>/getUpdates in a browser and copy chat.id (groups have negative ids).
  4. Add the channel:
bash
sudo cipi notification add telegram oncall --token=<bot-token> --chat-id=<id>

4. Add Slack (or Mattermost, Google Chat, Discord)#

Create an incoming webhook for the channel (Slack: Apps → Incoming Webhooks), then:

bash
sudo cipi notification add slack ops --url=https://hooks.slack.com/services/…

5. Test everything#

Notifications
$ cipi notification test all
bash
sudo cipi notification              # channels and triggers, no secrets shown
sudo cipi notification test all

6. Decide what's worth an alert#

Everything is on by default. Mute what you don't act on:

bash
sudo cipi notification triggers
sudo cipi notification triggers disable monitor_load
sudo cipi notification triggers disable deploy_success
CategoryEventsKeep on?
Deploydeploy_fail, deploy_rollback, deploy_health_fail, deploy_snapshot_failYes
deploy_successOptional: noisy with many pushes
Health & monitorhealth_fail, monitor_disk, monitor_ssl, monitor_services, monitor_workers, monitor_http_5xxYes
monitor_load, monitor_okOptional
Backups & cronbackup_fail, backup_stale, cron_failYes
Securityssh_login, sudo, su, ssh_key_*Yes if few people log in
Apps & configapp_create, alias_*, yml_apply, yml_failUseful for teams
Updatesphp_upgrade, nginx_upgrade, pending_reportUseful as a weekly record

A good rule: if nobody would do anything after reading it, mute it. Alerts you ignore train you to ignore the ones that matter.

7. Signed webhooks for your own automation#

A webhook channel posts JSON (server, trigger, subject, body, ts). With a secret, each request carries X-Cipi-Signature: sha256=…. Verify it before trusting the payload, for example in a Laravel route:

php
Route::post('/hooks/cipi', function (Request $request) {
    $expected = 'sha256='.hash_hmac('sha256', $request->getContent(), config('services.cipi.secret'));
    abort_unless(hash_equals($expected, (string) $request->header('X-Cipi-Signature')), 401);

    $event = $request->json()->all();       // server, trigger, subject, body, ts
    if (in_array($event['trigger'], ['deploy_fail', 'backup_fail', 'health_fail'])) {
        // page the on-call person, open a ticket…
    }
    return response()->noContent();
});
bash
sudo cipi notification add webhook router --url=https://ops.example.com/hooks/cipi --secret=…

This is also how you route: urgent triggers to a phone, the rest to a channel.

8. Alerts for your own cron jobs#

Wrap a job in a root cron file with cipi-cron-notify <label> <command…>:

text
# /etc/cron.d/shop-reports
0 4 * * * root /usr/local/bin/cipi-cron-notify daily-report sudo -u shop php /home/shop/current/artisan report:daily

A non-zero exit sends cron_fail with the label and the output, through the same channels. Cipi wraps its own nightly jobs the same way.

A setup that works for small teams#

  • E-maileverything, searchable record
  • Telegram group "ops"deploy_fail, backup_*, health/monitor, security
  • Muteddeploy_success, monitor_load, monitor_ok
  • Weeklyread pending_report and update notes

Troubleshooting#

ProblemFix
Telegram test doesn't arriveWrong chat id (groups are negative), or you never sent /start to the bot
E-mail in spamUse a provider; add SPF and DKIM for the --from domain
Slack 404The webhook was revoked: create a new one and cipi notification add again
Too many messagesDisable noisy triggers (step 6)
Need historysudo tail -f /var/log/cipi/events.log

Questions

Which channel should I start with?

E-mail for a record of everything, plus one chat or push channel you actually look at (Telegram, Slack or ntfy) for what needs action. Two channels cover most teams.

Can a broken webhook block a deploy?

No. Delivery is best-effort with a 5-second timeout and runs in the background. A dead endpoint never stalls a deploy, a backup or a cron job.

Are my tokens stored safely?

Secrets you omit from the command line are asked without echo, stored encrypted, and never printed back, not even by cipi notification.

I muted a trigger. Is the event lost?

No. Every event is written to /var/log/cipi/events.log (kept a year) whatever you mute.

Can different events go to different channels?

Triggers decide which events notify; every enabled channel receives them. To route urgent events only to your phone, point a webhook at a small router (n8n, a Laravel route, a Cloudflare Worker) and fan out from there, or use ntfy's priority: urgent events are raised to high.

How do I get alerts for my own cron jobs?

Wrap them with cipi-cron-notify: when the command exits non-zero you get a cron_fail notification with its output.

Can I see who logged in to the server?

Yes. SSH logins as root or a sudoer, sudo and su are security triggers with source IP and key fingerprint, delivered through PAM in the background.

Try it on your own server

Free and open source. One command on a fresh Ubuntu 24.04 or 26.04 VPS.

wget -O - https://cipi.sh/setup.sh | bash
Read the quickstart