Skip to content

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

termuxrd

One-command Termux bootstrap for rootless Linux containers.

curl -fsSL https://raw.githubusercontent.com/ivansslo/termuxrd/v1.0.0/install.sh -o install.sh
less install.sh          # read it before running it
bash install.sh

It installs rootd-fs, downloads a Linux container, and optionally makes new terminals open inside it.


What it actually does

  1. Installs prerequisites — python, proot, git, curl.
  2. Installs the rootd-fs engine, pinned to a release tag.
  3. Downloads and prepares a container (Ubuntu 24.04 by default).
  4. Optionally adds a marked, reversible block to your shell rc.

It prints this plan and waits for confirmation before touching anything.


Usage

bash install.sh                    # interactive
bash install.sh --yes              # no prompts
bash install.sh --distro alpine    # a different image
bash install.sh --no-autostart     # skip the shell hook
bash install.sh --uninstall        # undo everything

Afterwards you use rootd:

rootd enter ubuntu              # open a shell in the container
rootd sh ubuntu -- apt update   # run one command
rootd ls                        # list containers
rootd backup ubuntu             # archive one
rootd caps                      # what this kernel supports
rootd purge                     # remove everything

Available images include ubuntu, debian, alpine, arch, fedora, nextcloud, postgres, and any OCI reference. Run rootd presets for the full list.


Autostart

Enabling autostart appends a marked block to ~/.bashrc (or ~/.zshrc) and saves a .termuxrd-bak copy first. The block is written to fail safe:

  • only runs in interactive shells, so scp and rsync still work;
  • refuses to run when ROOTD_BOX is already set, so it cannot recurse;
  • TERMUXRD_NO_AUTO=1 skips it without editing any file;
  • if the container is missing or broken it prints a note and leaves you on the Termux host rather than a dead terminal.

If you ever get stuck:

TERMUXRD_NO_AUTO=1 bash
bash install.sh --uninstall

Your rc file is only ever modified between the two termuxrd markers. Nothing outside them is read or changed.


Uninstall

bash install.sh --uninstall   # removes the shell block
rootd purge                   # removes containers and cached layers
pip uninstall rootd-fs        # removes the engine

Requirements

  • Termux on Android (ARM64 or ARM), or any Linux host
  • Python 3.9+
  • ~500 MB free for a typical Ubuntu container

Honest limits

Rootless containers are a convenience boundary, not a security boundary. PRoot emulates uid 0 by rewriting syscall arguments; it does not grant kernel privilege and will not contain hostile code.

Docker's daemon cannot run here. dockerd needs real root, cgroups, overlayfs and veth — none available to an unprivileged Android app. What does work is the Docker client against a remote daemon: rootd docker <box> --host ssh://user@server. Run rootd caps to see exactly which kernel features your device is missing.

Containers share the host network namespace, so a service bound to :8080 inside a container is reachable at localhost:8080 on the phone.


Relationship to other projects

termuxrd is a thin installer. The container engine is rootd-fs; the sandboxing is done by PRoot. Both are separate projects with their own licences.

This project is not affiliated with, endorsed by, or sponsored by the Termux project. "Termux" appears in the name only to describe where it runs.

Earlier versions of this repository were named termux-rocd and depended on a repository called rocd, which no longer exists. Version 1.0.0 is a rewrite; see CHANGELOG.md.


License

MIT — see LICENSE.

About

One-command Termux bootstrap: reset, install rootd-fs, and drop into a Linux container

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages