If you’ve ever managed an Ubuntu Server, you’ve likely experienced that sinking feeling when the system crashes after a failed apt upgrade. Sometimes, just one script accidentally overwriting a system file is enough to cause the OS to collapse. For IoT devices located at remote stations, traveling hundreds of kilometers just to reflash an SD card is a logistical and financial nightmare.
Ubuntu Core was designed to eliminate those concerns. Unlike the Desktop or Server versions, this is an Immutable operating system that runs entirely on Snaps. Let’s dive into how to configure Ubuntu Core to create truly “rock-solid” IoT devices.
Why Does IoT Need an Immutable OS?
I once managed a cluster of 15 Raspberry Pis located at irrigation monitoring stations. My biggest fear was a power outage occurring exactly during an update, which would completely “brick” the operating system. Ubuntu Core solves this problem through three technical pillars:
- Read-only File System: The entire OS is packaged in read-only squashfs files. Even root privileges cannot accidentally modify or delete these core files.
- Transactional Updates (A/B Updates): During an update, the system downloads the new version to a separate partition. If the process fails or the boot is unsuccessful, it automatically rolls back to the stable old version in seconds.
- Application Isolation (Sandboxing): Every app running as a Snap is confined within its own environment. Thanks to AppArmor and Seccomp, even if an app is compromised, the attack cannot spread to the rest of the system.
Preparation: Essential Requirements
To get started, you need to prepare carefully because Ubuntu Core takes a slightly different approach than traditional Linux distributions:
- Hardware: Raspberry Pi 3, 4, 5, or an Intel NUC.
- Ubuntu One Account: This is mandatory for linking your SSH Key. Register quickly at login.ubuntu.com.
- SSH Key: Ubuntu Core completely disables password logins. You must upload your Public Key to your Ubuntu One account before installation.
# Quickly generate an SSH key if you don't have one
ssh-keygen -t ed25519 -C "[email protected]"
Copy the contents of your ~/.ssh/id_ed25519.pub file and paste it into the “SSH Keys” section of your Ubuntu account management page. This is the only key that will allow you to access the device later.
Practical Installation Steps
1. Flash the Image and Prepare the SD Card
Download the appropriate Image (e.g., Ubuntu Core 22) for your hardware. Use Raspberry Pi Imager to flash it. A small tip: prioritize Industrial-grade SD cards or at least Class 10. Snap packages involve high read/write intensity; low-quality cards will likely fail after 6-12 months of continuous operation.
2. Initial Console Configuration
Power up the device and connect it to the network. On the first boot, Ubuntu Core will prompt for basic setup:
- Press Enter to enter the configuration menu.
- Configure the IP (using Ethernet is recommended for faster automatic IP assignment).
- Enter your Ubuntu One account email.
The device will connect to Canonical’s servers to download your Public Key. Once the screen displays the IP address along with the SSH command, you can unplug the monitor and keyboard.
3. Remote Access
Open a terminal on your personal computer and type:
ssh [email protected]
System Administration: Forget apt, Snap is Everything
On Ubuntu Core, everything from the Kernel to the Drivers is a Snap. You cannot use sudo apt install. Instead, all operations revolve around the snap command.
Check the running components:
snap list
Want to install Docker to run containers? It only takes one command:
sudo snap install docker
Hard-won Lessons from Real-world Operations
After a long period of deploying industrial gateways, here are 3 tips to optimize your system:
Saving 4G Data
By default, Snap automatically checks for updates 4 times a day. If you are using a data-capped 4G SIM, limit updates to off-peak hours (e.g., 2:00 AM on Sunday):
sudo snap set system refresh.timer=sun,02:00
Leveraging Snap Confinement
When developing your own apps, always package them in strict mode. This mode prevents the app from unauthorized hardware access unless granted permission (interfaces). This is critical if your device handles sensitive data or surveillance cameras.
Monitoring SD Card Health
Use the command sudo snap logs -f to monitor system logs. If you see persistent I/O errors, it’s a sign the SD card is about to fail. Early detection allows you to proactively replace it before the device stops working entirely.
Conclusion
Ubuntu Core is not for those who want an OS to tinker with or install arbitrary libraries. It is built for Production environments. If you need a gateway system that runs reliably 24/7 for 3-5 years without manual intervention, Ubuntu Core is a top choice. Its immutability helps me sleep better whenever I need to deploy remote updates to a fleet of devices.

