How to Set Up WiFi in Ubuntu: A Complete Guide

operating system Ubuntu Linux has long established itself as a reliable platform, but initial wireless connection setup often raises questions for beginners. Unlike Windows, where drivers are often installed automatically from a vast database, Linux distributions sometimes require manual intervention, especially if you have new or rare hardware. Understanding how network interfaces work in this environment will allow you to quickly troubleshoot issues and ensure stable access to the global network.

The process of activating the module may vary depending on the version of the distribution and the type of graphical shell, whether it is standard GNOME, KDE Plasma or XFCEModern versions of the system, such as Ubuntu 22.04 LTS or 24.04, are equipped with an advanced network manager, which in most cases recognizes the adapter immediately. However, if the connection indicator doesn't light up immediately after installation, don't panic: this is a solvable problem that requires several steps.

In this article, we'll cover all aspects of connection, from simple activation via the graphical interface to using the terminal for more complex setups. You'll learn how to check driver status, install missing packages, and configure a static address if your router's DHCP server isn't working properly. The key to success is having at least temporary internet access via an Ethernet cable or USB modem, which will allow the system to download the necessary components.

Checking for the presence of a wireless adapter

The first step before any manipulation should be hardware diagnostics. You need to ensure that the operating system even sees your physical device. It's often the case that the module is disabled at the BIOS/UEFI level or blocked by software switches. For detailed information about connected PCI devices, use the utility lspci, and for USB adapters - lsusb.

Launch the terminal and enter the command lspci | grep -i networkIf your controller appears in the list, it means the system has detected the hardware. For external USB dongles, use lsusbIf a device isn't listed, it may indicate a physical malfunction or that it's disabled in the motherboard settings. It's also worth checking whether Airplane Mode, which blocks all radio modules, is enabled.

For a more detailed analysis of the state of wireless interfaces in Linux, there is a specialized utility iwconfig or more modern ip link. Team ip link show will list all network interfaces. Wireless adapters usually have names starting with wl or w, followed by a set of characters. If the interface is present but marked as DOWN, it must be activated.

Why might the adapter not be detected?

If lspci doesn't detect the device, try rebooting with the power cable disconnected (to completely discharge static electricity). On some laptops, removing the battery for 10-15 seconds helps.

Installing and checking drivers

The most common reason for a lack of connection is the lack of proprietary drivers. Ubuntu has a convenient mechanism for searching and installing additional drivers that automates this process. To access it, open the Applications menu and search for the utility. Software & Updates (Programs and updates). You are interested in the tab Additional Drivers.

The system will search for available drivers for your hardware. If a recommended driver (often labeled as recommended), select it and click the "Apply Changes" button. The process will take a few minutes, after which a reboot will be required. In some cases, especially with adapters Broadcom or Realtek, you may need a cable internet connection to download packages.

  • 📡 Broadcom: often requires a package bcmwl-kernel-source.
  • 🔌 Realtek: popular models need a package rtlwifi-new-dkms.
  • 💻 Intel: usually work out of the box, but may require a kernel update.
  • 📶 MediaTek: New models may require manual compilation of modules.

If the automatic search does not yield results, you can use the terminal. Command sudo ubuntu-drivers autoinstall will attempt to install all recommended drivers automatically. This is a safe method suitable for most users. After installation is complete, be sure to reboot the system with the command sudo reboot.

☑️ Checking drivers

Completed: 0 / 4

Connection via graphical interface

In modern desktop environments such as GNOMENetwork management is as simple as possible. In the upper right corner of the screen is the system tray, where you'll see a network icon (usually two triangles or a computer). Clicking it opens a menu of available access points. If the list is empty, make sure the WiFi switch is enabled.

Select your network from the list. If it's password-protected, an entry window will appear. After entering the security key, the system will attempt to obtain an IP address automatically. A successful connection is indicated by the appearance of a signal strength icon and possibly a "Connected" pop-up notification. For hidden networks, select "Connect to Hidden Network" and manually enter the name (SSID).

Parameter Default value Description
IPv4 Method Automatic (DHCP) Automatic address acquisition
Privacy Default Using a random MAC address
MTU Automatic Package size (usually 1500)
DNS Automatic Name server addresses

For more detailed settings, click the gear icon next to the network name or select "Network Settings." Here you can set a static IP address if your local network configuration requires it. This section also includes the option to change the MAC address to a random one to increase privacy when connecting to public hotspots.

📊 Which Ubuntu interface are you using?
GNOME (standard)
KDE Plasma
XFCE
Cinnamon
MATE

Setting up WiFi via the terminal

For server versions of Ubuntu or when the graphical shell crashes, use the utility nmcli (Network Manager Command Line Interface). It provides complete control over network connections. First, scan for available networks with the command nmcli dev wifi listIt will show a list of access points, their channels, signal strength, and security status.

To connect to the selected network, use the command, substituting your network name and password. The syntax is as follows:

nmcli dev wifi connect "Network_Name" password "Your_Password"

If the network is hidden, add a flag hidden yesOnce the command is successfully executed, the interface will receive an IP address and become active. You can check the status with the command nmcli connection show --activeThis method is especially useful when the GUI freezes or does not display available points.

⚠️ Attention: When entering your password in the terminal, make sure your keyboard layout is set to English, as special characters may be interpreted incorrectly by the shell. If your password contains special characters, it's best to enclose it in single quotation marks.

Troubleshooting connection issues

Even with the correct settings, conflicts can still occur. A common issue is address conflicts or incorrect DNS settings. If you have a connection but pages aren't loading, try specifying public DNS servers, such as Google's (8.8.8.8) or Cloudflare (1.1.1.1). This can be done in the IPv4 graphical settings or through nmcli.

Another common cause of unstable performance is aggressive power saving. The system may disable the WiFi adapter to conserve battery power, which leads to connection drops. To disable this feature, you need to edit the configuration file. Create or open the file /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf.

In this file you need to change the parameter wifi.powersave for meaning 2 (which means turning off power saving). By default, it may say 3After making changes, restart the network service with the command sudo systemctl restart NetworkManagerThis often solves the problem of the network "disappearing" after certain periods of time.

Setting up a static IP address

Corporate networks or access to network printers and NAS often require a fixed IP address. Dynamic addressing is convenient, but it doesn't guarantee that the device's address won't change after a router reboot. To set up a static IP address in Ubuntu 20.04 and later, use the configuration Netplan.

Netplan configuration files are located in the directory /etc/netplan/ and have an extension .yamlBe extremely careful when editing: indentation in YAML files is critical. First, find the name of your interface (e.g., wlp2s0) via command ip addr. Then create a backup copy of the configuration file.

sudo cp /etc/netplan/01-network-manager-all.yaml /etc/netplan/01-network-manager-all.yaml.bak

Open the file for editing and add the addresses section, gateway4 (for older versions) or routes (for newer versions), and nameservers. Example configuration for a static IP:

network:

version: 2

renderer: NetworkManager

ethernets:

wlp2s0:

addresses:

- 192.168.1.50/24

routes:

- to: default

via: 192.168.1.1

nameservers:

addresses: [8.8.8.8, 1.1.1.1]

After making changes, apply the configuration with the command sudo netplan applyIf the syntax is correct, the connection will be restarted with the new parameters. If an error occurs, the network may be disconnected, so have console access or a cable handy.

⚠️ Attention: Network driver interfaces and configuration file names may vary slightly depending on the Ubuntu version and the installed shell type. Always check the latest documentation for your specific distribution version before making system changes.

Frequently Asked Questions (FAQ)

Why doesn't Ubuntu see my WiFi adapter after installation?

Most likely, a proprietary driver is missing. Check the "Additional Drivers" tab in the settings or use the command sudo ubuntu-drivers autoinstall. Also make sure that the adapter is not blocked by the command rfkill list.

How to reset network settings in Ubuntu?

To reset, you can delete saved connections. In the terminal, run nmcli connection delete "Network_Name"To completely reset Network Manager, you can delete the configuration files in /etc/NetworkManager/system-connections/ and restart the service.

Is it possible to share WiFi from an Ubuntu laptop?

Yes, there's a "Hotspot" tab in the network settings. Select it and set a name and password. This will turn your laptop into a router for sharing internet from a wired connection or another adapter.

What to do if WiFi keeps disconnecting?

Try disabling power saving for WiFi (option wifi.powersave). Also check the system logs with the command dmesg | grep wifi Check for driver errors. Sometimes updating the system kernel helps.