Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/termux/termux-app/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through opening Termux for the first time, granting storage access, updating the package index, and installing a few common tools. By the end you will have a working shell environment with Git, Python, and Node.js ready to use.
1

Open Termux

Tap the Termux icon to launch the app. After a brief bootstrap installation, you will see a bash prompt:
~ $
Termux uses bash as the default shell. Your home directory is /data/data/com.termux/files/home (available as $HOME or ~), and the Linux environment lives under /data/data/com.termux/files/usr (available as $PREFIX).You can open additional terminal sessions by swiping in from the left edge to reveal the session drawer, then tapping New session.
2

Set up storage access

Run the following command to grant Termux access to your Android shared storage:
termux-setup-storage
Android will show a permission dialog — tap Allow. Once granted, Termux creates a set of symlinks under ~/storage/ that map to standard Android storage locations:
SymlinkPoints to
~/storage/sharedInternal shared storage root
~/storage/downloadsDownloads folder
~/storage/dcimCamera photos and videos
~/storage/picturesPictures folder
~/storage/musicMusic folder
~/storage/moviesMovies folder
If you skip this step, Termux can still read and write files within its own private directory ($HOME and $PREFIX). You only need termux-setup-storage when you want to share files with other Android apps or access your device’s Downloads and media folders.
3

Update packages

Sync the package index and upgrade any outdated bootstrap packages:
pkg update && pkg upgrade
pkg is Termux’s frontend for apt. The two commands are interchangeable — pkg install calls apt-get install under the hood. When prompted to confirm upgrades, type y and press Enter.
If you see a repository is under maintenance or down error, the package mirror may be temporarily unavailable. See the Package Management wiki for instructions on switching mirrors.
4

Install your first packages

Install Git, Python, and Node.js:
pkg install git python nodejs
Confirm with y when prompted. After installation, verify the tools are available:
git --version
python --version
node --version
You can search for available packages with pkg search <name> and list all installed packages with pkg list-installed.Some other commonly used packages:
pkg install vim          # text editor
pkg install openssh      # SSH client and server
pkg install curl wget    # HTTP tools
pkg install gcc clang    # C/C++ compilers
pkg install ruby         # Ruby interpreter
5

Explore your environment

A few key environment variables and directories to know:
echo $PREFIX   # /data/data/com.termux/files/usr  — Linux binaries, libraries, includes
echo $HOME     # /data/data/com.termux/files/home — your home directory
echo $TMPDIR   # /data/data/com.termux/files/usr/tmp
ls ~/storage/  # Android shared storage symlinks (after setup-storage)
Unlike a standard Linux system, Termux does not use /usr, /bin, or /etc at the filesystem root. All binaries and libraries live under $PREFIX. Scripts that hardcode /usr/bin/python or /bin/bash will not work without modification — use #!/usr/bin/env python and #!/data/data/com.termux/files/usr/bin/bash in shebangs instead.
ls $PREFIX/bin    # all installed executables
ls $PREFIX/lib    # shared libraries
ls $PREFIX/etc    # configuration files

Next steps

Package management

Learn how to search, install, remove, and upgrade packages with pkg and apt.

Terminal settings

Configure font size, bell behaviour, and other preferences via ~/.termux/termux.properties.

Keyboard shortcuts

Volume key mappings, hardware keyboard shortcuts, and the extra keys toolbar.

Storage and file sharing

Access Android shared storage, downloads, and share files with other apps.

Build docs developers (and LLMs) love