rpi-imager
The home of Raspberry Pi Imager, a user-friendly tool for creating bootable media for Raspberry Pi devices.
Top Related Projects
Quick Overview
Raspberry Pi Imager is the official imaging utility for Raspberry Pi devices. It provides a simple and user-friendly interface for writing operating system images to SD cards and other storage devices. The tool supports various Raspberry Pi OS versions and other compatible operating systems.
Pros
- Easy-to-use graphical interface for beginners and experienced users
- Supports a wide range of Raspberry Pi models and operating systems
- Includes advanced options for customization and network configuration
- Regularly updated with new features and improvements
Cons
- Limited to Raspberry Pi-compatible operating systems
- Requires an internet connection for downloading OS images
- May have slower write speeds compared to some third-party imaging tools
- Not available as a command-line tool for automation purposes
Getting Started
To use Raspberry Pi Imager:
- Download and install Raspberry Pi Imager from the official website: https://www.raspberrypi.org/software/
- Insert your SD card into your computer
- Launch Raspberry Pi Imager
- Select your desired operating system from the list
- Choose your SD card as the target device
- Click "Write" to begin the imaging process
- Wait for the process to complete, then safely eject your SD card
Note: This is not a code library, so code examples and quick start instructions are not applicable.
Competitor Comparisons
Flash OS images to SD cards & USB drives, safely and easily.
Pros of Etcher
- Cross-platform support (Windows, macOS, Linux)
- User-friendly interface with drag-and-drop functionality
- Supports writing to multiple drives simultaneously
Cons of Etcher
- Larger file size and resource usage
- Slower write speeds compared to Raspberry Pi Imager
- Less focused on Raspberry Pi-specific features
Code Comparison
Etcher (JavaScript):
const imageWriter = require('etcher-image-write');
imageWriter.write({
device: '/dev/disk2',
image: '/path/to/image.img',
validateWriteOnSuccess: true,
unmountOnSuccess: true
});
Raspberry Pi Imager (C++):
ImageWriter *writer = new ImageWriter(this);
connect(writer, SIGNAL(success()), this, SLOT(onSuccess()));
connect(writer, SIGNAL(error(QString)), this, SLOT(onError(QString)));
writer->writeImage(filename, device, nullptr, verifyEnabled);
Both projects aim to simplify the process of writing disk images to storage devices, but they have different focuses. Etcher provides a more versatile, cross-platform solution with a polished user interface, while Raspberry Pi Imager is tailored specifically for Raspberry Pi users with optimized performance and Raspberry Pi-specific features. The code examples demonstrate the different approaches, with Etcher using JavaScript and Raspberry Pi Imager using C++.
The Reliable USB Formatting Utility
Pros of Rufus
- Supports a wider range of operating systems and image formats
- Offers more advanced features like bad blocks check and custom partition schemes
- Faster image writing speed for most operations
Cons of Rufus
- Less user-friendly interface for beginners
- Lacks built-in image download functionality
- Not specifically optimized for Raspberry Pi images
Code Comparison
Rufus (C):
BOOL FormatFAT32(HANDLE hPhysical, DWORD ClusterSize, LPCSTR FSName, LPCSTR Label, DWORD Flags)
{
// FAT32 formatting implementation
}
Raspberry Pi Imager (C++):
bool ImageWriter::writeCompressedImageToRemovableDevice(const QString &filename)
{
// Compressed image writing implementation
}
Both projects use low-level programming languages for efficient disk operations. Rufus focuses on versatile formatting options, while Raspberry Pi Imager specializes in writing specific image types to SD cards.
A new bootable USB solution.
Pros of Ventoy
- Supports multiple ISO files on a single USB drive, allowing for multiple OS installations
- Compatible with a wide range of operating systems and bootable images
- Doesn't require reformatting the USB drive for each new ISO
Cons of Ventoy
- Slightly more complex initial setup compared to Rpi-imager
- May require manual configuration for some specific operating systems
- Less focused on Raspberry Pi-specific features
Code Comparison
Ventoy (C):
int VentoyFillMBR(UINT64 DiskSizeInBytes, UINT32 PartStyle, MBR_HEAD *pMBR)
{
UINT32 DiskSignature;
UINT32 DiskSectorCount;
memset(pMBR, 0, sizeof(MBR_HEAD));
Rpi-imager (C++):
void MainWindow::on_writeButton_clicked()
{
if (_writeThread)
return;
QMessageBox::StandardButton confirm = QMessageBox::question(this, tr("Confirm write"),
Both projects serve different purposes, with Ventoy focusing on multi-boot USB creation and Rpi-imager specializing in Raspberry Pi image writing. Ventoy offers more flexibility for general-purpose bootable media creation, while Rpi-imager provides a simpler, more streamlined experience for Raspberry Pi users.
Raspberry Pi App Store for Open Source Projects
Pros of pi-apps
- Offers a wide range of applications and tools specifically for Raspberry Pi
- Community-driven project with frequent updates and contributions
- Provides a user-friendly GUI for installing and managing apps
Cons of pi-apps
- May include less official or vetted software compared to rpi-imager
- Potentially higher resource usage due to the GUI and additional features
- Might require more manual intervention for updates and maintenance
Code Comparison
rpi-imager (C++):
void MainWindow::writeImage()
{
_writeThread = new WriteThread(_settings);
connect(_writeThread, &WriteThread::success, this, &MainWindow::onWriteSuccess);
connect(_writeThread, &WriteThread::error, this, &MainWindow::onWriteError);
_writeThread->start();
}
pi-apps (Bash):
if [ "$1" = "install" ]; then
app="$2"
if [ -f "${DIRECTORY}/apps/${app}/install" ]; then
"${DIRECTORY}/apps/${app}/install" || exit 1
else
error "App ${app} does not exist!"
fi
fi
The code snippets show different approaches: rpi-imager uses C++ for image writing, while pi-apps employs Bash scripts for app installation and management.
Make your pi images smaller!
Pros of PiShrink
- Focuses specifically on shrinking Raspberry Pi images, potentially offering better optimization
- Lightweight and can be easily integrated into existing workflows
- Provides options for automatic expansion on first boot
Cons of PiShrink
- Limited to image shrinking, lacks the comprehensive features of rpi-imager
- May require more technical knowledge to use effectively
- Not officially supported by the Raspberry Pi Foundation
Code Comparison
PiShrink (bash script):
#!/bin/bash
set -e
usage() { echo "Usage: $0 [-s] [-v] [-r] imagefile.img [newimagefile.img]" 1>&2; exit 1; }
should_skip_zeroes=false
verbose=false
rpi-imager (C++):
#include "imagewriter.h"
#include "drivelistmodel.h"
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
While PiShrink is a bash script focused on image shrinking, rpi-imager is a more comprehensive C++ application with a graphical interface for writing and managing Raspberry Pi images. PiShrink is more suitable for advanced users who need specific image optimization, while rpi-imager offers a user-friendly solution for a wider range of Raspberry Pi-related tasks.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Raspberry Pi Imager
Raspberry Pi Imaging Utility
- To install on Raspberry Pi OS, use
sudo apt update && sudo apt install rpi-imager
. - Download the latest version for Windows, macOS and Ubuntu from the Raspberry Pi downloads page.
How to use Raspberry Pi Imager
Please see our official documentation.
Contributing
Linux
Get dependencies
- Install the build dependencies (Debian used as an example):
sudo apt install --no-install-recommends build-essential cmake git libgnutls28-dev
- Get the Qt online installer from: https://www.qt.io/download-open-source
- During installation, choose Qt 6.7, CMake and Qt Creator.
Get the source
git clone --depth 1 https://github.com/raspberrypi/rpi-imager
Build the AppImage
Modify appimagecraft.yml:
- First, you must set Qt6_ROOT (as a extra_variables item under build/cmake) to the root of your Qt6 installation. eg:
/opt/Qt/6.7.2/gcc_arm64/
- Second, you must set QMAKE (as a raw_environment variable of the linuxdeploy plugin) to the full path of qmake inside that Qt6 installation. eg:
/opt/Qt/6.7.2./gcc_arm64/bin/qmake
Now, use AppImageCraft to build your AppImage:
cd rpi-imager
export LD_LIBRARY_PATH=${your_Qt6_install_path}/lib
./${your_platform_appimagecraft}.AppImage
Now mark the AppImage as executable, and run it:
chmod +x ./Raspberry_Pi_Imager-*.AppImage
./Raspberry_Pi_Imager-*.AppImage
Windows
Get dependencies
-
Get the Qt online installer from: https://www.qt.io/download-open-source During installation, choose Qt 6.7 with Mingw64 64-bit toolchain, CMake and Qt Creator.
-
For building the installer, get Nullsoft scriptable install system: https://nsis.sourceforge.io/Download
-
It is assumed you already have a valid code signing certificate, and the Windows 10 Kit (SDK) installed.
Building
Building Raspberry Pi Imager on Windows is best done with the Qt Creator GUI.
- Download source .zip from github and extract it to a folder on disk
- Open src/CMakeLists.txt in Qt Creator.
- Use Qt Creator to set the MINGW64_ROOT CMake variable to your MingGW64 installation path, eg
C:\Qt\Tools\mingw64
- For builds you distribute to others, make sure you choose "Release" in the toolchain settings and not the Debug configuration.
- Menu "Build" -> "Build all"
- Result will be in build_rpi-imager_someversion
- Go to the BUILD folder, right click on the .nsi script "Compile NSIS script", to create installer.
macOS
Get dependencies
- Get the Qt online installer from: https://www.qt.io/download-open-source During installation, choose Qt 6.7, CMake and Qt Creator.
- It is assumed you have an Apple developer subscription, and already have a "Developer ID" code signing certificate for distribution outside the Mac Store.
Building
- Download source .zip from github and extract it to a folder on disk
- Start Qt Creator and open src/CMakeLists.txt
- Use Qt Creator to set the Qt6_ROOT CMake variable to your Qt6 installation path, eg
/opt/Qt6/6.7.2/gcc_arm64
- Menu "Build" -> "Build all"
- Result will be in build_rpi-imager_someversion
- For distribution to others:
- Use the IMAGER_SIGNED_APP flag to enable Application signing
- Use the IMAGER_SIGNING_IDENTITY string to specify the Developer ID certificate Common Name
- Use the IMAGER_NOTARIZE_APP flag to enable notarization as part of the build
- Use the IMAGER_NOTARIZE_KEYCHAIN_PROFILE string to specify the name of the keychain item containing your Apple ID credentials for notarizing.
Linux embedded (netboot) build
The embedded build runs under a minimalistic Linux distribution compiled by buildroot. To build:
- You must be running a Linux system, and have the buildroot dependencies installed as listed in the buildroot manual: https://buildroot.org/downloads/manual/manual.html#requirement
- Run:
cd rpi-imager/embedded
./build.sh
The result will be in the "output" directory. The files can be copied to a FAT32 formatted SD card, and inserted in a Pi for testing. If you would like to build a (signed) netboot image there are tools for that at: https://github.com/raspberrypi/usbboot/tree/master/tools
Other notes
Custom repository
If the application is started with "--repo [your own URL]" it will use a custom image repository. So can simply create another 'start menu shortcut' to the application with that parameter to use the application with your own images.
Telemetry
In order to understand usage of the application (e.g. uptake of Raspberry Pi Imager versions and which images and operating systems are most popular) when using the default image repository, the URL, operating system name and category (if present) of a selected image are sent along with the running version of Raspberry Pi Imager, your operating system, CPU architecture, locale and Raspberry Pi revision (if applicable) to https://rpi-imager-stats.raspberrypi.com by downloadstatstelemetry.cpp.
This web service is hosted by Heroku and only stores an incrementing counter using a Redis Sorted Set for each URL, operating system name and category per day in the eu-west-1
region and does not associate any personal data with those counts. This allows us to query the number of downloads over time and nothing else.
The last 1,500 requests to the service are logged for one week before expiring as this is the minimum log retention period for Heroku.
On Windows, you can opt out of telemetry by disabling it in the Registry:
reg add "HKCU\Software\Raspberry Pi\Imager" /v telemetry /t REG_DWORD /d 0
On Linux, run rpi-imager --disable-telemetry
or add the following to ~/.config/Raspberry Pi/Imager.conf
:
[General]
telemetry=false
On macOS, disable it by editing the property list for the application:
defaults write org.raspberrypi.Imager.plist telemetry -bool NO
License
The main code of the Imaging Utility is made available under the terms of the Apache license. See license.txt and files in "src/dependencies" folder for more information about the various open source licenses that apply to the third-party dependencies used such as Qt, libarchive, drivelist, mountutils and libcurl. For the embedded (netboot) build see also "embedded/legal-info" for more information about the extra system software included in that.
Top Related Projects
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot