Skip to content

debelio/alpine-install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Alpine Linux Installation Script

This script automates the installation of Alpine Linux with full disk encryption using LUKS2 and BTRFS filesystem with subvolumes.

Inspired by: easy-arch

Features

  • Full Disk Encryption: Uses LUKS2 for secure disk encryption
  • BTRFS Filesystem: Modern filesystem with subvolumes for better organization
  • UEFI Support: Creates proper EFI boot partition
  • Microcode Installation: Automatically detects and installs AMD or Intel microcode
  • ZRAM Configuration: Sets up compressed RAM for better performance
  • Snapshot Support: Configures snapper for system snapshots (edge version only)
  • Rolling Release Option: Choose between stable or edge (rolling) Alpine version

Prerequisites

  • Boot from Alpine Linux installation media
  • UEFI-capable system
  • Internet connection
  • At least 4GB of disk space (recommended: 20GB+)

Installation Steps

  1. Initial Setup:

    setup-alpine
  2. Stop at Disk Installation: When you reach the step "Disk & Install", press CTRL+C to exit setup-alpine.

  3. Run the Installation Script:

    chmod +x alpine-install.sh
    ./alpine-install.sh
  4. Follow the Prompts:

    • Enter a strong password for LUKS encryption (you'll need to confirm it)
    • Choose between stable or edge (rolling) Alpine version
    • Select the target disk for installation

What the Script Does

Disk Partitioning

  • Creates GPT partition table
  • 300MB EFI partition (FAT32)
  • Remaining space for encrypted root partition

LUKS Encryption

  • Creates LUKS2 container with PBKDF2 (500,000 iterations)

BTRFS Subvolumes

The script creates the following subvolumes for better organization:

  • @ - Root filesystem
  • @snapshots - System snapshots
  • @var/cache - Package cache
  • @var/log - System logs
  • @home - User home directories
  • @root - Root user home
  • @opt - Optional software

System Configuration

  • Installs CPU-specific microcode (AMD/Intel)
  • Configures ZRAM (compressed swap in RAM)
  • Enables BTRFS scanning service
  • Sets up snapper for snapshots (edge version only)

Post-Installation

After rebooting into your new Alpine Linux system:

For Edge Version Users

Install the APK snapshot tool:

apk add apk-snap

Unlock Disk at Boot

You'll be prompted to enter your LUKS password during boot to unlock the encrypted disk.

Tips

  • SSH Installation: For easier installation, you can enable SSH during setup-alpine and run the script remotely
  • Password Security: Choose a strong password for LUKS encryption - this protects all your data
  • Backup: Consider backing up your LUKS header after installation:
    cryptsetup luksHeaderBackup /dev/sdX2 --header-backup-file luks-header-backup

Warning: This script will completely wipe the selected disk. Ensure you have backups of any important data before proceeding.

License

This project is licensed under the Apache License v2.0 - see the LICENSE file for details.

About

An automated installation of Alpine Linux

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages