How to disable NetworkManager in AlmaLinux 8

Installing network-scripts

To disable NetworkManager on Rocky Linux 8, we need to install the network-scripts package which provides legacy support to the network service,

yum install network-scripts

Enable the service to start onboot,

systemctl enable network

Next, we add NM_Controlled=no to the interface config file,

nano /etc/sysconfig/network-scripts/ifcfg-<interface>

Replace with the interface name from ifconfig -a (or) ipaddr, for example in our case the interface is ens3

nano /etc/sysconfig/network-scripts/ifcfg-ens3

Add the following line to the last line of the ifcfg-ens3 config file,

NM_CONTROLLED="no"

Next, Stop and Disable the NetworkManager service,

systemctl stop NetworkManager

systemctl disable NetworkManager

Restart the network now via the "network" service,

service network restart

At this point, you will see the following information,

[root@server ~]# service network restart
Restarting network (via systemctl):                        [  OK  ]

Enable the network service to start onboot,

systemctl enable network

After which you should get the following output,

[root@server ~]# systemctl enable network
network.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable network

You may reboot your VPS to test if the network comes alive on it's own via the Network service automatically onboot.

Done!