Linux Error: 'Failed to start Network Manager' — no network after netplan apply, Cause, Fix, and Troubleshooting Guide
Fix no network after netplan on Ubuntu: 'Failed to start Network Manager', invalid YAML indentation, wrong renderer (networkd vs NetworkManager), wrong interface names.
- #linux
- #troubleshooting
- #networking
- #netplan
Stuck on this Linux Admins error? Get the free incident triage checklist
A one-page PDF — the exact steps to isolate, fix, and verify a production error like this one. No spam, unsubscribe anytime.
What this error means
You apply a netplan change on Ubuntu and the host drops off the network. netplan apply may print a YAML or renderer error, or the box comes back with no address at all:
$ sudo netplan apply
/etc/netplan/01-netcfg.yaml:8:5: Invalid YAML: inconsistent indentation
Failed to start Network Manager
Netplan is a front-end, not a network stack. It reads YAML from /etc/netplan/*.yaml and renders backend config for one of two renderers: systemd-networkd (the server default) or NetworkManager (the desktop default). When the YAML is malformed, the interface name is wrong, or the renderer: points at a backend that is not installed or running, netplan generates broken (or no) config and the interface never comes up.
Because a bad apply can cut your own SSH session, netplan ships netplan try, which applies the change and automatically rolls back after a timeout unless you confirm — always prefer it on a remote host.
How it manifests on the host
sudo netplan applyerrors withInvalid YAML,inconsistent indentation, orunknown key.Failed to start Network Manager/Failed to start systemd-networkdin the output orjournalctl.ip ashows the interfaceDOWNor with no IPv4 address after apply.ip routehas nodefaultroute, so nothing routes off-subnet.- The host is reachable on the console but not over SSH; a remote apply killed connectivity.
systemctl status systemd-networkdorNetworkManagerisinactive/failed.
System configuration causes
- Invalid YAML indentation. Netplan YAML is indentation-sensitive and requires spaces (never tabs). A misaligned key or a stray tab makes the whole file unparseable.
- Wrong
renderer:. The file saysrenderer: NetworkManageron a server where NetworkManager is not installed (orrenderer: networkdwheresystemd-networkdis masked), so there is no backend to bring the link up. - Wrong interface name. The config names
eth0but the NIC is actuallyens3/enp0s3(predictable interface names). Netplan renders config for an interface that does not exist. - Missing
dhcp4:/addresses:— the interface is defined but given no addressing, so it comes up with no IP. - Wrong file permissions or a stray file. A world-readable secret warning, or a second
*.yamlin/etc/netplan/with conflicting keys, produces unexpected merged config. addresses:without a CIDR prefix (e.g.10.0.0.5instead of10.0.0.5/24), which netplan rejects.
Interrogating the host
Do this from the console (or a session you can afford to lose), not the SSH link you are about to reconfigure.
-
See what addressing and links actually exist right now:
ip a ip routeNote the real interface names here — they must match the YAML.
-
Validate that netplan can parse and render the YAML without applying it:
sudo netplan generateThis writes backend config and surfaces YAML/indentation errors without touching the live network.
-
Get verbose detail on exactly which key/line fails:
sudo netplan --debug apply 2>&1 | less -
Confirm which backend is expected and whether it is running:
systemctl status systemd-networkd systemctl status NetworkManager networkctl status # networkd view of each link -
Inspect the config itself (spaces only, correct nesting):
sudo cat /etc/netplan/*.yaml
Remediation
-
Test safely with automatic rollback — this is the correct way to apply a risky change remotely. Netplan reverts after ~120s unless you press Enter to confirm:
sudo netplan try -
Fix the YAML. Use spaces (2-space steps), never tabs, and give addresses a CIDR prefix. A minimal, valid static config for the
systemd-networkdrenderer:network: version: 2 renderer: networkd ethernets: ens3: dhcp4: false addresses: - 10.0.0.5/24 routes: - to: default via: 10.0.0.1 nameservers: addresses: [10.0.0.2, 1.1.1.1]Replace
ens3with the interface name fromip a. -
Match the renderer to what is installed. On a headless server use
renderer: networkdand make sure the service is enabled:sudo systemctl enable --now systemd-networkdIf you truly want NetworkManager, install and enable it before selecting it:
sudo apt-get install -y network-manager sudo systemctl enable --now NetworkManager -
Correct the interface name in the YAML to the real device from
ip a(e.g.ens3,enp0s3,eth0). A DHCP-only interface is simply:network: version: 2 renderer: networkd ethernets: ens3: dhcp4: true -
Regenerate and apply once the file validates:
sudo netplan generate sudo netplan applyWarning:
netplan applytakes effect immediately and can drop your SSH session on a bad config. Prefernetplan tryfor remote hosts, and keep console/out-of-band access available.
Hardening the host
- Tabs break netplan. YAML forbids tabs for indentation — if your editor inserted one, apply fails with an indentation error even though the file “looks” right.
addresses:needs a CIDR prefix (/24,/32, etc.). A bare IP is rejected.- Interface names are not always
eth0. Cloud and modern hardware use predictable names likeens3/enp0s3. Always copy the name fromip a. - A
netplan applyon a live remote box is risky. Usenetplan tryso a mistake auto-reverts instead of locking you out. - Multiple files in
/etc/netplan/merge. A leftover50-cloud-init.yamlcan override your file; check every*.yamlpresent. - Netplan warns if a config file is world-readable and contains secrets — set
sudo chmod 600 /etc/netplan/*.yaml.
Related system errors
- Linux Error: Network is unreachable
- Linux Error: Temporary failure in name resolution
- Configuring Static and Dynamic Networking with systemd-networkd
Want faster Linux incident response? Use DevOps AI Toolkit to turn production errors into clear diagnostics, remediation steps, and reusable runbooks.
Fixed it? Get 500 Linux Admins & DevOps AI prompts — free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.
Did this fix your issue?
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.