How to Completely Disable the ‘autofs’ (Automounter) Daemon in Ubuntu Server

The autofs (Automounter) daemon is a background service in Ubuntu Server that automatically mounts remote file systems (like NFS or SMB shares) at the exact moment a user or application attempts to access a specific directory, and automatically unmounts them after a period of inactivity. While highly efficient for large enterprise networks with hundreds of potential mount points, it is completely unnecessary for a standard web server or database node that relies exclusively on local storage or statically defined /etc/fstab mounts. Leaving it running wastes RAM and adds unnecessary complexity to the boot sequence.

This guide explains how to completely disable the autofs daemon in Ubuntu Server.

Stop and Disable the Automounter Daemon

To ensure the server does not waste resources monitoring directories for mount triggers, we must halt the daemon and explicitly mask it via systemd.

  1. Log into your Ubuntu Server via SSH or local console using an account with sudo privileges.
  2. First, stop the active service to immediately halt its directory monitoring:
    sudo systemctl stop autofs.service
  3. Next, disable the service so it does not attempt to initialize during the next system boot:
    sudo systemctl disable autofs.service
  4. To guarantee that no other dependent networking script can accidentally wake the daemon, mask the service unit entirely:
    sudo systemctl mask autofs.service

Verify the Daemon Isolation

By masking the service, you guarantee that the dynamic mounting subsystem is entirely inert, forcing the server to rely strictly on manual or static mounts.

To verify the lockdown is successful, run the following command to check the status of the daemon:

systemctl status autofs.service

The output will clearly state that the service is masked (symlinked to /dev/null) and the Active state will read inactive (dead). If you run ps aux | grep automount, you will confirm that the daemon process is no longer running in the background, confirming that your Ubuntu Server is completely free from unnecessary network-mounting overhead.

Get the best tech tips delivered straight to your inbox.

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