This is about how to install an Ubuntu Server instance on a RPi.
– Download Ubuntu Server from here
– Use Raspberry Pi Imager to copy the image to SD-Card

You can then either boot straight to your RPi or edit some configuration beforehand.

1. Preparing network on the SD-Card first:
– To connect to LAN,  edit the `network-config` file from the `system-boot` partition and add/uncomment to get a configuration:

ethernets:
  eth0:
    addresses:
      - 192.168.0.20/24
    gateway4: 192.168.0.1
    nameservers:
        search: [mydomain,otherdomain]
        addresses: [192.168.0.1, 8.8.8.8]

– To connect to wifi, edit the `network-config` file from the `system-boot` partition and add/uncomment to get a configuration:

wifis:
  wlan0:
    dhcp4: true
    optional: true
    access-points:
      "mywifi":
        password: "123456789"

Above will setup a DHCP assigned IP. I need to use a static IP address, therefore using:

wifis:
  wlan0:
    dhcp4: no
    addresses: [192.168.0.21/24]
gateway4: 192.168.0.1
nameservers:
addresses: [192.168.0.1, 8.8.8.8] optional: true access-points: "mywifi": password: "123456789"

Important Note: you need double-quotes surrounding both SSID and password.
– You can un-mount the SD-Card and boot your RPi

2. Configuring the network after first boot:

– You can un-mount the SD-Card and boot your RPi
– Use a USB keyboard
– It will take some time to let you login with the default credentials ubuntu/ubuntu. Give it some time then try and login again
– Check the wireless LAN device name: 

ls /etc/netplan/

– It’ll list all network interfaces. Take note of the ETH or WLAN interface name.
– Edit the ‘/etc/netplan/50-cloud-init.yaml’ file:
example for wifi:

wifis:
    wlan0:
        dhcp4: no
        addresses:
            - 192.168.0.21/24
        gateway4: 192.168.0.1
        nameservers:
            addresses: [8.8.8.8]
        optional: true
        access-points:
            "mywifi":
                password: "123456789"

– You should be able to start netplan

sudo netplan apply

but I had errors on my RPi 3. I rebooted and everything was fine.
– You can now SSH to the RPi
– Login username and password are both `ubuntu`. Change the password at the first login
– If you couldn’t SSH, possibly the network configuration is not correct (space and indentation is important)

  • Connect a monitor and a keyboard
  • Login to the RPi
  • Type `ls /etc/netplan`. This will tell you which configuration is used
  • Edit the file accordingly
  • Save
  • Type `sudo netplan apply`

– At this date, WIFI password is not encrypted
– Set the hostname with `sudo hostnamectl set-hostname new-name`
– Add it to `/etc/hosts` file

echo "127.0.0.1 new-name" | sudo tee -a /etc/hosts

– Run all updates if needed: `sudo apt update && sudo apt upgrade -y`
– Update locale:

sudo update-locale LANG="en_US.UTF-8" LANGUAGE="en_US"
sudo dpkg-reconfigure --frontend noninteractive locales
  • Update the timezone
    sudo timedatectl set-timezone "Asia/Bangkok"
    sudo dpkg-reconfigure --frontend noninteractive tzdata

Additional settings

If you plan to use your RPi and programmatically access the UART on /dev/serial0 you need a few more steps:

  • edit /boot/firmware/config.txt and make sure you see the
    enable_uart=1
    line under the [all] section (should be there for Ubuntu Core 20.04
  • edit /boot/firmware/cmdline.txt and remove
    console=serial0,115200
    from the line.

2 Replies to “Installing Ubuntu Server 20.10 on RPi”

Comments are closed.