How to Install and Use nmcli in Ubuntu (Complete Guide)

How to Install and Use nmcli in Ubuntu, If you’ve ever had to set up or fix a network on Ubuntu without a nice little Wi-Fi icon in the corner, you’ve probably wished there was a quick terminal trick for it. That’s where nmcli comes in. It’s short for Network Management Command-Line Interface and, honestly, it’s way more capable than it looks at first.
Think of it as the command-line cousin of those graphical network tools (like nm-applet), but without the bloat. In this walkthrough, I’ll show you how to install it, use it, and maybe even like it. And if you don’t have a machine to play with, you could always spin up an Ubuntu VPS instant setup, ready to break and fix as much as you want.
A few weeks ago, my Ubuntu VPS lost network access after a reboot. Using nmcli dev status, I quickly saw that my Ethernet was disconnected and brought it back up in seconds.
How to Install and Use nmcli in Ubuntu
nmcli is a command-line tool used for managing Network Manager in Ubuntu. It provides a convenient way to configure and manage network connections in a terminal environment. In the rest of this article, you will learn how to use and install nmcli in Ubuntu, step by step.
General nmcli Commands in Ubuntu
A) Status: This indicates the status of the network manager.
B) Hostname: This command views and modifies the server hostname.
C) Permissions: This command shows the user permissions to apply a procedure.
D) Logging: This command views and modifies logging levels.
How to Install nmcli in Ubuntu Step by Step
Before doing anything, update the system with the help of the following command:
sudo apt-get update sudo apt-get upgrade
Install nmcli with the following command:
sudo apt install network-manager
When prompted, type “Yes” to continue. Enter the following command to start Network Manager:
sudo systemctl start NetworkManager.service
Check the status of the Network Manager with the following command:
sudo systemctl status network-manager
Network Manager will enable to start working, using below code:
sudo systemctl enable NetworkManager.service
How to Use nmcli in Ubuntu for Network Management
Use nmcli for general functions with the below command:
nmcli general status
Check the hostname:
nmcli general hostname
To check the permissions granted by the network manager, run the following command:
nmcli general permissions
Control the radio transmission and check the wifi status using the following command:
nmcli radio wifi
Use the following command to monitor the changes in various aspects such as connection status:
nmcli monitor
If you make changes to the backend of the network settings, they will be displayed. Network settings are managed using the nmcli command. In Linux ubuntu configuration with wireless devices is considered connections. To display all connections, you must enter the following command:
nmcli connection show
Check the status of the device by running the nmcli command:
sudo nmcli dev status
You can see more functions of the nmcli command and then a brief list will be available in Ubuntu:
man nmcli
Conclusion: Mastering nmcli in Ubuntu
Honestly, nmcli isn’t the kind of tool you fall in love with at first sight it’s just a bunch of commands in a black window. But give it a couple of tries and you’ll see how handy it is. One minute you’re checking your Wi-Fi status, the next you’re switching networks or fixing a bad config, all without touching a single button.
If you’re running Ubuntu on a VPS, trust me, having nmcli in your toolkit saves a ton of headaches. No mouse, no menus just you and the terminal. And once you get used to it, you won’t want to go back.
Yes, the nmcli tool is designed for exactly that. This tool allows you to configure all network settings directly from the terminal, without the need for graphical interfaces such as nm-applet. For VPS servers or environments where there is no graphical access, nmcli is the ideal choice.
If you are working with a Linux server (such as an Ubuntu VPS) or need a quick and accurate way to check or change network settings, using nmcli is highly recommended. This tool is especially useful for system administrators and power users.
Just run the nmcli general status command. This command displays the general status of the network. You can also check the exact status of each network card (Wi-Fi, Ethernet, etc.) with nmcli dev status.
You might like it