This repository contains Shell scripts for Termux, a terminal emulator for Android. These scripts include setup automation, shortcuts, installations and configurations of development tools and emulation environments such as proot, proot-distro, QEMU system emulation, and box64, and more.
My tutorials for Termux, some of my scripts in this repository, and other related stuff such as VNC, SSL, and SSH, are in Android-Non-Root, which also includes tutorials for a range of powerful, open-source tools such as F-Droid, Shizuku, Tor, TrackerControl, InviZible Pro, and PipePipe to enhance Android device’s functionality, security, privacy, and customization without the need for root access.
Termux Setup (termux-setup.sh
)
- Approximately 18.5GB of storage space for default configuration. Approximately 30.1GB of storage space if none of
UBUNTU
,DEBIANBOX
,BUSTERCLI
, andBUSTERXFCE
is empty string, and none ofDEBIANINSTALL
,UBUNTUINSTALL
,DEBIANBOXINSTALL
, andBUSTERCLIINSTALL
is0
. - Internet connection for packages and scripts download.
- It is recommended to turn off the battery optimization for Termux.
- It is recommended to hold wakelock while running these scripts. You can do so by opening Termux, pulling down the notification bar, and then tapping Acquire wakelock on the notification of Termux.
- It is recommended to prevent the
Process completed (signal 9) - press Enter
error in advance. You may encounter it when using Termux, especially when running VMs. To prevent it from occuring, please read my tutorial Android Non Root about it: https://willie169.github.io/Android-Non-Root/#process-completed-signal-9---press-enter-error for the fixes.
- In
termux-change-repo
, it is recommended to choose a mirror close to your geographic location:
termux-setup-storage
termux-change-repo
pkg update && pkg install git -y
cd ~ && git clone https://github.com/Willie169/termux-sh.git
- Optionally edit the variables in the beginning of
~/termux-sh/termux-setup.sh
(nano
for example). In VM names variables,_
, names that are not allowed will be added a suffix1
:
pkg install nano
nano ~/termux-sh/termux-setup.sh
- Run the setup script:
bash ~/termux-sh/termux-setup.sh
termux-setup.sh
will install essential packages, configures shortcuts, and sets up VMs in Termux.
Follow the screen guide to complete it. If you see a dancing parrot on screen, which is powered by parrot.live, pull down the notification bar and tap exit on the notification of Termux. Now, you can restart Termux and enjoy it.
The variables below refer to the variables set in the beginning of termux-setup.sh
.
- Termux packages installation: Installs Termux packages set in
$PKG
. The default includes tools for development, runtime environments, and utilities for C/C++, Python, Java, Node.js, Rust, Go, Ruby, Perl, proot, GitHub, GitLab, SSL, SSH, JQ, FFMPEG, Maven, Termux-X11, TigerVNC, XFCE4, Zsh, and more on Termux. - Shortcut configuration: Copies shortcuts from
DOTshortcuts
into.shortcuts
for Termux:Widget and the home directory (~
) and renames thebashrc.sh
in the home directory to.bashrc
. - Termux properties adjustments: Enables external app access in
termux.properties
. - Termux proot environment: Installs Yonle's termux-proot, a Termux proot environment, with
proot-termux.sh
, if notPROOTTERMUX=0
. - Audio setup: Configures audio output using Andronix's
setup-audio.sh
if notAUDIO=0
. - Node.js packages installation: Installs NPM packages set in
$NPM
. The default isjsdom marked marked-gfm-heading-id node-html-markdown showdown
. - Go package installation: Installs Go packages set in
$GO
. The default is fabric, an open-source modular framework for augmenting humans using Al using a crowdsourced set of Al prompts. - Proot-distro Debian Bookworm environment with development tools: Configures Debian Bookworm ARM64 proot-distro instance with alias
$DEBIAN
if$DEBIAN
is not empty string, and install development tools in it if$DEBIAN
is not empty string and$DEBIANINSTALL
is not0
. - Proot-distro Ubuntu environment with development tools: Configures an Ubuntu 24.04 ARM64 proot-distro instance with alias
$UBUNTU
if$UBUNTU
is not empty string, and install development tools in it if$UBUNTU
is not empty string and$UBUNTUINSTALL
is not0
. - Proot-distro Debian Bookworm environment with Box64, Wine64, and Winetricks: Configures Debian Bookworm ARM64 proot-distro instance with alias
$DEBIANBOX
if$DEBIANBOX
is not empty string, and install Box64, Wine64, and Winetricks in it if$DEBIANBOX
is not empty string and$DEBIANBOXINSTALL
is not0
. - Andronix Debian Buster CLI-only environment with development tools: Creates CLI-only Debian Buster ARM64 proot environments in
~/$BUSTERCLI
if$BUSTERCLI
is not empty string, using scripts from Andronix, and install development tools in it if$BUSTERCLI
is not empty string and$BUSTERCLIINSTALL
is not0
. - Andronix Debian Buster environment with XFCE and VNC: Creates Debian Buster ARM64 proot environments with XFCE and VNC server configured in
~/$BUSTERXFCE
if$BUSTERXFCE
is not empty string, using scripts from Andronix. - VM booting shortcuts: Creates shortcuts to boot each installed VM in
.shortcuts
for Termux:Widget and the home directory (~
).
Go to VM Setup Scripts for more details of the VM setup scripts invoked in termux-setup.sh
.
These scripts will be invoked by Termux Setup if corresponding configuration is set.
debian-xfce-mod.sh
: Modified version ofAndronix's debian-xfce.sh
, which installs and configures Debian Buster ARM64 proot environment with XFCE GUI support and related tools. Invoked for the$BUSTERXFCE
Debian Buster proot environment.debian-buster.sh
: Installs developer tools for Debian Buster ARM64 instance, including development tools, runtime environments, and utilities for C/C++, Python3, Java 11, Node.js, Go, Ruby, Perl, GitHub, SSL, SSH, JQ, Maven, Zsh, NumPy SymPy Matplotlib, Selenium, Jupyter Notebook, Pandas, Meson, Ninja, and more. Invoked for the$DEBIANCLI
Debian Buster proot environment.debian-bookworm.sh
: Installs developer tools for Debian Bookworm instance, including development tools, runtime environments, and utilities for C/C++, Python3, Java 17, Node.js, Rust, Go, Ruby, Perl, GitHub, SSL, SSH, Pandoc, TeX Live, Maven, NumPy SymPy Matplotlib, Selenium, Jupyter Notebook, Pandas, Meson, Ninja, Noto Sans CJK, STIX Two Math, and more. It can be used for both QEMU and Proot Debian Bookworm setups. The installation of fonts is compatible with my LaTeX template in LaTeX-ToolKit. Invoked for the Debian Bookworm ARM64 proot-distro instance with alias$DEBIAN
.box64-wine64-winetricks.sh
: Installsbox64
,wine64
, andwinetricks
for running x86_64 Linux and Windows applications on an ARM64 Linux instance. Invoked for the Debian Bookworm ARM64 proot-distro instance with alias$DEBIANBOX
.ubuntu-24-04.sh
: Installs developer tools for Ubuntu 24.04 instance, including development tools, runtime environments, and utilities for C/C++, Python3, Java 17, Node.js, Rust, Go, Ruby, Perl, GitHub, SSL, SSH, Pandoc, TeX Live, Maven, NumPy SymPy Matplotlib, Selenium, Jupyter Notebook, Pandas, Meson, Ninja, Noto Sans CJK, STIX Two Math, and more. It can be used for both QEMU and Proot Debian Bookworm setups. The installation of fonts is compatible with my LaTeX template in LaTeX-ToolKit. Invoked for the Ubuntu 24.04 ARM64 proot-distro instance with alias$UBUNTU
.
Shortcuts are located in DOTshortcuts
. Some of them are intended for tools that is not installed or configured in the Termux Setup, such as QEMU. Some related scripts and instructions are in Additional Scripts and Instructions.
qemu-alpine-aarch64.sh
,qemu-alpine-aarch64-vnc.sh
,qemu-alpine-x86_64.sh
,qemu-alpine-x86_64-vnc.sh
,qemu-debian-aarch64.sh
,qemu-debian-aarch64-vnc.sh
,qemu-alpine-amd64.sh
,qemu-debian-amd64-vnc.sh
,qemu-bliss-vnc.sh
: Boot respective QEMU system emulation VMs with-netdev user,id=n1,dns=8.8.8.8,hostfwd=tcp::2222-:22 -device virtio-net,netdev=n1
option, where files with-vnc
in their names start VNC server at the host'slocalhost:0
and others are-nographic
. Those VMs can be installed withqemu-alpine-aarch64-install.sh
,qemu-alpine-x86_64-install.sh
,qemu-debian-arm64-install.sh
,qemu-debian-amd64-install.sh
, andqemu-bliss-install.sh
respectively. See Additional Scripts and Instructions for details.nethunter.sh
: Boots the Kali Nethunter proot-distro instance with the aliaskali-default
as userkali
withisolated
andfix-low-ports
options.proot-termux.sh
: Boot the Termux proot.
bashrc.sh
: A customized.bashrc
for Termux with pre-defined aliases, functions, and environment variables for Tor, Git, Go, ANTLR4, etc.gitPull.sh
:git pull
all repositories in~/gh
.code.sh
,download.sh
:cd /storage/emulated/0/Documents/code
andcd /storage/emulated/0/Download
respectively.xmrig.sh
: Mines XMR to the repository owner's wallet,48j6iQDeCSDeH46gw4dPJnMsa6TQzPa6WJaYbBS9JJucKqg9Mkt5EDe9nSkES3b8u7V6XJfL8neAPAtbEpmV2f4XC7bdbkv
, using xmrig, which is not installed in the Termux Setup and can be installed withxmrig-install.sh
. Change the wallet address and other configurations if you need.shizuku.sh
:cd shizuku
andsh rish
. This is a shortcuts for Shizuku, which is not configured in the scripts in this repository. Please refer to the section of my tutorial "Android-Non-Root" about it for more information.termux-backup-bz.sh
: Creates a compressed backup with the highest compression level of BZIP2 of the/data/data/com.termux/files/home
and/data/data/com.termux/files/usr
, then splits the resulting archive into parts, each 4000MB in size.android-backup-bz.sh
: Creates a compressed backup with the highest compression level of BZIP2 of the/storage/emulated/0/Files
,/storage/emulated/0/DCIM
,/storage/emulated/0/Pictures
,/storage/emulated/0/Alarms
, and/storage/emulated/0/Documents
, then splits the resulting archive into parts, each 4000MB in size.start-audio.sh
: Starts sound output from Termux. Configured in Termux Setup according to https://docs.andronix.app/troubleshoot/sound.
These scripts are not invoked by Termux Setup. Run it separately if you need it.
qemu-alpine-aarch64-install.sh
,qemu-alpine-x86_64-install.sh
,qemu-debian-arm64-install.sh
,qemu-debian-amd64-install.sh
,qemu-bliss-install.sh
: Setup and boot the respective QEMU system emulation VMs with-netdev user,id=n1,dns=8.8.8.8,hostfwd=tcp::2222-:22 -device virtio-net,netdev=n1
option, where the Alpine VMs are created from Virt 3.21.0 ISO images and the Debian VMs are pre-created Bookworm QCOW2 images.qemu-bliss-install.sh
starts VNC server at the host'slocalhost:0
and others are-nographic
. Remember tosetup-alpine
in Alpine VMs and resize disk in Debian VMs. Bliss OS is an Android-based open source OS for x86_64 architecture that incorporates many optimizations, features, and that supports many more devices.qemu-resize.md
: Provides instructions and scripts for resizing QEMU images.alpine-docker.sh
: Installs Docker on an Alpine machine and run hello-world.debian-waydroid.sh
: Installs Waydroid on Debian derivatives such as the QEMU Debian VMs. Waydroid is a container-based approach to boot a full Android system in a Linux namespace on a GNU/Linux-based platform.xmrig-install.sh
: Clones and compiles xmrig, an open source Monero (XMR) miner.proot-install-nethunter.sh
: Installs the Kali Nethunter ARM64 proot-distro instance from https://github.com/sagar040/proot-distro-nethunter. Follow the screen guide and enter wanted Build ID to install. For example,KBDEXKMTE
for everything, which occupies about 34GB, andKBDEXKMTD
for default, which occupies about 13GB. Boot it with<build id> [
USER]
orproot-distro login <build id> [
USER]
. Open GUI after logged in withsudo kgui
. Please go to https://github.com/sagar040/proot-distro-nethunter for more information.
- Make the configuration in termux-setup.sh more customizable.
- Modularize scripts for flexibility and reusability.
- Expand VMs and development tools support.
This repository is licensed under GNU General Public License General Public License, see LICENSE.md for details.
- https://alpinelinux.org.
- https://andronix.app.
- https://blissos.org.
- https://github.com/AndronixApp/AndronixOrigin.
- https://github.com/cyberkernelofficial/docker-in-termux.
- https://github.com/diogok/termux-qemu-alpine-docker.
- https://github.com/hugomd/parrot.live.
- https://github.com/notofonts/noto-cjk.
- https://github.com/sagar040/proot-distro-nethunter.
- https://github.com/stipub/stixfonts.
- https://github.com/termux/proot-distro.
- https://github.com/termux/termux-app.
- https://github.com/termux/termux-widget.
- https://github.com/willie169/Android-Non-Root.
- https://github.com/Willie169/LaTeX-ToolKit.
- https://github.com/zanjie1999/windows-fonts.
- https://ivonblog.com.
- https://ryanfortner.github.io.
- https://wiki.termux.com.
- https://willie169.github.io.
- https://www.debian.org.
- https://www.docker.com.
- https://www.qemu.org.
- https://waydro.id.