How to Completely Disable ‘Core Dumps’ (Crash Logs) in Ubuntu Linux

In Ubuntu Linux, whenever a software application crashes due to a segmentation fault or an unhandled exception, the operating system’s kernel steps in to perform an autopsy. By default, the kernel takes a complete snapshot of the application’s working memory at the exact moment of the crash and writes it to a file on your hard drive. This file is called a “core dump,” and it is managed by the systemd-coredump daemon.

While core dumps are absolutely essential for C/C++ developers debugging memory leaks, they are a massive liability on production servers. If a database process or a web server crashes, the resulting core dump file can easily exceed several gigabytes in size, rapidly filling up your root partition. Worse, these memory snapshots often contain highly sensitive data—including plaintext passwords, cryptographic keys, and user session tokens—sitting unencrypted on your hard drive. If you are not actively debugging custom software, you must completely disable core dumps to save disk space and harden your server’s security.

Disabling Core Dumps via Systemd Limits

The most effective way to kill this behavior on a modern Ubuntu system is to configure the systemd limits to violently reject the creation of the dump file.

  1. Open a Terminal session (or connect to your server via SSH).
  2. You need to edit the global security limits configuration file. Open it with root privileges:
    sudo nano /etc/security/limits.conf
  3. Scroll to the absolute bottom of the file and paste the following two lines:
    * hard core 0
    * soft core 0
  4. Save the file (Ctrl + O, then Enter) and exit (Ctrl + X).

Disabling the Systemd Coredump Daemon

To ensure systemd itself doesn’t attempt to intercept and log the crash data, you should override its internal configuration.

  1. Open the systemd coredump configuration file:
    sudo nano /etc/systemd/coredump.conf
  2. Scroll down the file until you find the [Coredump] section.
  3. Look for the line that says Storage=external (it might be commented out with a hash).
  4. Change that line to exactly:
    Storage=none
  5. Add a new line directly below it:
    ProcessSizeMax=0
  6. Save the file and exit the text editor.
  7. Finally, force systemd to reload its configuration to apply the changes immediately:
    sudo systemctl daemon-reload

Your Ubuntu server will no longer write crash data to the disk. The next time a background service violently crashes, the kernel will simply terminate the process and write a brief, standard error message to the system log (journalctl), completely bypassing the massive memory dump process.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.