Flutter is an open-source framework that lets you build multi-platform applications from a single Dart codebase. While Flutter officially targets mobile, desktop, and web, with flutter-elinux you can bring Flutter to resource-constrained Embedded Linux devices like the Orange Pi Zero 2W.
1. SSH into the Orange Pi Zero 2W#
# Discover the board's IP on your LAN:
hostname -I
nmap -sn 192.168.1.0/24
# SSH in (default credentials):
ssh orangepi@<BOARD_IP>
# password: orangepi2. Install Dependencies & flutter-elinux#
sudo apt update
sudo apt install libstdc++-12-dev unzip curl clang cmake pkg-config gitClone and set up the CLI:
git clone https://github.com/sony/flutter-elinux.git
sudo mv flutter-elinux /opt/
export PATH=$PATH:/opt/flutter-elinux/binVerify your device is recognized:
flutter-elinux devices
# Should list something like “elinux-arm64”.3. Create & Test a Sample App on X11#
Use X11 for rapid iteration:
flutter-elinux create sample
cd sample
export XDG_SESSION_TYPE=x11
export DISPLAY=:0
flutter-elinux run -d elinux-x11You’ll get hot-reload and desktop-like development.
4. Run on the Linux Framebuffer (DRM/GBM)#
Bypass X11 to run directly on DRM/KMS:
- Stop and disable your display manager:
sudo systemctl stop lightdm
sudo systemctl disable lightdm- Build for the GBM backend:
flutter-elinux build elinux --debug --target-backend-type=gbm- Launch on
/dev/dri/card0:
sudo XDG_RUNTIME_DIR=/tmp/runtime-root \
FLUTTER_DRM_DEVICE=/dev/dri/card0 \
./build/elinux/arm64/debug/bundle/sample \
-b ./build/elinux/arm64/debug/bundleYour Flutter UI should appear fullscreen via DRM/KMS.
5. Auto-Start with systemd#
Create /etc/systemd/system/flutter-sample.service:
[Unit]
Description=Flutter Sample App
After=network.target
[Service]
User=orangepi
WorkingDirectory=/home/orangepi/sample
ExecStart=/bin/bash -c "\
XDG_RUNTIME_DIR=/tmp/runtime-root \
FLUTTER_DRM_DEVICE=/dev/dri/card0 \
/home/orangepi/sample/build/elinux/arm64/debug/bundle/sample \
-b /home/orangepi/sample/build/elinux/arm64/debug/bundle"
Restart=always
[Install]
WantedBy=multi-user.targetEnable and start it:
sudo systemctl daemon-reload
sudo systemctl enable flutter-sample.service
sudo systemctl start flutter-sample.serviceOn reboot, your Flutter app will launch directly on the framebuffer.


