When a program does not start, the server restarted on its own, or something just behaves strangely, the logs usually say why. On Ubuntu, almost everything goes into one log, the journal, which you read with journalctl. The commands were tested on Ubuntu 26.04 LTS; run them as root or with sudo.
1. Errors Since the Last Start
journalctl -p err -b
-p err shows only errors and worse, -b only since the last start of the server. Use the arrow keys and Page Down to scroll, q to quit; --no-pager prints everything at once instead. Not every line is a problem: a freshly installed server shows lines such as
sshd-session[17648]: error: kex_exchange_identification: read: Connection reset by peer systemd-networkd-wait-online[18458]: Timeout occurred while waiting for network connectivity.
The first is a scanner from the internet that closed its connection; the second appears once while the network is starting. Look for errors that repeat, or that appear at the time your problem happened.
2. One Program or Service
journalctl -u ssh journalctl -u qbittorrent-nox@alex --since today journalctl -u nginx -n 50
-u takes the name of the service, as in systemctl status. -n 50 shows the last 50 lines.
3. A Time Range
journalctl --since "10 min ago" journalctl --since "2026-11-27 18:00" --until "2026-11-27 19:00" journalctl --since yesterday -p warning
The times are in the time zone of the server; timedatectl shows it.
4. Watch Live
journalctl -f journalctl -u ssh -f
New lines appear as they happen; stop with Ctrl+C. Handy while you restart a service in another window.
5. Did the Server Restart?
journalctl --list-boots
Every start of the server is one line, with the time of its first and last log entry. journalctl -b -1 shows the log of the previous start: its last lines often tell whether it was a normal shutdown or a crash. For messages of the kernel, such as disk or memory errors:
dmesg --level=err,warn
6. Who Tries to Log In?
journalctl -u ssh --since "-1h" | grep -c -i "failed password\|invalid user"
For example, on a server without a firewall this counts 155 failed logins of bots in one hour, for user names such as ubuntu:
sshd-session[35430]: Failed password for invalid user ubuntu from 198.51.100.7 port 47592 ssh2
That is normal on the internet, but a reason for SSH keys, a firewall and Fail2ban: Protect Your Linux Server With a Firewall and Fail2ban.
7. Space Used by the Logs
journalctl --disk-usage
Ubuntu limits the size of the journal by itself. To free space now, keep only the last two weeks:
journalctl --vacuum-time=2weeks
Asking support for help? Copy the relevant lines as text, for example the output of journalctl -u name --since "30 min ago" --no-pager.