How to monitor a TCP port (databases, mail, Redis) in Spot Downtime
A step-by-step guide to TCP port monitoring: pick the host and port, choose an interval, make the port reachable, and test that the alert fires before you rely on it.
· 4 min read · By the Spot Downtime team
Databases, mail servers, Redis and message brokers don't serve web pages, so a website check can't watch them. A TCP port monitor opens a connection to the host and port and alerts you the moment it's refused or times out. It needs no credentials and sends no data.
Step 1: create the monitor
- Open Monitors and click Add monitor.
- Choose TCP port.
- In Host and port, enter the address with its port, such as
db.example.com:5432. - Optionally give it a Name, like
Production Postgres. Without one, it's named after the address. - Pick how often to Check every, then click Add monitor.
Add a monitor
Host and port
db.example.com:5432
Name
Production Postgres
Check every
1 minute
Common ports, for reference:
| Service | Port |
|---|---|
| PostgreSQL | 5432 |
| MySQL / MariaDB | 3306 |
| Redis | 6379 |
| SMTP (mail) | 25, 465 or 587 |
| IMAP | 993 |
| SSH | 22 |
Step 2: make sure the port is reachable
Checks run from the public internet, and private addresses (10.x, 192.168.x and the like) are blocked. If your firewall only accepts connections from your own servers, allow our check addresses. The firewall allowlist guide lists them. You can test from your own machine first:
nc -vz db.example.com 5432Or use the port checker, which tests from outside your network.
Step 3: read the result
| Result | Means |
|---|---|
| Up | The connection opened within 10 seconds. The time it took goes on the response-time chart. |
| Connection refused | The host is up, but nothing is listening on that port: the service stopped or is bound to another address. |
| Timed out | A firewall dropped the connection, or the host is down. |
| Host not found | The hostname doesn't resolve. Check its DNS records. |
Step 4: test the alert
- Under Alerts, connect a channel such as Slack, email or SMS, and press Send test.
- On a staging server, stop the service briefly. The monitor goes down after the failure is confirmed, and you get the alert.
- Start it again. You get the recovery alert.
Tips
- Open port isn't the same as healthy. A database can accept connections while queries fail. For a deeper check, monitor an app endpoint that queries it, with an API monitor.
- Don't expose a database just to monitor it. If it's private, use a heartbeat from a job that runs inside your network.
- Domain expiry comes free. A TCP monitor on a domain name also warns you before the domain lapses.
More in this series
Get new guides by email
Practical posts on monitoring, outages, error fixes and on-call, when they're published. No spam.
Keep reading
- How-to · Monitoring · APIsHow to configure gRPC health checkingLearn how to implement and configure gRPC health checking for reliable service discovery and load balancing: server status, Kubernetes probes, client-side health checks, Envoy, cloud load balancers and Consul.November 7, 2026 · 7 min read
- How-to · Servers · MonitoringHow to monitor CPU, memory and disk usage on a Linux serverCheck CPU, memory and disk on Linux with top, free and df, learn which numbers actually matter, pick sensible alert limits, and get alerted before a server runs out.November 4, 2026 · 8 min read