Current best practices for building local IoT platforms with Ubuntu on Raspberry Pi (and other SBCs)?

Hello to this awesome community,

During last year at university, for my bachelor’s degree, I worked on a Capstone project where we developed a Smart Home platform focused on local-first energy monitoring and control. We used a Raspberry Pi as the hub, running a custom Armbian image with all required services containerized using Docker.

Now, I’m exploring how similar systems could be built using Ubuntu, especially for use on a Orange Pi or any other single-board computer (it really doesn’t matter, as long as it has Ubuntu support).

So my main question is:

What are the current best practices for building a local IoT platform on Ubuntu for SBCs?

Of course, one obvious approach is to start from an Ubuntu Server image and run post-installation scripts. But I’m curious about the broader ecosystem:

  • Are there recommended tools or workflows for developing a customized Ubuntu for embedded/local IoT platforms? It really doesn´t matter if it’s a prebuilt image.
  • How do technologies like snaps and Ubuntu Core fit into this?
  • Are there clean ways to build scalable and repeatable IoT solutions?

I’m currently documenting my findings and plan to publish a blog post to help others who might be exploring similar questions. If there are any resources, examples, or community projects you think are relevant, I’d love to hear about them.

Looking forward to your insights!

Hi 0wulf! I’m not the very best person to answer your question, but I am a technical author who works on the Store team and I do a lot of work for customers who deploy a lot of snaps use our various Stores for IoT and other solutions. So I’ll have a crack, and I’m sure if I’m off base a little bit I’m sure one of my colleagues will correct me :slight_smile:

  • Are there recommended tools or workflows for developing a customized Ubuntu for embedded/local IoT platforms? It really doesn´t matter if it’s a prebuilt image.

Yes! Canonical has a range of products, with some specifically focused on IoT. Ubuntu Core is one of those, and it is designed specifically for embedded and IoT systems. It’s essentially a minimal installation of Ubuntu, with strict confinement for security (this confinement relates to snaps and how snaps work, as Ubuntu Core is built on snaps).

There’s a tutorial in the Ubuntu Core documentation, but the workflow would be to build an Ubuntu Core image which can be flashed onto a supported device, providing a repeatable installation for all of your devices.

Ubuntu Core supports amd64 (Intel/AMD 64-bit), arm64 (64-bit Arm), armhf (32-bit Arm), and riscv64 (64-bit RISC-V), with specific IoT devices from some vendors certified for security and updates.

Now, you can run Docker on Ubuntu Core devices, but if you are able to, I would highly recommend looking at snaps for your application.

There’s a whitepaper here from 2023 outlining Docker vs snaps. There’s also an interesting blog post from Husarion about their journey from Docker to snaps for software deployments (full disclosure, they are a customer).

A non-comprehensive tl;dr on Docker vs Snaps is:

  • Snaps run natively on your device, vs being in a lightweight virtual environment.
  • Snaps integrate with the system’s network rather than being assigned separate IP addresses.
  • Snaps, when developed, set specific access to the host OS, this access is understood by the OS - and can be further restricted at installation.
  • Snaps support OTA updates, rather than needing to pull in new images.
  • Snap deltas can reduce the bandwidth required for updates.

An easy next step for you, instead of diving directly into creating a snap of your application, would be to create a snap of your existing Docker deployment. It doesn’t provide all the advantages of running your application in a snap - but it does provide security and will get you more familiar with building snaps.

The workflow would then be, create a snap of your application, build an Ubuntu Core image for your SBC with that snap, flash your devices with that image.

1 Like

Hi to you too secondskoll, thanks for the fast answer

So you did provide a very complete answer to my question including resources, which is very nice!

I’ll be reading them in a couple of days, but they really seem to be what I was looking for

If anyone has more things to say, I’ll happily read them and take a look at any other resources you all can provide!

Once again, I’m thankful for your answer and hope you have a nice day!

1 Like