How to Check Server Uptime on Linux and Windows

Step-by-step guide to checking server uptime on Linux and Windows. Learn CLI commands, monitoring tools, and how to track uptime over time.

· Project Helena · 3 min read ·
uptime monitoring Linux Windows server

Knowing your server’s uptime is fundamental to reliability engineering. Whether you’re debugging a recent reboot, verifying an SLA, or auditing server health, here’s how to check uptime on any system.

Check Uptime on Linux

The uptime Command

The simplest way:

Terminal window
$ uptime
14:23:45 up 127 days, 3:42, 2 users, load average: 0.15, 0.10, 0.08

This tells you: current time, how long the system has been running, logged-in users, and load averages for 1, 5, and 15 minutes.

Using /proc/uptime

For a machine-readable format:

Terminal window
$ cat /proc/uptime
10987654.32 21234567.89

The first number is uptime in seconds. The second is total idle time across all CPUs. To convert to days:

Terminal window
$ awk '{print int($1/86400)" days"}' /proc/uptime
127 days

Using who -b

Shows the last boot time:

Terminal window
$ who -b
system boot 2025-10-30 10:41

Using systemd-analyze

On systemd-based systems, get detailed boot timing:

Terminal window
$ systemd-analyze
Startup finished in 1.234s (kernel) + 3.456s (initrd) + 12.789s (userspace) = 17.479s

Using last reboot

See a history of all reboots:

Terminal window
$ last reboot
reboot system boot 5.15.0-89-generic Wed Oct 30 10:41 still running
reboot system boot 5.15.0-86-generic Mon Sep 15 08:22 - 10:41 (45+02:19)

Check Uptime on Windows

Using systeminfo

Open Command Prompt or PowerShell:

Terminal window
systeminfo | find "System Boot Time"

Output:

System Boot Time: 10/30/2025, 10:41:23 AM

Using PowerShell

More precise with PowerShell:

Terminal window
(Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime

Output:

Days : 127
Hours : 3
Minutes : 42
Seconds : 15

Or as a one-liner for just the uptime:

Terminal window
$os = Get-CimInstance Win32_OperatingSystem
"Uptime: $((Get-Date) - $os.LastBootUpTime)"

Using Task Manager

For a quick visual check:

  1. Open Task Manager (Ctrl+Shift+Esc)
  2. Go to the Performance tab
  3. Look at Up time in the bottom-left of the CPU section

Using net statistics

Terminal window
net statistics server

The “Statistics since…” line shows when the Server service started, which typically aligns with boot time.

Remote Server Uptime Check

Via SSH (Linux)

Terminal window
ssh user@server "uptime"

Via SNMP

For monitoring systems that support SNMP:

Terminal window
snmpget -v2c -c public server.example.com 1.3.6.1.2.1.1.3.0

Returns sysUpTime in hundredths of a second since the SNMP agent started.

Via Monitoring Tools

The most reliable way to check uptime over time is external monitoring. Server-side commands only show time since last reboot, not actual availability from a user’s perspective. A server can be “up” but unreachable due to network issues, firewall changes, or application crashes.

External uptime monitoring tools check from outside your network, measuring what users actually experience.

Automating Uptime Checks

Cron Job (Linux)

Log uptime every hour:

Terminal window
# Add to crontab -e
0 * * * * echo "$(date): $(uptime)" >> /var/log/uptime.log

Scheduled Task (Windows)

Create a PowerShell script that logs uptime:

Terminal window
$uptime = (Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
"$(Get-Date): Uptime $($uptime.Days)d $($uptime.Hours)h" | Out-File -Append C:\logs\uptime.log

Schedule it with Task Scheduler to run hourly.

Server Uptime vs Service Uptime

Important distinction: server uptime (time since last reboot) is not the same as service uptime (time your application is accessible to users).

Your server can be up for 365 days while your web application crashes multiple times a week. The server uptime command won’t show you those application-level outages.

For true availability monitoring, you need external checks that test your application’s actual endpoints, not just whether the OS is running. Use the uptime calculator to understand what different availability levels mean in practice.


Related tools:

Stay in the loop

Get notified about new posts, product updates, and engineering insights.

Join the waitlist →