Android is a very capable operating system, with more and more applications approaching desktop class. Yet sometimes, you still really need to work in order to accomplish something on Android that would be a snap on a desktop.
Fortunately, Android is Linux at its core. And Termux builds on this existing infrastructure. It provides a command line environment and allows you to install honest-to-goodness Linux apps on your Android device. Let’s go get some.
Download: Termux (Free)
Why Use Termux?
There are already some apps in the Play Store that are ports of Linux applications to Android. These differ from Termux in that they replicate those Linux apps, but they’re made in an “Android way.” In contrast, Termux is a self-contained Linux environment. Its programs are (for all intents and purposes) exactly the same as their Linux counterparts. This conveys some advantages over the ported applications:
- Consistency — Linux apps that have been ported to Android have to receive a user interface of some kind. The user experience on Android depends a lot on how much effort the developer puts into it. It is bound to be different in any case. But Termux apps are the same as the Linux versions, from keyboard shortcuts to how you install them.
- Compactness — The addition of the “Android code” described above can cause some slim applications to grow chunky. Take an Android SSH client (VX ConnectBot shown below) for instance, which can run anywhere from 2 MB to 12 MB in size. Yet with the exception of some a few graphical screens, you still end up in a terminal as shown in the below image. Compare this to dropbear, available in Termux, which weighs in at 396 KB (that’s kilobytes) installed. And it provides an SSH server to boot.
- Timeliness — When an application is updated, you are still at the mercy of the Android app’s developer for an upgrade. In contrast, Termux applications are fairly standard Linux packages that require less work. They may even be created automatically alongside the desktop versions. You’re likely to get access to new features more quickly with Termux.
- Price — Of course, there is a chance any app you purchase from the Play Store will have a charge associated. All the apps in Termux are free (and open source), as is Termux itself.
Before diving into usage, let’s put something right out there. Termux is first and foremost a command line environment. There’s no fancy user interface with shiny buttons to be found here.
This goes not only for the base Termux package, but its apps as well. You won’t be getting the newest version of LibreOffice. You also need to be comfortable with the command line in order to install and use these programs. If you’re new to it, we have some great resources to help you. You can read up on the essential commands, the 40+ most used terminal commands, how to teach yourself terminal commands, and websites and books that can educate you further.
That said, the process to install programs is straightforward. Termux uses the same package installers available in Debian and Ubuntu Linux, called Advanced Packaging Tools (APT). To see what applications are available, open Termux and type the following at the prompt:
This displays a list of all packages, or software bundles, you can install. If you’d like some details on one, just type this and include its name:
apt show [app name]
It will display a short summary of the package, as shown above for the Emacs text editor. Finally, to install, just use this:
apt install [app name]
Check out our guide on using APT for more detail, like how to upgrade packages. Once the install is finished, you can start the program by typing its name at the prompt. The screenshot below shows the nano text editor running after the above install.
Now let’s take a look at some of the awesome utilities you can get through Termux.
Core Linux Utilities
Once you install Termux, you can do some nifty things straight out of the box. The base app will allow you to use basic Linux utilities to perform activities such as copying (with the cp command) and moving (mv) files, reading directory contents (ls), and deleting things (rm).
Nothing you can’t do with an Android file manager, right? Well, Termux also includes the “link” command (ln). This is useful immediately — by default, Termux has you working in the directory
/data/data/com.termux/files/home, which is not where the rest of your files are (usually /sdcard). But you can create a new symbolic link in this directory (e.g.
This will allow you to quickly navigate to those files.
Replaces: The file management commands in the base Termux install can reduce the need for separate file managers unless they have additional features. The ability to create links between directories can also eliminate dedicated apps such as Link Folder, and it saves you from rooting your phone to get this functionality.
Termux provides recent versions of both of the “main” Linux text editors: VIM (v8.0, the latest stable at the time of writing) and Emacs (v25.2, also current). The below images show Emacs running in the konsole terminal in Linux (top) and Termux (bottom). Note the similarities.
Other editors such as the minimalist nano are also available.
Now, Android has a lot of text editors. Like, a lot. And many of them do a very good job at saving and opening text files. But many do little more than that, as though they were the creator’s “test app” for Android.
Emacs and VIM are highly capable text editors. Like to work in Markdown? Both support it quite well. Into the whole “distraction-free” mindset? It doesn’t get much more distraction free than VIM. Need something to take notes and provide to-dos? Org-mode in Emacs has you covered. You can even use Emacs as your file manager, screenwriting app, Trello client, music player, or to play Minesweeper.
Replaces: Android text editors tend to have one major feature — one may focus on distraction-free drafting, another can preview Markdown or other formatting, and a third keeps notes (though it’s really just a text editor). The terminal-based editors above can fulfill these needs in a single program, with the added bonus of being available on desktop platforms as well.
Command Line Utilities
Termux packages include a number of useful Linux command line utilities:
- gnuplot — a mathematical graphing program
- imagemagick — an image manipulation and conversion toolkit
- p7zip — an un/archiving utility for the 7-Zip compression scheme
- unrar — a different un/archive tool for the RAR format
- wget — a program to fetch files over the internet via HTTP or FTP
Replaces: Dedicated standalone programs, depending on how many of the above functions you need. Even if there are apps that handle all archive and graphics formats, you’d have five new apps cluttering up your drawer. It’ll be even more if you need separate apps for separate formats.
Why would you want to run a web server on your Android device? In addition to programming, bear in mind that many of today’s best applications are web apps. If, for example, you’re looking for a true project management application to run locally on your device, the native Android options are pretty bleak. But you could install nginx, the PostgreSQL database, and Python, and use Taiga. All without having to sign up for any third-party services or hosting.
Termux also includes dropbear, which (as mentioned) provides an SSH server to log into your phone/tablet and transfer files in addition to a client. This is useful in situations where you want to exchange a few files with another machine and 1) don’t want to use cloud services, and 2) won’t or can’t install the drivers to plug into the device directly. You can start up the dropbear server for a moment, use a client on Windows or macOS, grab what you need over the network, and shut it down.
Replaces: Apps like the free PAW Server or the paid Ulti Server allow you to spin up a web server. And even though I’m a fan of SSHDroid (shown above), the prospect of having a lightweight server I can start from the command line is still intriguing.
While many Android apps (e.g. “code editors”) provide the ability to write code, they may not provide the languages themselves. With Termux you can test that code right on your device. It offers standard distributions of programming languages such as:
- BASH shell (the default available out of the box, and a great way to get started hacking around)
- Python (both v2 and v3 are available)
Source control systems git and Subversion are also available, which have their uses beyond just development. If you like being in control of your own data, source control let’s you stash your files wherever you want. You also control when you send updates to other devices, and you can use “tags” to label versions (raise your hand if you’ve ever named a file “mydocument_v12_Aaron’s_edit_final_for_real_the_last_one.DOCX”).
Replaces: There are some programming language packages for Android, such as PHP, QPython, or Pocket Ruby. But these provide their own bulky UIs, and may require yet other apps to be fully useful (like the Apache-based server to go along with PHP). There are Android based applications for both git, such as the highly-rated Pocket Git, and svn, such as Open Android SVN Pro. However neither is free, and you need to have a separate app for each source control type. Termux provides both in the same package for free. By going with source control you can also cut down on clients for cloud syncing services such as Dropbox.
Add a Little Linux to Your Android
Termux is a super-compact application that opens up a lot of functionality for your Android device. The command line is one of the most powerful features of Linux, and Termux builds on your device’s Linux kernel to make you more efficient on the go. And who knows, maybe dabbling with these applications will convince you to take the plunge on the desktop as well.
Do you every find yourself working around the limitations of Android apps? Or are you one of the Linux faithful, missing your favorite utility on Android? Let us know in the comments how these applications can make you more productive!
Image Credit: ST22Studio via Shutterstock.com