In this tutorial, we will see how to configure the size of systemd logs on an Ubuntu distribution.
By default, the logs located in the /var/log/journal folder can take several gigabytes of disk space.
![](https://rdr-it.io/wp-content/uploads/2022/12/ubuntu-config-size-journal-01-410x400.png)
As can be seen from the screenshot below, the logs take up 4 Giga of disk space.
The configuration of the logs is done in the file /etc/systemd/journald.conf
.
Here is the default file:
![](https://rdr-it.io/wp-content/uploads/2022/12/ubuntu-config-size-journal-02-454x400.png)
Open the file with nano for example:
sudo nano /etc/systemd/journald.conf
Uncomment the SystemMaxUse line and set the desired maximum log size value.
![](https://rdr-it.io/wp-content/uploads/2022/12/ubuntu-config-size-journal-03-600x312.png)
Here I indicated a maximum size of 200 Mo
Close saving changes.
Restart the daemon in charge of the systemd journal:
sudo systemctl restart systemd-journald
After the reboot, we can see that the logs are the size indicated and the rest has been deleted.
![](https://rdr-it.io/wp-content/uploads/2022/12/ubuntu-config-size-journal-04-408x400.png)