Setup WiFi via commandline on Ubuntu Server 24.04 LTS

  • ls /sys/class/net
  • ls /etc/netplan/ (take note on the file name)
  • sudo nano /etc/netplan/50-cloud-init.yaml (assuming file from command above is 50-cloud-init.yaml)
  • Content:
network:
    ethernets:
        eth0:
            ......
    wifis:
        wlp3s0:
            optional: true
            access-points:
                "SSID-NAME-HERE":
                    password: "PASSWORD-HERE"
            dhcp4: true
  • sudo netplan apply (alternatively, sudo netplan –debug apply)
  • ip add

About: author