If you run a Minecraft server at home, the first sign it's down is usually a message from a player. Here's a free way to hear about it first, with a short script, a cron job and a Discord webhook. It takes about ten minutes on any Linux box.

1. Make a Discord webhook

In your Discord server, open the channel you want alerts in, then Edit Channel, Integrations, Webhooks, New Webhook. Copy the webhook URL and keep it private, since anyone with it can post to that channel.

2. Install netcat

On Debian or Ubuntu:

sudo apt install netcat-openbsd 

3. Save the script

Save this as ~/mc-check.sh, put your webhook URL in, and make it runnable with chmod +x ~/mc-check.sh:

#!/usr/bin/env bash # Posts to Discord when the Minecraft server stops answering, and again when it's back. HOST=127.0.0.1 PORT=25565 WEBHOOK="https://discord.com/api/webhooks/your-id/your-token" STATE="$HOME/.mc-check-down" send() { curl -s -H "Content-Type: application/json" -d "{\"content\":\"$1\"}" "$WEBHOOK" >/dev/null } if nc -z -w 5 "$HOST" "$PORT" 2>/dev/null; then if [ -f "$STATE" ]; then rm -f "$STATE"; send "Minecraft server is back up"; fi else if [ ! -f "$STATE" ]; then touch "$STATE"; send "Minecraft server is down"; fi fi 

The state file is what stops it from posting every minute while the server stays down: you get one message when it goes down and one when it comes back.

4. Run it every minute

Open crontab -e and add:

* * * * * $HOME/mc-check.sh 

5. Test it

Stop your server, wait a minute, and the alert should land in Discord. Start it again and you'll get the all-clear.

What this doesn't catch

A port check only tells you the server accepts connections. It won't notice a server that's frozen but still holding the port, heavy lag, a full disk, or a crash loop that restarts faster than a minute. For those you need something that looks at the server process and its TPS.

The done-for-you version

I build MineOps, which does all of this without the script: it watches TPS, players, disk and crashes, posts to Discord, Slack or email, and on paid plans restarts a crashed server for you. The agent only connects outward, so there are no ports to open. It's free for 2 servers.