Mobile development suite: How to use Termux + my setup

Konrad Iturbe
Jan 28, 2018 · 4 min read

Mobile phones seem to have become dumb and simplified computers used for single purpose tasks. But who says you cannot use your phone as a development machine? Sometimes you don’t have your desktop/laptop at your disposal and need to be productive, or you love desktop apps over phone apps (like me).

Here’s when Termux comes into place. Termux is a debian chroot for Android, grossly oversimplifying. It has its own package manager, utils and runs on ARM/ARM64 and X86/64. I’ve used this app to solve all sorts of tasks, from programming, reading, doing homework and generally being productive.

How to setup Termux:

Termux is available in the Play Store and in F-Droid. I prefer using F-Droid since all the apps there are free should be free from malware and spyware. If you don’t have F-Droid installed, head over to F-Droid.org to download the APK. F-Droid is a marketplace for free (as in beer and speech) and open source apps. Search for Termux and download the Termux app. Termux also has some plugins that allow interfacing with the Android API and with Tasker, might be useful to download those as well. Since most Android keyboards don’t have computer keyboard keys such as CTRL and ESC install Hacker Keyboard from F-Droid as well.

Left: Termux and Hacker Keyboard. Right: F-Droid

Let’s get familiar with Termux: Swipe from the left to access the session manager, you can have multiple instances of Termux running just like Tabs on desktop terminal emulators.

If for whatever reason your keyboard closes there’s a way to open it again: tap on the KEYBOARD button in the session manager to open it again. Long-press it to get the top button bar (which is useful if you’re not using Hacker’s Keyboard).

The top control tab is also useful for Hacker Keyboard since you dont’ have to reach down.

Termux Package manager is “pkg”, based on aptitude.

Let’s setup Termux: run pkg upgrade to update all the built in packages. Next let’s get rid of the welcome message. Run touch .hushlogin

Now install the packages you want. For development I use python, ruby, nodejs, go and C. So my development packages are: python, ruby, nodejs, cmake.

pkg install python cmake nodejs ruby golang

You can see if a package exists in termux here.

I use vim with vim-awesome, tmux and git:

pkg install vim tmux git && git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime && sh ~/.vim_runtime/install_awesome_vimrc.sh

Note: vimrc is super cool, it installs all the vim extensions I need, but if you dont’ want to use it just copy the first command.

Now lets configure the workspace. Termux provides /home/ as /data/data/com.termux/files/home. I will mirror what I use on my desktop but you can set the directories up as you see fit.

mkdir notes gh homework temp

Next is configuring the dotfiles. I will use mine as an example.

cd gh && git clone https://github.com/konradit/dotfiles.git && cp dotfiles/bashrc ~/.bashrc

My dotfiles include shorthand commands for Termux.

Now install the basic packages:

pkg install coreutils termux-api termux-exec termux-tools grep tree ncurses-utils openssh gpg

Type exit to exit and enter the terminal again.

Now you got a wicked terminal. Shorthand commans are:

n: cd $HOME/notes
nn: cd $HOME/notes && vim
t: cd $HOME/temp
gh: cd $HOME/gh
hh: cd $HOME/homework

Additionally you can just type the name of the directory and cd to it.

If you want to have tmux run automatically when you enter the shell:

echo “tmux” >> ~/.bashrc

Pro tip: long press to copy/paste, change color scheme and change font!

Reading the news. tmux with newsboat and neofetch

To conclude, the possibilities with Termux are limitless. Some people are hosting web servers, running emergency nodejs servers, doing hacking/reverse-engineering using metasploit, radare (pkg install r2) and nmap, downloading youtube videos, ssh’ing to other machines using openssh (or hosting a ssh server)… Heck, you can even have an arch linux chroot!

Want to be even more productive? Buy a wireless Android keyboard

Next entry: Best of F-Droid.

Konrad Iturbe

Written by

Individual 1.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade