How to connect WLAN0 in Ubuntu server?

Seems quite crucial but not straightforward and haven’t seen any applicable examples.
How do you connect to a WPA2 SSID using Ubuntu minimal bionic server ?

Simple search in Google gives:

https://docs.ubuntu.com/core/en/stacks/network/network-manager/docs/configure-wifi-connections

https://help.ubuntu.com/community/WifiDocs/WiFiHowTo