How to Completely Disable ‘ModemManager’ (Cellular Network Daemon) in Ubuntu Server

If you perform a standard installation of Ubuntu Server (or even the desktop edition), the operating system ships with a massive suite of background networking utilities designed to handle every possible hardware configuration. One of these background services is ModemManager. Its sole purpose is to constantly scan the system’s USB ports and serial buses, looking for mobile broadband modems (3G/4G/5G dongles) to connect to cellular networks.

While this is useful for a laptop tethered to a cellular network, it is a significant problem for hardware hackers, robotics engineers, and IoT developers. ModemManager aggressively interrogates any device plugged into a serial port (such as an Arduino, a Raspberry Pi Pico, or a GPS module), assuming it might be a cellular modem. This interrogation sends random AT commands to the device, which can completely crash your microcontroller or corrupt serial data streams. If you are building headless servers or programming hardware over serial/USB connections, you must completely disable ModemManager.

Stopping and Disabling the Service via Systemctl

Because ModemManager is managed by the systemd init system, you can gracefully stop it from running and permanently disable it from starting at boot time.

  1. Open a Terminal session (or connect to your server via SSH).
  2. First, stop the daemon if it is currently running in the background:
    sudo systemctl stop ModemManager.service
  3. Next, permanently disable the service so that it does not automatically launch the next time you reboot the server:
    sudo systemctl disable ModemManager.service

Uninstalling ModemManager Entirely (Recommended)

Because Ubuntu updates can sometimes re-enable disabled services if a dependency demands it, the absolute safest way to protect your serial ports is to purge the software from your hard drive entirely.

  1. In the terminal, run the following command to completely uninstall the package and delete its configuration files:
    sudo apt-get purge modemmanager
  2. Press Y when prompted to confirm the removal.
  3. Clean up any orphaned networking dependencies left behind:
    sudo apt-get autoremove

With ModemManager completely eradicated from the system, Ubuntu will behave like a dumb terminal when you plug in a USB or serial device. It will mount the device at /dev/ttyUSB0 or /dev/ttyACM0 and leave it completely alone, allowing your Arduino sketches and Python scripts to communicate with your hardware without any rogue AT commands crashing the stream.

Get the best tech tips delivered straight to your inbox.

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