Short answer
Run sudo journalctl -u nginx to see one service’s logs (use your service’s name). Add -f to follow new lines, -n 50 for the last 50, -p err for errors only, --since "1 hour ago" for a time window, and -b -1 for the boot before the last reboot. Without sudo, you see nothing from system services.
Tested on Ubuntu 26.04 and 24.04, two separate runs. On 24.04, every step is the same. Everything that differed
The example service
To show every option on the same lines, the test server got a small backup job, backup.service, that prints an info line, a warning and an error, then fails:
#!/bin/shecho "<6>backup started"echo "<4>backup: 2 files skipped"echo "<3>backup failed: disk full"exit 1The <6>, <4> and <3> at the start of each line set its priority (info, warning, error). journald reads that prefix from any service’s output and removes it, so the error is filed as an error. Your own services already log this way, or through syslog with a priority.
Why journalctl shows nothing without sudo
$ journalctl -u backup --no-pagerHint: You are currently not seeing messages from other users and the system. Users in groups 'adm', 'systemd-journal' can see all messages. Pass -q to turn off this notice.-- No entries --A normal user sees only their own messages. The hint names the two groups that may read everything. Use sudo, or add yourself to a group (at the end).
Step 1: One service’s logs
$ sudo journalctl -u backup --no-pagerNov 19 22:51:18 web-server systemd[1]: Starting backup.service - Nightly backup...Nov 19 22:51:18 web-server backup-job[2063]: backup startedNov 19 22:51:18 web-server backup-job[2063]: backup: 2 files skippedNov 19 22:51:18 web-server backup-job[2063]: backup failed: disk fullNov 19 22:51:18 web-server systemd[1]: backup.service: Main process exited, code=exited, status=1/FAILURENov 19 22:51:18 web-server systemd[1]: backup.service: Failed with result 'exit-code'.Nov 19 22:51:18 web-server systemd[1]: Failed to start backup.service - Nightly backup.systemd’s own lines (Starting, exited with status 1, Failed) sit between the program’s lines, so you see what the program said and what systemd did about it. --no-pager prints everything at once; without it, journalctl opens a pager (q to quit, G to jump to the end). The last lines only:
$ sudo journalctl -u backup --no-pager -n 2Nov 19 22:51:18 web-server systemd[1]: backup.service: Failed with result 'exit-code'.Nov 19 22:51:18 web-server systemd[1]: Failed to start backup.service - Nightly backup.Step 2: Follow new lines as they come
-f keeps running and prints each new line, like tail -f; press Ctrl+C to stop. Here it ran for 6 seconds while the job was started again in the background:
$ (sleep 2; sudo systemctl start backup) & sudo timeout 6 journalctl -u backup -f -n 0[1] 2556Job for backup.service failed because the control process exited with error code.See "systemctl status backup.service" and "journalctl -xeu backup.service" for details.Nov 19 22:51:24 web-server systemd[1]: Starting backup.service - Nightly backup...Nov 19 22:51:24 web-server backup-job[2567]: backup startedNov 19 22:51:24 web-server backup-job[2567]: backup: 2 files skippedNov 19 22:51:24 web-server backup-job[2567]: backup failed: disk fullNov 19 22:51:24 web-server systemd[1]: backup.service: Main process exited, code=exited, status=1/FAILURENov 19 22:51:24 web-server systemd[1]: backup.service: Failed with result 'exit-code'.Nov 19 22:51:24 web-server systemd[1]: Failed to start backup.service - Nightly backup.The first lines are the background systemctl start reporting that the job failed; then come the job’s lines as journald received them. -n 0 skips the old lines. In everyday use: sudo journalctl -u backup -f.
Step 3: Only errors, a time window, a word
$ sudo journalctl -u backup -p err --no-pagerNov 19 22:51:18 web-server backup-job[2063]: backup failed: disk fullNov 19 22:51:18 web-server systemd[1]: Failed to start backup.service - Nightly backup.Nov 19 22:51:24 web-server backup-job[2567]: backup failed: disk fullNov 19 22:51:24 web-server systemd[1]: Failed to start backup.service - Nightly backup.-p err shows errors and anything worse; the info and warning lines are gone. -p warning would add the warnings. A time window takes plain words:
$ sudo journalctl -u backup --since "10 min ago" --no-pager | tail -n 3Nov 19 22:51:24 web-server systemd[1]: backup.service: Main process exited, code=exited, status=1/FAILURENov 19 22:51:24 web-server systemd[1]: backup.service: Failed with result 'exit-code'.Nov 19 22:51:24 web-server systemd[1]: Failed to start backup.service - Nightly backup.--since and --until also take today, yesterday or "2026-11-19 21:00". -g searches the message text (a regular expression):
$ sudo journalctl -u backup -g "disk full" --no-pagerNov 19 22:51:18 web-server backup-job[2063]: backup failed: disk fullNov 19 22:51:24 web-server backup-job[2567]: backup failed: disk fullAnd -o cat prints only the messages, handy to copy into a bug report:
$ sudo journalctl -u backup -o cat --no-pager -n 4backup failed: disk fullbackup.service: Main process exited, code=exited, status=1/FAILUREbackup.service: Failed with result 'exit-code'.Failed to start backup.service - Nightly backup.Step 4: Logs from before a reboot
Ubuntu keeps the journal on disk, in /var/log/journal, so it survives a reboot:
$ ls -d /var/log/journal/var/log/journal$ sudo rebootAfter the server is back, list the boots the journal knows:
$ sudo journalctl --list-boots --no-pagerIDX BOOT ID FIRST ENTRY LAST ENTRY -1 ccde594eaff840088ea00e684662f0d3 Thu 2026-11-19 22:51:04 UTC Thu 2026-11-19 22:51:32 UTC 0 114d8eb03fa34ba994f35a320dc921aa Thu 2026-11-19 22:51:36 UTC Thu 2026-11-19 22:51:45 UTC0 is this boot, -1 the one before. -b alone means this boot, where the job has not run yet:
$ sudo journalctl -u backup -b --no-pager-- No entries --$ sudo journalctl -u backup -b -1 --no-pager -n 6Nov 19 22:51:24 web-server backup-job[2567]: backup startedNov 19 22:51:24 web-server backup-job[2567]: backup: 2 files skippedNov 19 22:51:24 web-server backup-job[2567]: backup failed: disk fullNov 19 22:51:24 web-server systemd[1]: backup.service: Main process exited, code=exited, status=1/FAILURENov 19 22:51:24 web-server systemd[1]: backup.service: Failed with result 'exit-code'.Nov 19 22:51:24 web-server systemd[1]: Failed to start backup.service - Nightly backup.The lines from before the reboot are still there. This is how you find out why a server went down: sudo journalctl -b -1 -n 50 shows the last lines it wrote.
Step 5: How much disk the journal uses, and a limit
$ sudo journalctl --disk-usageArchived and active journals take up 16M in the file system.Without a setting, journald picks its own limit from the size of the disk, and a busy service can fill it. Set your own limit in a drop-in file instead of editing journald.conf, so a package update never asks about it:
$ sudo mkdir -p /etc/systemd/journald.conf.d$ sudo tee /etc/systemd/journald.conf.d/size.conf <<'EOF'[Journal]SystemMaxUse=200MEOF[Journal]SystemMaxUse=200M$ sudo systemctl restart systemd-journald$ sudo journalctl -u systemd-journald -b --no-pager | grep -m 1 -i "max 200"Nov 19 22:51:47 web-server systemd-journald[2017]: System Journal (/var/log/journal/d1a1e42b92c742d58506c03f78260355) is 16M, max 200M, 183.9M free.journald’s own start line confirms the new maximum. Older entries go first when it is reached. To delete old entries now, by age (or --vacuum-size=100M by size):
$ sudo journalctl --vacuum-time=2weeksVacuuming done, freed 0B of archived journals from /var/log/journal.Vacuuming done, freed 0B of archived journals from /run/log/journal.Vacuuming done, freed 0B of archived journals from /var/log/journal/d1a1e42b92c742d58506c03f78260355.On a fresh server nothing is old enough yet, so it freed 0 bytes.
Read the journal without sudo
Add your user to systemd-journal, one of the two groups the hint names (it gives read-only access to every log). Log out and in again for the group to apply:
$ sudo usermod -aG systemd-journal deploy$ id -nGdeploy sudo users systemd-journal$ journalctl -u backup -b -1 -g "disk full" --no-pagerNov 19 22:51:18 web-server backup-job[2063]: backup failed: disk fullNov 19 22:51:24 web-server backup-job[2567]: backup failed: disk fullThe configuration files, ready to copy
The drop-in as it was on the test server once journald had applied it.
[Journal]SystemMaxUse=200MRead back from the test server (Ubuntu 26.04) on 2026-11-19, after the steps had worked. Placeholders such as [password]: type your own value in the box above the file to fill them in, or replace them yourself.
Troubleshooting
- “Hint: You are currently not seeing messages from other users and the system”: use
sudo, or joinsystemd-journal. Details. -- No entries --: wrong unit name (check withsystemctl list-units --type=service), or the service has not logged in this boot; try without-b, or-b -1. Details.- The logs from before a reboot are gone: the journal was kept in memory only;
/var/log/journalmust exist (it does on Ubuntu). Details. - The journal takes too much disk: set
SystemMaxUse=in a drop-in and vacuum. Details.
What these steps changed on the server
Both runs recorded the server before the first step and after the last (see the Tested on box below): the size drop-in in /etc/systemd/journald.conf.d/ and the group change for deploy. Nothing was installed.
Ubuntu 26.04 vs 24.04
The same check ran on a fresh 26.04 server and on a fresh 24.04 server, each with its own run log. Every command printed the same lines; only small details differed:
| What | Ubuntu 26.04 | Ubuntu 24.04 |
|---|---|---|
| System | Ubuntu 26.04.1 LTS7.0.0-43-generic | Ubuntu 24.04.5 LTS6.8.0-147-generic |
| systemd | 259.9-0ubuntu0.1 | 255.4-1ubuntu8.18 |
| journald’s start line with the 200M limit | max 200M | max 200.0M |
Journal size on a fresh server (--disk-usage) | 16M | 22.8M |
| Proof | Run log, 25 checks passed | Run log, 25 checks passed |
