How to Use Termux: Complete Guide for Beginners and Advanced Users

Last update: 18/03/2025
Author Isaac
  • Termux is a terminal de Linux all with Android that allows you to run commands and scripts without the need for root.
  • It includes a package manager that allows you to install essential Linux tools such as bash, vim, or git.
  • You can automate tasks, access remote servers using SSH and customize your configuration with .bashrc.
  • It allows you to install complete Linux distributions and perform security tests with specialized tools.

termux

If you've ever wanted to bring the power of a Linux terminal to your Android device, Termux is the perfect tool for you. This terminal emulator lets you run commands, install Linux packages, and even develop scripts, all without needing root access. In this guide, we'll explore in detail what Termux is, how to install and configure it, and discover all the potential it offers.

Throughout this article, you'll learn everything from the basics to advanced features, including package management with APT, connecting to servers using SSH, installing development environments, and running automated scripts. Let's get started!

What is Termux?

termux

Termux is an Android application that provides a Linux-based terminal environment. It functions as a miniature Linux distribution, allowing you to run commands, install packages, and access the device's file system.

One of Termux's most notable advantages is that it doesn't require root permissions to run most of its functions. This makes it an accessible tool for any user who wants to explore the world of the command line without significantly modifying their device. If you're looking for more information about terminal emulators, you can find details about terminal emulators for Android.

Installation and initial configuration of Termux

Before starting to use Termux, we must first install and configure it properly:

Download and install Termux

  • Download Termux from the store F-Droid. Version of Google Play Store does not receive recent updates, so it is recommended to avoid it.
  • Si downloads the APK from its official website, remember to enable installation from “Unknown Sources” in your phone’s settings.
  Which Android game is the most popular?

Configure permissions and storage

After installing Termux, it is essential to give it access to storage :

termux-setup-storage

This command creates shortcuts to folders in the Android file system, such as Downloads, DCIM, Music and others, within the board of directors ~/storage/.

Update packages

To ensure that we have the latest version of the packages available in Termux, it is recommended to run:

apt update && apt upgrade -y

This will update the package list and install the latest available versions.

terminal
Related articles:
What is the best terminal emulator for Android?

Basic Termux Commands

If you've never used a terminal in Linux, here are some essential commands :

  • ls – Lists the contents of a folder.
  • cd – Change directory.
  • pwd – Displays the path of the current directory.
  • cp – Copy files or folders.
  • mv – Move or rename files.
  • rm – Delete files. Use with caution.
  • mkdir – Create a new folder.
  • clear – Clean the terminal screen.

Package management in Termux

Termux uses APT (the same package management system used by Debian and Ubuntu) to install additional tools and programs.

Install packages

To install a package , use:

pkg install nombre_del_paquete

Example:

pkg install vim

Search packages

If you want to find a specific package , use:

pkg search nombre_del_paquete

Remove packages

If you no longer need a package, you can delete it with:

pkg uninstall nombre_del_paquete

Connect Termux to other devices with SSH

SSH (Secure Shell) allows you to access servers remotely and securely. To install SSH on Termux:

pkg install openssh

Start the SSH server

Termux can act as an SSH server , allowing remote connections:

sshd

To connect to Termux from another device, you will need your phone's IP address :

ifconfig

Then, connect from another device using:

ssh usuario@IP -p 8022
android terminal
Related articles:
How to master the terminal emulator on Android

Automation and scripts in Termux

Termux allows the execution of scripts to automate repetitive tasks. A basic example of a script to display "Hello, world" would be:

echo "echo Hola, mundo" > hola.sh
chmod +x hola.sh
./hola.sh

Customizing Termux

We can customize the terminal editing the file .bashrc:

vim ~/.bashrc

Personalization example:

PS1="\[\033[1;32m\]\u@\h:\[\033[1;34m\]\w\[\033[0m\]$ "

This will change the look of the command line. Exploring the possibilities of Termux opens up endless opportunities for using advanced commands, developing scripts, and connecting to servers from your Android. With this guide, you'll have everything you need to start using Termux effectively and get the most out of it.