Build your first image

This tutorial will guide you through the steps required to create your own Ubuntu Core image, with your own selection of snaps, and install it on a Raspberry Pi.

This same process can be used to build Ubuntu Core images for various hardware and devices.

Requirements

In addition to having a basic understanding of Linux and running commands from the terminal, this tutorial has hardware requirements.

Create an Ubuntu One account

Before you can use Ubuntu Core, build or sign an image, or publish a snap, you will need to create an Ubuntu One account, supply it with Snapcraft credentials, and retrieve the developer account ID.

Ubuntu One is a single sign-on service (SSO) for Ubuntu and its affiliated projects, including snapcraft.io, the central resource for all snap-related publishing.

See the details on how to create an account, login, and retrieve your developer account details.

Create the model assertion

A model assertion is a signed recipe that describes the components that comprise a complete image at the heart of a custom Ubuntu Core.

Sign the model assertion

Learn how to sign a model with a GPG key to make it into a model assertion.

  • Create a key

    Use snapcraft to create a key that will be used across all models or model families.

  • Register the key

    Upload the key and register it with your Ubuntu One account by using register-key command. After creating the key, update the timestamp in my-model.json.

  • Sign the model

    Use the snap sign command to update the JSON file with the key name.

Build and write the image

Using ubuntu-image, generate a bootable image from the recipe contained in the model assertion.

  • Compile the image

    Install the ubuntu-image command and use the arguments snap, --allow-snapd-kernel-mismatch and the file name of the previously signed model assertion to build an image.

  • Write the image

    Install Raspberry Pi Imager and use it to write the image on a microSD card.

Boot the image

Now that you have a custom image for a Raspberry Pi on a microSD card, the device can now be booted and configured.

  • Boot Ubuntu Core

    Insert the microSD card into the powered-off Raspberry Pi and turn it on to boot up your image.

  • Configure a network connection

    Choose a wired connection (Ethernet) or Wi-Fi to setup Ubuntu Core.

  • Connect to the device

    Connect to the AdGuard Home snap of the Ubuntu Core via the published IP address and its configured port (3000 for setup).