Skip to main content

How to uninstall Filebeat on Linux

This guide will walk you through uninstalling the Filebeat agent on Linux.

Written by Alan Butcher

Uninstalling Filebeat

  1. Open a Terminal window.

  2. Stop the Filebeat service using the following command:
    sudo systemctl stop filebeat

  3. Disable the service to prevent it from starting on boot:
    sudo systemctl disable filebeat

  4. Uninstall the Filebeat package:
    sudo apt-get purge filebeat

  5. Remove any residual files and directories:
    sudo rm -rf /etc/filebeat && sudo rm -rf /var/lib/filebeat && sudo rm -rf /var/log/filebeat

Verifying the uninstall is complete

  1. Run the following command and confirm no results are returned:
    dpkg -l | grep filebeat

  2. Run the following command and confirm the service can no longer be found:
    sudo systemctl status filebeat

And that's it! You've successfully uninstalled Filebeat. 🎉

Did this answer your question?