What to check when you monitor a server from iPhone
Most problems on a Linux server show up in one of seven places. On a phone you want the short command for each, and to know what a bad value looks like.
- Load:
uptime, compared withnproc. - Memory:
free -h, the available column. - Disk:
df -h, anything above 90%. - Services:
systemctl --failed, which should list nothing. - Logs:
journalctl -p err -b, errors since the last boot. - Containers:
docker psanddocker stats --no-stream. - Open ports:
sudo ss -tulpn, only what you expect.
The commands below were run on Debian 13; they are the same on Ubuntu and most other distributions.
How do you check load, memory and disk on a Linux server?
Start with uptime. It prints how long the server has been up and three load averages, for the last 1, 5 and 15 minutes:
$ uptime
23:50:34 up 1:31, 0 users, load average: 0.90, 1.32, 1.83
$ nproc
8
The load counts processes running or waiting for the CPU or the disk, and it is not divided by the number of cores. A load of 1.8 on 8 cores is quiet. A 15 minute value above the core count means work is queueing.
For memory, read the available column, not free:
$ free -h
total used free shared buff/cache available
Mem: 11Gi 1.6Gi 7.0Gi 83Mi 3.4Gi 10Gi
Swap: 0B 0B 0B
Linux fills spare memory with disk cache and gives it back on demand, so a low free value is normal. Worry when available is low and swap keeps growing.
For disk, check both space and inodes. A full inode table stops new files even with gigabytes free:
df -h -x tmpfs -x devtmpfs # space per filesystem
df -i / # inodes
sudo du -xh --max-depth=1 /var | sort -h # what fills /var
To see who uses the CPU or the memory right now:
ps aux --sort=-%cpu | head -5
ps aux --sort=-%mem | head -5
How do you find failed services and errors in the logs?
On a server with systemd, one command lists every unit that failed:
systemctl --failed
systemctl status nginx # why one failed, with its last lines
Then read the errors. -p err keeps only messages of priority error and worse, and -b limits them to the current boot:
journalctl -p err -b --no-pager | tail -30
journalctl -u nginx --since "1 hour ago"
journalctl -k | grep -i "out of memory" # processes killed for lack of memory
On a phone screen, tail and --since keep the output short enough to read. Our SSH commands cheat sheet has more of these.
How do you check Docker containers and open ports?
Docker can filter the containers that need you, and give a snapshot of their resources:
docker ps --filter health=unhealthy
docker ps -a --filter status=exited
docker stats --no-stream
--no-stream prints once and returns, which suits a small screen. Our guide to managing Docker over SSH covers logs, Compose and cleanup.
Last, check what listens on the network:
sudo ss -tulpn
-t and -u show TCP and UDP, -l only listening sockets, -p the process and -n numbers instead of names. An address of 0.0.0.0 or [::] means the port is open on every interface, so check that the firewall agrees with what you see.
A Linux server health check you can run on every server
Put the checks in one command that prints a short report and fails when a disk is 90% full or more:
uptime
free -h | awk '/^Mem:/ {print "Memory available:", $7}'
systemctl --failed --no-legend
df -h --output=pcent,target -x tmpfs -x devtmpfs | awk 'NR>1 && $1+0 >= 90 {print "Disk almost full:", $2, $1; bad=1} END {exit bad}'
The exit code of the last line tells you at a glance whether a disk needs attention. By hand, on several servers, it is a loop:
for h in web1 web2 db1; do echo "== $h"; ssh "$h" 'df -h /; systemctl --failed --no-legend'; done
In Wardterm, save the check once as a saved command. On iPhone, ... on the key bar lists your commands and a tap runs one in the session. Run on several servers sends it to a whole group, even servers that are not connected, and shows each one with its exit code and output, filtered by Succeeded or Failed.
What should you automate instead of checking by hand?
Checking from your phone is for when you already know something is wrong. These should reach you on their own:
- The server stops answering. Run an uptime monitor on a different machine, such as Uptime Kuma on a small VPS or a home server. It checks HTTP, TCP ports, ping or DNS, and notifies your phone by email or a push service.
- A scheduled job stops running. A Push monitor in Uptime Kuma waits for a ping; add
curl -fsSto that URL at the end of the cron job, and silence becomes an alert. - A disk fills up. Run the health check above from cron, and ping the monitor only when it succeeds.
- Security updates. Let unattended-upgrades install them, as in our Linux server security checklist.
Uptime Kuma itself runs in one container:
docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:2
Keep it off the servers it watches: when a server goes down, its own monitor goes down with it.
How do you monitor a server from iPhone with Wardterm?
Typing free -h on a phone keyboard works, but a panel that shows the numbers next to the terminal is quicker. Wardterm has one for every SSH server, on iPhone, iPad, Android, Mac, Windows and Linux.
- Server tab. In a terminal on iPhone, tap the side panel button next to ..., then Server: CPU with a graph of the last minute and the load, memory and swap, free space on each disk, network in and out, and uptime, updated every 2 seconds. See Server stats.
- Show More adds each core, the top processes by CPU and by memory, listening ports, failed services, temperatures and pending updates, with whether a restart is needed.
- Containers tab. Containers grouped by Compose project, with live logs, a shell, restart, and CPU and memory bars. See Docker containers.
The Server tab reads Linux, BusyBox included, macOS, FreeBSD and Windows, so the same panel works for a VPS, a Raspberry Pi or the Mac under your desk.
Your servers and checks on every device
Save your servers and health checks once. With Pro they sync, end-to-end encrypted, to your iPhone, iPad, Android phone and computers. Start free.
The Free plan costs nothing. Pro is €6.99 or $8.49 a month before tax, and you can try it for 14 days with no card.
Servers4
deploy@10.20.0.30Productiondeploy@10.20.0.11Productiondeploy@10.20.0.12Productionredis@cache-eu.internalServers4
Questions
What is the easiest way to monitor a Linux server from my phone?
Connect over SSH and run uptime, free -h, df -h and systemctl --failed. For less typing, use an SSH app with a stats panel and saved commands, and let an uptime monitor on another machine tell you when the server stops answering.
How do I check CPU and memory usage on a Linux server?
Run top for a live view, or ps aux --sort=-%cpu | head for the top processes by CPU. For memory, free -h and its available column, and ps aux --sort=-%mem | head to see what uses it.
What is a normal load average?
Compare it with the number of cores, which nproc prints. A load at or under the core count is fine. A load above it for the 5 and 15 minute values means processes are waiting for the CPU or for the disk.
Why does free show almost no free memory?
Linux uses spare memory as a disk cache and gives it back when programs need it. Read the available column: it estimates the memory new programs can use without swapping.
How do I check disk space on Linux?
Run df -h for space per filesystem and df -i for inodes. To find what fills a folder, sudo du -xh --max-depth=1 /var | sort -h.
How do I get a server down alert on my iPhone?
Run an uptime monitor on a different machine, such as Uptime Kuma on a small VPS or at home, and send its notifications to your phone. A server cannot report that it is down itself.
Can I see docker stats from an iPhone?
Yes. Over SSH, run docker stats --no-stream. In Wardterm, the Containers panel shows CPU and memory bars for each container, with live logs and restart, on iPhone, iPad, Android, Mac, Windows and Linux.
Do I need to install an agent on the server to monitor it?
Not for the checks in this article: they use tools every Linux server already has. An agent or exporter helps when you want history and graphs over weeks.
Sources
Each page was read on the date shown. Prices and features change, so check the maker's page before you decide.
- uptime(1), Linux manual page, read on
- free(1), Linux manual page, read on
- journalctl(1), Linux manual page, read on
- ss(8), Linux manual page, read on
- Docker docs, docker container ls filters, read on
- Uptime Kuma, source repository, read on
- Wardterm docs, Server stats, read on