Alpine Linux on proot-distro
Quick setup guide for running Alpine Linux inside proot (on Termux) with a regular sudo user.
1. Install proot-distro and Alpine
Run in your host shell (Termux):
bash
apt update -y && apt upgrade -y
apt install proot-distro
proot-distro install alpine2. Log in as root
bash
proot-distro login alpine3. Install sudo and bash
Alpine ships with ash by default, so install bash along with sudo:
bash
apk update
apk add sudo bash4. Create a user
Replace yourusername with your own name:
bash
adduser -s /bin/bash yourusernameYou will be prompted to set and confirm a password. Other fields can be skipped by pressing Enter.
5. Give the user sudo access
Add the user to the wheel group and enable sudo for that group:
bash
addgroup yourusername wheel
echo '%wheel ALL=(ALL:ALL) ALL' >> /etc/sudoers6. Log in as your user
Exit the root session (exit), then from the host shell:
bash
proot-distro login alpine --user yourusernameTest sudo:
bash
sudo whoami # should print: rootNotes
- Run
sudo apk update && sudo apk upgradeoccasionally to keep packages up to date. - Alpine uses
apkinstead ofapt/dnf/pacman, andmuslinstead ofglibc, so some prebuilt binaries may not run. - This is the user dir you can access from host shell (Termux):
$PREFIX/var/lib/proot-distro/containers/alpine/rootfs/home/yourusername