With a headless server Ubuntu makes it easy to manage all network connections via network manager (nmtui interface). Configuring a wireless LAN adapter requires more configuration than a wired LAN as an SSID / key must be specified.
List Saved Wifi Connections:
List available Wifi Hotspots:
nmcli d wifi list
Just change <WifiInterface>, <WiFiSSID>, <WiFiPassword>in the following commands to reflect your setup. If WiFi info already saved, easier way using <SavedWiFiConn> name of connection as it was saved in NetworkManager.
Using Network Manager CLI to connect to a specific Wifi network:
nmcli d disconnect <WifiInterface>
nmcli d connect <WifiInterface>