Deploying a server based on Ubuntu Server Without Ethernet connectivity, this is a scenario many system administrators face when working with remote sites or specialized equipment. Unlike desktop versions of the operating system, the server edition lacks a graphical interface for selecting wireless networks, requiring knowledge of the command line and network configuration tools.
Modern distributions such as Ubuntu 22.04 And Ubuntu 24.04, use the system Netplan as the main backend for network configuration, replacing the good old /etc/network/interfacesHowever, working with Wi-Fi often requires installing additional packages, as the server is wired by default. The connection process involves installing a network manager, searching for available access points, and correctly configuring the YAML configuration.
Incorrect configuration file syntax can lead to complete loss of network access, so it's important to carefully check indentations and parameters before applying changes. In this article, we'll cover in detail how to install the required components, configure a connection via the command line, and ensure stable operation of the wireless interface in a production environment.
⚠️ Attention: When setting up a remote server via SSH, any change to network settings can break the current connection. If you make a configuration error, you may lose access to the server until you physically gain access to the console.
Checking hardware and installing drivers
The first step before attempting to set up a connection is to physically check the presence of a wireless adapter and its compatibility with the operating system. Many modern Wi-Fi modules require proprietary drivers, which are not included in the standard Linux kernel package set by default due to licensing restrictions.
First, you need to determine whether the system can detect the installed hardware. Use the utility lshw or lspci to get a list of connected devices. If the adapter shows as "UNCLAIMED," this is a sure sign that the driver for it is not installed.
In some cases, you may need to connect the server to the internet via a USB modem or a temporary Ethernet cable connection to download missing packages. Without initial access to the repositories, driver installation will be impossible.
- 📡 Use the command
lshw -C networkto obtain detailed information about network interfaces and their status. - 🔍 Check for the presence of interfaces of the type wlan0 or wlp2s0 using the command
ip link. - 📦 Make sure the package
linux-firmwareUpdated to the latest version to support the latest hardware.
After confirming the hardware and installing the necessary drivers (if required), the system should correctly display the wireless interface. Only then can you proceed to installing the connection management software.
Installing and configuring Network Manager
Although Netplan is the standard for Ubuntu Server, it often works in conjunction with NetworkManager for managing wireless connections, especially in versions 20.04 and later. Installing this component significantly simplifies the process of scanning networks and entering passwords, eliminating the need to manually encrypt security keys.
To install, update your package lists and install the necessary software. During installation, the system may prompt you to select a display manager, but for the server version, this isn't critical. You can leave the default selection or skip this step if it arises in minimalist builds.
sudo apt update
sudo apt install network-manager
After installing the service, you need to ensure it's started and running correctly. You can check the service's status via systemd, and if it's stopped, you can restart it. This is an important step, as without an active service, all subsequent scanning and connection commands will fail.
Searching for networks and connecting to Wi-Fi
Now that the software is ready, it's time to find available wireless networks within range of the server. To do this, use the utility nmcli, which is a command shell for NetworkManager. It allows you to perform all necessary actions without a graphical interface.
First, you need to enable Wi-Fi, as it's often disabled by default on servers for resource conservation or security reasons. Once enabled, you can scan the surrounding airwaves. The result will be a list of available SSIDs, along with their signal strength and security type.
nmcli radio wifi on
nmcli dev wifi list
Find your network name (SSID) in the list. Pay attention to the SIGNAL column: the higher the value, the more stable the connection will be. If your network is hidden (Hidden SSID), it won't appear in the list, and you'll have to connect manually by entering the network name.
☑️ Check before connection
To connect, use the command with the network name and password. The system will automatically detect the encryption type (WPA2/WPA3) and attempt to obtain an IP address via DHCP. If successful, the interface will receive an address, and the server will become accessible on the local network.
Setting up a static IP address via Netplan
For server infrastructure, using a dynamic IP address (DHCP) is often undesirable, as the address may change after a reboot or lease expiration. Setting up a static IP ensures a consistent address, which is necessary for port forwarding, DNS configuration, and remote access.
Network configuration in modern versions of Ubuntu is stored in files with the extension .yaml in the directory /etc/netplan/. The file name may differ (for example, 00-installer-config.yaml or 50-cloud-init.yaml), so it is important to find the current file in this folder.
Open the file for editing. Note that YAML is indentation-sensitive: use only spaces, no tabs. The file structure should clearly indicate the renderer version and interface-specific parameters.
| Parameter | Description | Example of meaning |
|---|---|---|
| renderer | Backend for network management | networkd |
| addresses | Static IP and mask | 192.168.1.50/24 |
| gateway4 | Default gateway (for older versions) | 192.168.1.1 |
| nameservers | DNS servers | 8.8.8.8, 1.1.1.1 |
Below is an example of a correct configuration for the wireless interface. wlan0. Please pay attention to the indentation and nesting structure. In newer versions of Ubuntu (24.04+), the parameter gateway4 can be replaced by routes, but for compatibility purposes, proven syntactic constructs are often used.
network:version: 2
renderer: networkd
wifis:
wlan0:
dhcp4: no
addresses: [192.168.1.50/24]
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
access-points:
"MyHomeWiFi":
password: "StrongPassword123"
After making changes, you need to apply the configuration. First, check the file for syntax errors, then apply the settings. If there are no errors, the network will reconnect with the new settings.
sudo netplan try
sudo netplan apply
What to do if netplan gives an error?
If an error occurs when applying the configuration, check the indentation in the YAML file. The problem is often caused by extra spaces or the use of tabs instead of spaces. Also, make sure the interface name (wlan0) matches the actual device name in the system.
Diagnostics and problem solving
Even with the correct settings, connection issues may still occur. Common causes include incompatible security standards or driver errors. If the connection fails, the first step is to check the system logs.
Use the command journalctl to view events related to network services. Filter by word wifi or network This will help you quickly identify the cause of the failure. It's also helpful to check whether your firewall (UFW) is blocking outgoing or incoming connections.
- 📉 Check your signal strength: a weak signal can lead to constant connection drops.
- 🔑 Make sure the password is correct: case sensitivity in WPA2/WPA3 often causes errors.
- 🛡️ Check your router settings: MAC address filtering may be enabled and your server may not be whitelisted.
⚠️ Attention: Command line interfaces and package names may change with the release of new Ubuntu versions. Always consult the official Canonical documentation if the standard commands don't work.
In some cases, restarting the network service or a full system reboot helps. If the problem persists, try temporarily disabling WPA3 security on your router and using WPA2, as older adapters may not support newer encryption standards.
Frequently Asked Questions (FAQ)
How do I save a Wi-Fi password in plain text in the config file?
In Netplan files, the password is specified in the field password inside the block access-pointsFor increased security, you can use a hashed password, but for most server tasks, it is sufficient to restrict access to the configuration file by rights. chmod 600.
Why doesn't the server see the 5 GHz Wi-Fi network?
This may be due to the regional settings of the wireless module. The default region may be set to a region where some 5 GHz channels are prohibited. Change the region using the command sudo iw reg set US (or your country code) to unlock all channels.
Can I use Ubuntu Server without Network Manager?
Yes, you can configure Wi-Fi exclusively through wpa_supplicant And systemd-networkd, however, this requires creating complex configuration files and manually managing encryption keys, which is much more difficult for a beginner.
How can I make Wi-Fi turn on during boot?
If configured correctly via Netplan or Network Manager and the corresponding services are enabled (systemctl enable NetworkManager), the connection will be established automatically at system startup without user intervention.