Build Devuan AWS Machine Images (AMIs) for EC2 with a simple command-line tool.
This tool automates the creation of Devuan AMIs using debootstrap, making it easy to run systemd-free Devuan instances on AWS EC2. It handles the entire process from disk image creation through AWS import and AMI registration.
- Future-proof: Pulls packages directly from Devuan mirrors - no hardcoded package lists
- Automated: Complete pipeline from empty disk to registered AMI
- AWS-ready: Includes cloud-init, ENA drivers, serial console support
- SysVinit: True Devuan experience without systemd
- HVM: Modern virtualization for all current EC2 instance types
sudo apt-get install debootstrap qemu-utils awscli parted- AWS CLI configured with credentials (
aws configure) - S3 bucket for temporary storage
- IAM permissions for: S3 upload, EC2 import-snapshot, EC2 register-image
Must run as root (uses loop devices, mounts filesystems, chroot).
git clone https://github.com/thatsnice/Devuan-AMI.git
cd Devuan-AMI
npm install:# Run all tests
npm test
:# Watch mode (re-runs on file changes)
npm run test:watch- Unit tests: CLI argument parsing, validation, error handling (using Node's built-in test runner)
- Pre-AMI verification: Checks packages/files exist in chroot before upload (runs automatically)
- No linting: Code style is consistent by convention, not tooling
- No integration tests: Would require AWS resources and cost money
Tests use process injection for testability - see test/app.test.coffee.
Basic usage:
sudo bin/devuan-ami \
--release excalibur \
--s3-bucket my-ami-bucket \
--region us-east-1Full options:
sudo bin/devuan-ami \
--release excalibur \ # Devuan release: chimaera, daedalus, excalibur
--arch amd64 \ # Architecture: amd64 (arm64 planned)
--s3-bucket my-bucket \ # S3 bucket for upload (required)
--region us-east-1 \ # AWS region
--name "Custom Name" \ # AMI name (auto-generated if omitted)
--disk-size 8 \ # Disk size in GB
--work-dir /tmp/devuan-ami # Build directory- Creates raw disk image
- Partitions and formats as ext4
- Runs debootstrap to install Devuan
- Installs kernel, GRUB, cloud-init, SSH
- Configures fstab, network, SSH
- Installs GRUB bootloader
- Sets up cloud-init for EC2
- Configures SysVinit services
- Enables serial console
- Converts to VMDK format
- Uploads to S3
- Imports as EC2 snapshot
- Registers as AMI
Total time: 20-50 minutes depending on network speed and AWS region load.
The resulting AMI includes:
- OS: Devuan (your chosen release)
- Kernel: Cloud-optimized kernel from Devuan repos
- Init: SysVinit (no systemd)
- Cloud-init: Configured for EC2
- User:
admin(created by cloud-init, has sudo) - SSH: Key-based auth only, root login disabled
- Console: Serial console enabled for debugging
- Network: DHCP via cloud-init
- Filesystem: ext4 with auto-grow to fill disk
Three-module pipeline:
- Builder - Creates disk image with debootstrap
- Configurator - Configures system for AWS in chroot
- Uploader - Converts, uploads, and registers AMI
See CLAUDE.md for detailed architecture notes.
- Debian package (
.deb) for easy installation - ARM64/Graviton support
- Multiple architecture builds in parallel
- Instance-store backed AMIs (if requested)
Check IAM permissions include ec2:ImportSnapshot and vmimport service role exists.
Check network connectivity and Devuan mirror availability.
Ensure kernel has loop device support and /dev/loop* devices exist.
MIT