📥 Installation & Build Guide
This guide covers system prerequisites, automated installation, manual pre-compiled binary deployment, and building Raspiducky from source (including cross-compilation for ARM target hardware).
📋 System Requirements
To run Raspiducky in USB Gadget mode, your target hardware and operating system must meet the following criteria:
- Operating System: Linux with kernel 4.19 or higher (Raspberry Pi OS Lite recommended).
- Kernel Drivers: USB Gadget ConfigFS support (
libcompositekernel module) and low-level USB controller driver (dwc2,dwc3, orsunxi-musb). - Root Privileges:
rootaccess is required to interact with/sys/kernel/config/usb_gadgetand/dev/hidg*HID character devices. - DebugFS:
/sys/kernel/debugmounted for hardware endpoint limit detection.
⚡ Option 1: Automated One-Line Installation (Recommended)
The automated installation script detects target architecture, downloads the latest binary release, configures kernel overlays, creates udev rules, and installs a systemd background service.
Run this single command on your Raspberry Pi:
What the Installation Script Performs
- Detects system architecture (
armv6l,armv7l,aarch64, orx86_64). - Downloads the matching pre-compiled release binary to
/usr/local/bin/raspiducky. - Appends
dtoverlay=dwc2to/boot/config.txtor/boot/firmware/config.txt. - Ensures
dwc2andlibcompositeare loaded in/etc/modules. - Configures
/etc/fstabto persist/sys/kernel/debugmount. - Installs
/etc/udev/rules.d/99-raspiducky-hid.rulesfor/dev/hidg*device access. - Enables and starts the
raspiducky.servicebackground daemon.
[!NOTE] If installing for the first time on a fresh Raspberry Pi OS image, a system reboot is required to activate the kernel
dwc2overlay:
📦 Option 2: Pre-Compiled Binary Release Download
If you prefer to install manually without the automated script, download the pre-compiled binary matching your CPU architecture from the GitHub Releases page:
# 1. Download target binary (Example: Raspberry Pi Zero / ARMv6)
curl -fsSL -o raspiducky https://github.com/arrase/Raspiducky/releases/latest/download/raspiducky-linux-armv6
# 2. Grant executable permissions
chmod +x raspiducky
# 3. Move binary to system path
sudo mv raspiducky /usr/local/bin/raspiducky
# 4. Prepare storage directory
sudo mkdir -p /var/lib/raspiducky
# 5. Enable kernel modules manually
sudo modprobe dwc2
sudo modprobe libcomposite
# 6. Run daemon
sudo /usr/local/bin/raspiducky daemon -port :8000 -storage /var/lib/raspiducky -layout US
🏗️ Option 3: Building from Source
Raspiducky is written in pure Go (ECMAScript engine and USB ConfigFS integration require zero CGO dependencies).
Prerequisites
- Go 1.22 or higher installed on your build machine (
go version). - Git installed (
git).
Native Build (On Target Device)
To build directly on your Raspberry Pi:
# Clone project repository
git clone https://github.com/arrase/Raspiducky.git
cd Raspiducky
# Compile binary
go build -ldflags="-s -w" -o build/raspiducky ./cmd/raspiducky
# Verify binary execution
sudo ./build/raspiducky version
🔀 Cross-Compilation Commands
You can cross-compile Raspiducky from any standard PC (x86_64 / macOS / Linux) for any supported ARM target board without needing external C toolchains (CGO_ENABLED=0).
1. Raspberry Pi Zero / Zero W (ARMv6 32-bit)
GOOS=linux GOARCH=arm GOARM=6 CGO_ENABLED=0 go build -ldflags="-s -w" -o build/raspiducky-linux-armv6 ./cmd/raspiducky
2. Raspberry Pi 3A+ / Banana Pi / Orange Pi (ARMv7 32-bit)
GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0 go build -ldflags="-s -w" -o build/raspiducky-linux-armv7 ./cmd/raspiducky
3. Raspberry Pi Zero 2 W / Pi 4 / Pi 5 / Rock Pi (ARM64 64-bit)
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags="-s -w" -o build/raspiducky-linux-arm64 ./cmd/raspiducky