Generate cloud-init files for Raspberry Pi OS without re-downloading images
Source: Dev.to
Introduction
Raspberry Pi recently introduced cloud-init support in their official Raspberry Pi OS images. This allows users to pre‑configure devices before first boot, including Wi‑Fi credentials, users, SSH access, locale, and more.
However, the current workflow provided by the official Raspberry Pi Imager has a practical limitation: advanced customization options are only available when you select Raspberry Pi OS from the official OS list inside the imager. If you flash a locally downloaded image using the Custom Image option, those configuration options disappear.
For users with limited bandwidth, slow connections, or frequent cache clean‑ups, this becomes frustrating quickly. This article explains the problem in detail and presents a simple, bandwidth‑friendly solution using a cloud‑init file generator.
The problem with Raspberry Pi Imager customization
Customization only works with official OS downloads
Raspberry Pi Imager allows you to configure:
- Wi‑Fi (SSID, password, country)
- Username and password
- SSH access
- Locale, timezone, and keyboard layout
These options are only enabled when:
- You choose Raspberry Pi OS directly from the imager, and
- The image is downloaded by the imager itself.
If you:
- Download the Raspberry Pi OS image manually, and
- Use the Custom Image option to flash it,
then all customization options are disabled.
Re‑downloading wastes bandwidth
- Raspberry Pi OS images are large.
- Clearing the cache forces a full re‑download.
- Re‑downloading the same image multiple times wastes data.
- This is especially painful in regions with limited or expensive internet access.
Many users already have the image they want, but still need a way to configure Wi‑Fi and users before first boot.
How cloud‑init works on Raspberry Pi OS
Recent Raspberry Pi OS images support cloud‑init by reading configuration files from the boot partition during the first boot. The key files are:
meta-datanetwork-configuser-data
If these files exist in the boot partition, Raspberry Pi OS automatically applies the configuration on first boot. This means:
- No need for Raspberry Pi Imager customization.
- No need to re‑download the OS image.
- Works with any flashing tool.
You only need valid cloud‑init files.
The solution: Raspberry Pi cloud‑init generator
Project overview
- GitHub repository:
- Hosted website:
The tool generates:
meta-datanetwork-configuser-data
ready to be copied directly to the Raspberry Pi boot partition.
Old workflow (problematic)
- Open Raspberry Pi Imager.
- Select Raspberry Pi OS from the official list.
- Download the image again.
- Add customization.
- Flash SD card.
Problems: repeated downloads, high data usage, custom image option unusable.
New workflow (efficient)
- Download Raspberry Pi OS image once.
- Flash it using Custom Image in Raspberry Pi Imager or any other tool.
- Open the cloud‑init generator website.
- Fill in Wi‑Fi, user, and SSH details.
- Generate
meta-data,network-config, anduser-data. - Copy these files to the boot partition of the SD card.
- Boot the Raspberry Pi.
Result: no re‑downloads, full cloud‑init customization, works offline after image download.
Key benefits
- Saves bandwidth.
- Avoids unnecessary re‑downloads.
- Works with cached or archived images.
- Uses official Raspberry Pi OS cloud‑init support.
- Simple and beginner‑friendly.
This approach is especially useful for:
- Developers flashing multiple Raspberry Pi boards.
- Users with limited internet access.
- Automated or repeatable Raspberry Pi setups.
Conclusion
Raspberry Pi OS cloud‑init support is powerful, but the current Raspberry Pi Imager workflow unnecessarily forces users to re‑download images to access basic customization features.
By generating cloud‑init files manually and placing them in the boot partition, you can fully configure Raspberry Pi OS without relying on the imager’s official OS download flow. The Raspberry Pi cloud‑init generator makes this process simple, accessible, and bandwidth‑efficient.
If you regularly work with Raspberry Pi boards, this approach can save both time and data while giving you full control over your system configuration.