This article provides a guide to enable persistent logging for systemd and journalctl on your Linux VPS or Dedicated Servers.
Why Should We Enable Persistent Logging for Systemd?
Natively, the systemd logs are logged to /run/log/journal by default, which does not support persistent logging. On the one hand, it's nice not to have huge log files eating up all your server storage. On the other hand, these logs definitely won't help if there is any ongoing or recurring issues. The reason for this is that this configuration and storage are rotated frequently, such that the events surrounding an even once-daily server issue wouldn't still be logged by the time of recurrence.
And while, persistent logging of all systemd systems wouldn't be right for everyone, it's definitely nice to know the option exist. So, let's take a look at what this process will be if we wanted to enable persistent storage for systemd/journallctl
Enable Persistent Logging for Systemd/Journalctl
To enable persistent logging for systemd journalctl, follow the steps provided below:
- Login via SSH as root (or root-equivalent) user.
- Run the following commands to setup a suitable storage:
sudo mkdir -p /var/log/journal sudo systemd-tmpfiles --create --prefix /var/log/journal sudo systemctl restart systemd-journald
Now, the logs will persist beyond reboots, which will make it easier to troubleshoot any ongoing issues.
Log Rotation and Compression
With persistent logs, now we will need to manage the log rotation and storage use using the built-in compression and rotation system. These settings are configured from /etc/systemd/journald.conf.
Conclusion
You now know how to enable persistent logging for system/journalctl on Linux VPS or dedicated server.

👀 Choose SSD-powered VPS servers for increased speed, power, and security! Now 50% off- starting from only $3.19/mo.