1 minute read

How to install Ubuntu Server on a Raspberry Pi

This article documents the manual build process I use to commission a new Raspberry Pi running Ubuntu Server

Outline

  1. Physically prepare device
    1. Build device and case as necessary
  2. Prepare Micro SD Card with image
  3. First boot device
  4. First login
  5. Rename default user/group
  6. Rename hostname
  7. Apply updates

Prepare Micro SD Card

  • Steps are documented in (https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi)
    • I typically use an LTS build of Ubuntu Server but choose as required
  • Download Raspberry Pi Imager
  • Follow steps in tool to build image
  • Ensure that the Micro SD is formatted FAT32
    • Not exFAT if on Windows and using larger SDs

First Boot

First Login

  • Connect using ssh unless you have directly connected console
    • May need to check router for IP address of device if no display is attached
  • Username: ubuntu
  • Password: ubuntu
  • Change password when prompted
    • If not prompted run passwd

Rename User

  1. Create a temp user with sudo privileges

     ```bash
     sudo adduser temp
     sudo usermod -aG sudo temp
     ```
    
  2. Log out
  3. Log back in as temp
  4. see rename a user

    Rename Group

  5. Without logging out from temp having renamed the default user now rename the group
  6. Now you can log out and back in with the new username

Rename Host

  • Use hostnamectl to rename host without a reboot

A simple command to update repo list and apply all applicable updates while also cleaning up any old packages

sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove -y

Updated: