If you have a simple Android tablet or mobile phone and you feel like learning to program, You don't need a computer to get started.With Termux, you can set up a functional Linux environment on your device and work with C, C++, Python, and a good number of network and system tools. It might sound a bit geeky at first, but once you try it, you'll see that it's perfectly usable for studying, experimenting, and even running real services.
In this article we'll see step by step how to get the most out of Termux on Android tablets. Compile C and C++ code locally, work with Python, and combine it with Linux utilitiesYou'll see how to install Clang, how to prepare your first "Hello World" in C and C++, how to install Python and use it in practical projects, and how to refine the environment with small adjustments, always keeping in mind a realistic use that also touches on cybersecurity, automation, and remote work.
What is Termux and why is it worthwhile on an Android tablet?
The great advantage is that Termux works almost like any Linux distribution, while respecting Android's limitations: You share part of the file system with the operating system itself.There is no classic FHS tree in /bin, /usr, /home… and the environment is designed for a single user. Even so, you have a fully usable $HOME directory where you can install packages, compile code, run scripts, and save your projects.
To learn programming from scratch, Termux removes many typical barriers: You don't need a powerful laptop or to struggle with virtual machines.Simply download the app, update packages, install a couple of key tools, and you're ready to write C, C++, Python, HTML, CSS code, or whatever you want to try on your tablet.
Furthermore, the Termux workflow fits perfectly with areas such as basic cybersecurity, process automation, and systems administrationwhere scripts, network tools, and console commands are constantly being used. Your tablet becomes a small portable lab that you can carry in your backpack or pocket.
Install and configure Termux on your Android tablet
The first step is to get a reliable and up-to-date version of the app. The usual recommendation is to download Termux from F-Droid or from its official repository on GitHub.because Google Play versions are often outdated or unmaintained.
Once the app is installed on your tablet, open it and let it prepare the initial environment. You'll see a shell prompt similar to that of any Linux terminal. Before doing anything serious, it's advisable Update the system's core packages to avoid version conflictsIn Termux, it's done like this:
pkg update && pkg upgrade
This command refreshes the indexes and updates everything you have installed. It's a good idea to repeat this periodically, and especially before adding compilers, interpreters, or development tools.
After that, it's worth installing a minimum of console utilities to work comfortably: a text editor, compression tools, network utilities, and system monitorsFor example, to install nano:
pkg install nano
This gives you a simple editor with visible shortcuts at the bottom, perfect for learning. If you're more advanced, you can opt for Vim or Neovim, which are also available as package files.
At this point you already have a functional mini Linux on your tablet, with a A ready environment to install compilers like clang, interpreters like Python, and other useful packagesEverything you learn about directory structure, permissions, and commands will be useful later on real servers.
Particularities of Termux compared to a classic Linux
Although Termux behaves like a Linux environment, there are several important details to keep in mind. The first is that Termux is a single-user system and the sudo command does not exist.You work directly with the privileges associated with the app user, who has full control over $HOME but limited permissions outside of that space.
Default, The main paths are different from those of a desktop Linux system.:
- $PREFIX = /data/data/com.termux/files/usr
- $ HOME = /data/data/com.termux/files/home
If for compatibility reasons you want your $HOME to look like /home, you can install termux-proot:
pkg install termux-proot
and then in each session run:
termux-chroot
This emulates an environment where $HOME is presented as /home, even though it is physically located in the internal Termux path.This is useful when tools or installers expect standard paths.
Another key point is accessing the device's shared storage. To easily access the SD card or internal memory, run:
termux-setup-storage
This command adds a $HOME/storage directory that links to different Android locations. Note that In these paths you will not be able to create direct executables with chmod and launch them with ./scriptInstead, you will have to explicitly invoke the interpreter, for example:
python storage/shared/scripts/mi_script.py
Finally, your username in Termux is the application identifier in Android. You can check it with whoami and set a password with passwd.This is essential if you want to connect to your tablet via SSH from another computer.
Installation of basic tools and working environment

Before we focus on C, C++ and Python, it's a good idea to have some programs on hand that will make your life easier. Termux uses pkg (and apt underneath) as its package managerSo the installation is very similar to that of a Debian-like distro.
Some recommended packages are:
- Python:
pkg install pythonto have Python 3 and be able to install modules with pip. - clang:
pkg install clangto compile C and C++ and to allow pip to compile certain native extensions. - openssh:
pkg install opensshto activate an SSH server on your tablet and connect conveniently from a PC. - screen:
pkg install screento maintain background processes and recover sessions. - procps:
pkg install procpsto manage processes with pkill and other classic tools. - htop:
pkg install htopas an interactive CPU and memory monitor, although it may not work perfectly in some versions of Android. - net-tools:
pkg install net-toolsto work with ifconfig and other classic network utilities. - wget:
pkg install wgetto download content from URLs directly into your environment. - tree:
pkg install treeto list the directory structure hierarchically.
With these parts installed, your tablet goes from being a simple multimedia consumption device to a small development environment capable of running scripts, compiling code, serving content, and accepting remote connections.
Install clang and compile C and C++ locally
If you want to program in C and C++ on your tablet, you need a compiler that understands both languages. In Termux, the key package is clang, which also creates aliases compatible with gcc and g++so you can use traditional commands without changing your habits.
To install it, open a Termux session and run:
pkg install clang
The tool will ask for confirmation; simply reply with a And when requested, the necessary components will be downloaded and installed.From that moment on, you will have the gcc and g++ executables available to compile in C and C++ respectively.
What you achieve with this is a complete build environment within AndroidYou write your source file (.co.cpp), compile it from the terminal, and run the generated binary within Termux itself. The workflow is virtually the same as on a desktop Linux system, only running on your tablet.
If errors related to missing libraries or headers appear during compilation, they are usually resolved. installing additional packages related to that dependency (for example, specific development libraries from the Termux repository). Carefully reading the error message is usually enough to locate the missing package.
Your first C program from your tablet
With Clang installed, it's time to test it. A good starting point is to create a A small "Hello world" type program in C to check that the compiler and environment are configured correctly.For this you need an editor; if you choose nano, first make sure you have it installed:
pkg install nano
Next, in the directory where you want to work (for example, your $HOME), create a source file by running:
nano hola.c
An empty buffer will open where you can type your C program with the function main and a call to printf to display text on the screenThere's no need to stick to the classic example; any message can be used to verify that everything is working.
When you finish writing the code, save the file with the combination CTRL + O, confirm the name with Enter and exit with CTRL + XYou will return to the Termux prompt with hola.c saved in the current directory.
Now it's time to compile the program using gcc (which actually points to the installed clang compiler):
gcc -o hola hola.c
This command indicates that an executable file should be generated. Hello, starting from the source code hola.cIf there are no errors, you'll return to the prompt without any unusual messages. All that remains is to run the binary:
./hola
And you should see the text you programmed in the terminal. This demonstrates that your tablet is capable of Write, compile, and run C code completely locally using Termux.
Compile and run C++ code with g++
For C++ the process is practically identical, except you will use the g++ executable that is part of the clang packageC++ greatly expands the capabilities of C by adding object-oriented programming, templates, a richer standard library, and a modern ecosystem.
In some cases, g++ can compile plain C files without too much trouble. For example, if you run:
g++ -o hola_cpp hola.c
the compiler will probably issue A warning for compiling C code with the C++ compilerBut it will still generate the hola_cpp executable that you can launch with:
./hola_cpp
Although this works, the recommended approach for real-world projects is Use .cpp files and take advantage of C++'s specific features: classes, std::vector, std::string, standard library algorithms, etc.
The typical workflow would be:
- Create the source file, for example program.cpp, editing it with nano, Vim or your preferred editor.
- Save changes and return to the terminal.
- Compile with a command like this
g++ -o programa programa.cppadding flags and libraries as needed. - Run the resulting binary with
./programato see the output on the console.
With this scheme you can go moving from simple exercises to small utilities that process files, analyze logs, automate internal Termux tasks, or perform operations on network dataAll of this on your Android tablet.
Install and use Python in Termux for real-world projects
While C and C++ give you low-level control, Python offers a perfect environment for rapid prototyping, task automation, and connecting servicesTermux shines especially when combined with Python, because you can mix shell commands with scripts and take advantage of network and system tools all in one place.
To install Python on Termux, simply run:
pkg install python
A recent version of Python 3 will be downloaded along with the essential components. After installation, You can launch the interactive interpreter by typing python or python3 in the terminal, depending on the alias that the package has configured.
From there you can create scripts in .py files, and run them with:
python mi_script.py
and use pip to install additional dependencies. Note that some Python libraries require clang and other development packages to compile native extensions.So having clang installed saves you a lot of headaches.
A highly recommended way to learn is to follow a project-based approach: Instead of just doing isolated exercises, you set yourself specific mini-goals. How to automate a network check, analyze a log, or query an API. The advantage of using Termux on a tablet is that you can try all of that during any spare moment.
Useful Python project ideas in Termux
To prevent Python from becoming solely focused on loops and conditionals, it's great to design projects that resemble real-world situations. In an environment like Termux, The areas of basic cybersecurity, automation, and information analysis are a particularly good fit..
Some interesting ideas for practicing could be:
- Network check scriptA program that pings multiple addresses or checks open ports and records whether they are accessible. This allows you to practice modules like subprocesses or sockets, manage command output, and handle errors without crashing the script.
- Simple password checkerA script that receives a password, checks its length, case, numbers, and symbols, and returns a score. You can add regular expressions and lists of common words stored in Termux files.
- Log file analyzerA tool that reads a log (for example, from a service you have on Termux), filters lines with errors, alerts, or specific IPs, and generates brief summaries. This helps you detect incidents and analyze events.
- Lightweight web scraperUsing requests and an HTML parsing library, you can visit pages, extract data, and store it in files for later analysis. This is very useful for tracking website changes, gathering public information, or training your eye to spot potential social engineering risks.
- Real-time weather tracker or cryptocurrencyThis script periodically queries a public API and displays the current values ​​in the terminal or saves them for comparison. This allows you to practice HTTP requests, JSON handling, token authentication, and network error management.
In all these projects, what's powerful is how You combine Python with the Linux tools that Termux already provides.You can schedule recurring tasks, use pipes, redirect output to files, and more. Your tablet becomes a small, ideal testing environment for bringing your ideas to life.
Learn Python and cybersecurity simultaneously from your mobile device
Many of the previous projects lend themselves to introducing real cybersecurity concepts and best practices. The idea isn't to turn the tablet into an uncontrolled hacking toy, but rather to understand how your scripts interact with networks, systems, and sensitive data.
For example, when you create a password checker, you can take the opportunity to talk about security policies, robustness criteria, key rotation, and frameworks such as NIST CSF or the NIS2 directivewhich establish specific obligations in certain sectors. Even if you're just tinkering at an amateur level, putting your scripts in a professional context helps you think big.
In the case of log analyzers, your tools can behave like small incident detection systemslooking for unusual patterns, failed login attempts, or suspicious behavior. This ties in with how security teams work in companies, where continuous monitoring and rapid incident response are key.
When playing with scrapers and APIs, you also come across topics such as responsible use of information, respect for terms of service and protection of personal dataThis is the perfect time to incorporate basic ethical habits: don't overload services with requests, don't collect sensitive data without permission, properly protect the tokens and credentials you use in your scripts, etc.
If you're also interested in professional-level process automation, Termux and Python can be... The gateway to more complex flows that you can then migrate to cloud environments like AWS or Azure, or to business intelligence solutions like Power BIWhat you learn designing scripts on your tablet can later be scaled to business processes, changing the infrastructure but maintaining the logic and best practices.
Basic setup and tips to improve your development environment
Termux works quite well right out of the box, but with some tweaking you can achieve an environment where program for hours without struggling with the interfaceThe first step is to choose an editor you're comfortable with: nano to start with, or Vim/Neovim if you want something more powerful and extensible.
It is also highly recommended to define a clear directory structure for your projects. For example: uterine
- $HOME/c_proyectos
- $HOME/cpp_projects
- $HOME/python_projects
And within each one, subfolders for each project. This helps you avoid mixing fonts, executables, and data, and gets you used to working in an organized way from day one.
If your scripts are going to touch on network topics, APIs, or external services, it wouldn't hurt to Use a VPN on your tablet when working with Termuxespecially if you connect to public or unreliable Wi-Fi networks. And while you're at it, learn how to monitor data usage, wakelocks, and automate on/off or power-saving modes can be a plus.
On the Python side, get used to Write logs and catch exceptions instead of letting the program crash at the first opportunity.Handling network errors, incorrect data formats, or permission issues will force you to design more robust code, and that's invaluable if you later want to bring these ideas to production systems.
Remember that Termux is, after all, a miniature real Linux environmentEverything you learn here about commands, pipes, redirects, permissions, and directory structure transfers almost unchanged to servers, VPSs, or virtual machines. Your tablet becomes the perfect testing ground to solidify that knowledge.
Integrating Termux and Python with IDEs in Android
A fairly common question is whether it is possible Using Termux Python from a graphical IDE on AndroidThis is similar to what you would do with Visual Studio Code or PyCharm on a desktop. The idea sounds great, but in practice, the Android ecosystem makes this integration quite complicated.
There are apps like Pydroid and similar ones that offer their own interpreter and a development environment with a graphical interface. The problem is that Each of these apps manages its own isolated environment and does not share packages or configuration with Termux.In other words, although you can program in Python on them, they will not be running the same Python or using the same modules that you have in Termux.
Today, the options for having a All-in-one IDEs that use the exact Termux Python environment are very limited.What you can do is get closer to that experience by using powerful editors within Termux (Vim/Neovim with plugins, for example) or by editing files in an external editor that has access to the shared folders, while continuing to run the code from the terminal.
Another option is to connect the tablet to a computer and work with a desktop IDE that communicates with Termux via SSH or SFTP. In that case, The tablet acts as the server and the PC as the development client.It's a very convenient workflow, but it deviates from the idea of ​​using only the mobile device.
For purely mobile use, the most realistic thing to accept is that Termux is terminal-based, and its power comes from combining a good editor, useful aliases, keyboard shortcuts, and careful configuration.That's more than enough for you to learn and develop serious Python projects on your tablet.
In the end, with a modest Android tablet, Termux, and the right tools, you can set yourself up A more than worthy work environment to learn C, C++ and Python, practice Linux, automate tasks, play with APIs, logs and networks and start touching on concepts of cybersecurity and cloud services.
With some perseverance, that portable lab becomes the first step towards more ambitious projects that you can then deploy on servers, business applications or business intelligence solutions, maintaining the same mindset: experiment, automate and build useful tools from a simple command line. Share the information so that more users can learn about the topic.
