
Termux: terminal emulator and Debian-style userland as an Android app - fanf2
https://termux.com/
======
jeromenerf
Termux is a great project, may it be for cli lovers, hackers, road warriors
...

However, I have little trust in mobile devices nowadays and I don't feel safe
copying private ssh/gpg/vpn/credentials data on them anymore. Planned
obsolescence, theft risk, vendor/hardware/firmware issues, general feel of
lack of control, ...

As a consequence, I tend to use my smartphone as anonymously as possible,
mostly as a camera, an actual phone and 4G modem, tethering via usb/wifi to my
laptop. It's simple, it feels safe and obviously it's not as practical.

I'd love postmarketos --or something similar-- to succeed, so I could leverage
the privacy/backup strategies I have already set in place on laptops and
servers that actually make me feel safe.

~~~
laggyluke
I have a complete opposite feelings: mobile apps are actually sandboxed,
modern phones have secure elements in hardware and the attack surface itself
is pretty limited.

On the other hand, there's virtually no sandboxing on your laptop. As software
developers, we pull random code from the internet all the time and it's
generally trivial to steal every secret that your user has access to
([https://xkcd.com/1200/](https://xkcd.com/1200/))

Personally I'm not worried about baseband processor (or Intel ME) owning my
device. I'm more worried about some random malware installing a keylogger
and/or stealing my whole LastPass database. This would be virtually impossible
on mobile, but is relatively trivial on laptop.

~~~
skbohra123
You sir, have very misplaced priorities.

~~~
dredmorbius
I'd argue that both risk surfaces are large, not that the priorities are
misplaced.

There's little of _any_ electronics I trust much these days.

------
rossy
I tried this out a little while ago and I was really impressed. It's worth
mentioning that this isn't just a Debian chroot/container, the software is
actually compiled to run natively on the Android NDK. It seems like they work
around any limitations of Bionic compared to glibc by patching NDK headers and
using support libraries.

Check out their "ports tree" to see what packages are available:
[https://github.com/termux/termux-packages](https://github.com/termux/termux-
packages)

~~~
frostwhale
What exactly would you use it for? Not trying to be negative, I'm just not
sure what would be worth typing out on a phone keyboard on the go, instead of
waiting until I have access to an actual keyboard. I guess if you have a
keyboard for your phone that's also different. (so for android tablets etc
this is great)

~~~
iamcwu
Chromebook

I'm still waiting for Amazon to restock after I saw this post go up:
[https://blog.lessonslearned.org/building-a-more-secure-
devel...](https://blog.lessonslearned.org/building-a-more-secure-development-
chromebook/)

~~~
Asooka
On my chromebook I use crouton[1], which is arguably more "native". You get an
Ubuntu install in a chroot and can even run X11 apps in a chrome window. I was
even able to compile neovim, you just need to set it up to use the system's
lua and luarocks.

[1]
[https://github.com/dnschneid/crouton](https://github.com/dnschneid/crouton)

~~~
wiredfool
Termux works on stock chromebooks _without_ switching to developer mode.

~~~
em3rgent0rdr
This is very important for schools which may lend students Chromebooks and
thus likely restrict dev mode.

~~~
tinix
They would likely restrict play store installs, and currently there is no way
to side-load Android apps; the normal Android developer mode options does not
allow side-loading anyway, much less an enterprise managed device. I don't
think there's any way to "restrict" dev mode, necessarily... anyone can put
any Chromebook into dev mode, and lose all data that was on it in the process.

------
terrywang
Termux is amazing (not possible to get equivalent on iOS without jailbreak).
The number of packages in the repository, as well as the speed of version
updates (sometimes in line with Arch Linux - a rolling release) are really
amazing.

Bought all the paid add-ons to support the developer. It's one of the most
valuable assets I miss on iOS (doesn't matter that much now as I've got Linux
x86_64 and ARM with me on the go).

~~~
dolson
Where do you find the paid add-ons?

~~~
edjw
[https://play.google.com/store/apps/developer?id=Fredrik+Forn...](https://play.google.com/store/apps/developer?id=Fredrik+Fornwall)

------
eltoozero
I was recently surprised to discover folks are using this on old phones or
tablets as a "server" in various capacities.

You have storage, camera, at least dual network access (wifi + otg usb
ethernet + cellular), a battery (ups), autostart capability via a purchase,
basic package support.

Smaller than a laptop, way more self contained than a Pi, enough for some
basic tinkering for sure.

~~~
rmuratov
Can I create script which snaps a photo let's say every minute? Basically, is
camera available through terminal?

~~~
girst
Yes. [https://termux.com/add-on-api.html#termux-camera-
photo](https://termux.com/add-on-api.html#termux-camera-photo)

------
wybiral
Neat! As a test I installed nano and python, then used pip to install flask,
wrote a web application from nano and ran it from my phone... Opened it from
my laptop and everything works like you'd expect.

Sometimes I forget that these devices are just little computers!

EDIT:

I tried to get pyserial working (so my phone could talk to an arduino mini
over USB) but hit the issue of not being able to access /dev for lack of root.
Still, it's very cool.

~~~
lhuser123
Cool!. Was that a non rooted phone?

~~~
wybiral
Yep, just a standard Pixel.

~~~
lhuser123
Did you try the Termux-chroot package mentioned in
[https://wiki.termux.com/wiki/Differences_from_Linux](https://wiki.termux.com/wiki/Differences_from_Linux)
to see if /dev might work ?

~~~
wybiral
I still get "Permission denied" when I try to "ls /dev".

------
darklajid
In an ideal world I could purchase a (usb c) dock that has some connectors and
plug my awesome OnePlus 5 in to have a somewhat usable computer at home.

I know Samsung wants to do something like that now (but I won't ever again buy
a Samsung phone). I'd root (and pay) for a generic solution that makes my
phone usable on a big(ger) screen.

~~~
kybernetikos
Android phones have been able to connect to bluetooth or usb mouse and
keyboards since nearly the very beginning. The only thing 'missing' is the
screen. Samsung (and other) phones have supported external screens for many
years now, often via MHL (although, as you say the Dex dock now packages it
all together). I don't believe that the OnePlus5 supports external screens,
but I may be wrong. You might be able to get something working with network
screen casting.

~~~
darklajid
I know that, but connecting a keyboard or mouse to a phone is useless, the big
screen is crucial.

And while there were options to do that in the past, all were one-offs and
needed an extra port. So I guess we both agree about the capabilities that
exist(ed), but that is exactly the reason why I posted my "In an ideal world"
wish. There is no solution today as far as I'm aware. Which is a shame, given
the power that these smartphones have.

------
JJarrard
Been using this app for SSH and it's been amazing. Side note (not the most
optimized way), but want to run something in the background? $tmux $[run
command] $shift (volume down) + B, then d (detach virtual term) command is
running in tmux in background $tmux attach (to get back into the virtual term)
See their docs obviously.. but using a mobile terminal I've been using this
primarily for my tasks

------
4lch3m1st
Been using this for quite a while now, awesome app. Solved all my needs for a
decent SSH terminal, and even for running a pocket version of Emacs.

~~~
pksadiq
I tried this Emacs for org-mode. It was not that good experience. Very
recently I found orgzly[0]. It might be interesting for you too.

[0] [https://github.com/orgzly/orgzly-
android](https://github.com/orgzly/orgzly-android)

~~~
colordrops
Oh no way, orgzly is open source? I've been using it extensively but have been
very frustrated with the fact that it doesn't sync automatically. Time to git
clone...

~~~
gall
Or if you'd rather not fork, check out this write up of an approach to getting
Orgzly to sync via termux and Tasker: [https://2li.ch/home/syncing-org-
files](https://2li.ch/home/syncing-org-files)

------
haberman
Wow. Given that this works with ChromeOS, this appears to give me what I've
been looking for for a long time: something that makes a Chromebook a usable
developer laptop.

Now time to buy a Chromebook and try it out.

~~~
danjoc
Having tried it, it's an "almost there" solution. Termux is a proot, not a
chroot. This means you can't do certain things. You end up in a state where
you can run nodejs and react, but you can't run create-react-app successfully.
Rustup doesn't work in Termux, when it does booted into Linux on the same
chromebook. You can git clone, but you can't clone a repo from a USB stick.
Every single time I tried to do any development on it, the attempt ended in
"nearly works" frustrations.

~~~
haberman
That's a bummer to hear.

~~~
keganunderwood
I couldn't do bumpy and jupyter notebook Even though there are tutorials
online.

------
mordnis
If you plan on trying Termux, you should also look into Hacker's Keybaord:
[https://f-droid.org/packages/org.pocketworkstation.pckeyboar...](https://f-droid.org/packages/org.pocketworkstation.pckeyboard/)

In landscape mode, it provides all the keys found on a regular keyboard which
make life in a terminal easier (tab, ctrl, arrows, etc.).

EDIT: In Google Play Store:
[https://play.google.com/store/apps/details?id=org.pocketwork...](https://play.google.com/store/apps/details?id=org.pocketworkstation.pckeyboard)

------
hossbeast
If I open this on my phone, run vi <enter>, and type some text - how do I
input <escape> so I can say :wq ?

~~~
avhon1
Use an alternative keyboard, like Hacker's Keyboard.

[https://f-droid.org/packages/org.pocketworkstation.pckeyboar...](https://f-droid.org/packages/org.pocketworkstation.pckeyboard/)

------
sicelo
I use Termux a lot too, because the Nokia N900 spoiled me and taught me to use
Terminal on phone at all times.

Instead of Android + Termux, one can also look at Sailfish OS. You get all
that functionality by default. There's also PostMarket OS [1], which should
support at least some Android phones

[1] [https://postmarketos.org](https://postmarketos.org)

------
tjoff
I love termux. The only negative I can say is that I think touch keyboards are
a bit awkward doing terminal work. (note that termux has a few hidden
shortcuts such as when holding volume up wasd becomes arrow keys etc.)

I use the termux widget to give me one-click access to a bunch of rsync over
ssh commands. It is the best backup solution for android I've ever come across
(this can also be automated with apps such as tasker or automate). Using rsync
I also have two-way syncing for some folders so that I can easily put a file I
want on my phone on my nas and then just sync it.

I always felt the rsync apps on the play store to be extremely clunky and when
not wanting to go through a cloud the alternatives are limited. But this works
perfectly.

edit: Also, being able to SSH into my phone and manipulate using a real
keyboard and bigger screen is quite pleasant.

~~~
jingsam
You need to use Hacker's Keyboard
[https://f-droid.org/packages/org.pocketworkstation.pckeyboar...](https://f-droid.org/packages/org.pocketworkstation.pckeyboard/)

~~~
tjoff
Thanks, but I'm not a fan of hackers keyboard, maybe it is worse because I use
a nordic layout but I barely find it usable in portrait mode (which is what I
almost exclusively use).

~~~
jonny789
There is Gesture and key actions option inside Hackers keyboard options that
allows to switch keyboard layout using Volume keys.

------
dredmorbius
I've been using Termux for about a year and a half now, and can very honestly
say that it is the single best and most useful capability I've yet found on
Android.

I can _also_ say that it's not entirely there, and has a number of significant
limitations as compared to a full-featured Linux desktop or laptop.

My equipment: A Samsung Galaxy Tab A 9" tablet, with a Logitech "Type-S" self-
supporting folio case/keyboard combination. _I have major reservations against
both pieces of hardware and can recommend neither on the basis of
capabilities, vendor support, and artificially-imposed limitations._

That said, the _form factor_ , _display_ , and _battery performance_ are
exemplary. The tablet runs virtually all day on a charge, the keyboard for
months, under heavy use. I've long sought a highly-flexible, lightweight,
portalbe, long-battery-life system, and in terms of the fundamental physical
package, this is almost completely there.

The keyboard has had physically-damaged keys since the beginning, Logitech
first refused, then temporised, and finally claimed it did not _have_ a
suitable replacement product. (Why a keyboard/case should be dependent _at the
model-number level_ with specific hardware kit is entirely beyond me, and
shows a desperate need for industry standardisation.)

Samsung's Tab A has proved resistant to rooting or re-ROMing, _including the
ability to make a back-up of the system prior to such activities so as not to
lose critical data_ in ways that can only be described as deliberately user-
hostile. I was not aware of this at the time I purchased the device, under
exigent circumstances, and would not do so again.

Termux allows breaking out of many of the limitations of the Android
"ecosystem" (I prefer to think of it as a toxic waste dump, but that's another
story.) Be aware that Termux itself has a number of components, _including_
base Termux, the Termux API Android App, the Termux package repository (based
on app), and multiple third-party repos (e.g., pip for python). Collectively
these provide a basic terminal environment, nearly 800 packages (a small count
by Linux standards, but a surprisingly useful selection), and many more
utilities through third-party utilities.

 _Not_ provided are a system root, full access to external storage media (I
have a 128 GB microSD card, but can only make very limited use of it thanks to
Android stupidity), or full access to the Android side of the house, though
some interactions, including application intentions and clipboard interaction,
_are_ supported _and are tremendously useful._

Another major limitation of Termux appears to be its terminal implementation
itself. This is good so long as you're going forward, but is _painfully_ slow
in any back-navigation actions -- e.g., scrolling backwards in less and other
pagers. Delays can be _of many seconds._ I've learned to quit out of files and
re-open them from the start rather than going backwards. Experimenting from
other Android console apps suggests this is a fault within Termux itself.

I've also had many lag and freeze issues using Termux for remote SSH access --
it's OK for quick or noninteractive (e.g., remote command-execution)
interactions, but _not_ for prolonged SSH sessions. This is tremendously
disappointing as Termux, unlike other SSH tools I've used, _doesn 't_ map the
<back-navigation>/<esc> key to "navigate out of the application". Critical
when editing files in vim, and making apps such as SSHBot entirely useless.

I've found the community and developers helpful (excepting the two major
issues above, I've seen multiple small issues fixed rapidly), and again,
compared to the sheer uselessness of stock Android as a Real Computing
Platform, this is a transcendental leap.

But it's Still Not Full Linux, and if that's what you're hoping for, you'll be
disappointed.

On that point: Samsung shocked the motherlovin' stuffin' out of me last week
in announcing (and reported here on HN) that they would be supporting full
Linux distro installation on future Android devices. That would be a welcome
development.

 _Stuff that absolutely rocks under Termux_

Bash for file management. _Every goddamned Android file manager in existance
sucks balls._

mps-youtube. Install via pip. Provides console-mode, backgroundable, youtube
video access. mps and mvs are related applications which can play other remote
or local audio and video files (generally just the soundtrack). _Media can be
backgrounded, lists can be compiled and saved, content can be downloaded, and
much, much, much more._

The Termux-API App. This provides access to the clipboard, application
intents, and various Android capabilities. _You need to install the "termux-
api" package as well under apt._ The ability to find specific files (say, from
my 6k+ PDF library) _and launch them to a PDF reader_ is just ever-so-slightly
useful. (The degree of fail of Android Apps in this space is ... staggering.)

APT. God I've missed this.

vim, emacs, python, perl, ruby, ... An amazingly complete package set.

SSH. Limitations noted, it's vastly superior to App-based SSH clients.

~~~
bitwize
I've never had the issues you mention with Termux's terminal emulator, but
usually I run tmux inside Termux, so you may wish to try that and see if it
doesn't improve things a bit.

~~~
dredmorbius
I have, locally and remotely, most especially in less.

Using the Termux ssh daemon and connecting to localhost from another Android
terminal app or SSHBot doesn't exhibit the problem. I've got a github issue
open.

~~~
bitwize
Well, if you've seen it you've seen it. I was suggesting a workaround in the
form of tmux inside your termux session.

~~~
dredmorbius
Noted, I'll give it a shot. Haven't much looked at tmux given long-term use of
screen.

------
edoceo
I use this when teaching Linux. Let's people quickly get comfortable in a
shell

------
pryelluw
I installed this months ago and cant figure out how to access localhost
through my browser. I wrote a sample flask app and ran it but cant access it
outside of termux. Is there a way to do so?

~~~
hyperpallium

      python3 -m http.server
      http://localhost:8000/  # on phone
    

However, I haven't been able to access a server running on termux on my phone
from anywhere else. I suspect servers are blocked by my mobile ISP (makes
sense!), but I never got to the bottom of it.

Should work over wifi though.

~~~
icebraining
_I suspect servers are blocked by my mobile ISP (makes sense!), but I never
got to the bottom of it._

Many mobile ISPs run NAT, you don't even get a public IP of your own during
the session, just an internal one.

~~~
hyperpallium
Thanks! Is there a way to do it? It must support bi-dir streams, they just
need to be initiated from the phone.

~~~
icebraining
You can use a tunnel like [https://pagekite.net/](https://pagekite.net/) it
seems they support Android.

Alternatively, you can DIY by connecting to some other machine using SSH and
establishing a reverse tunnel.

------
shams93
This has made my pixel c still very useful although its going to make the
linux development story on chromebooks far more secure, before android apps
you had to put your system into insecure developer mode. If you need GUI based
linux apps then you still will need to either convert a windows machine to
linux or run in insecure mode. While running a terminal on your phone might
have limited usefulness running a terminal on an android tablet or chromebook
with android support is very useful for development.

------
flyinghamster
Argh. One of my old phones in my collection is a Samsung Galaxy S Relay "4G"
(the 4G in quotes because it was DC-HSPA rather than LTE). It would be a
perfect candidate for Termux, being a QWERTY slider.

Unfortunately, it's on CM11 (KitKat), and thus not compatible. Between the
collapse of CyanogenMod, LineageOS not picking up the Relay, and the limited
specs by today's standards (1G RAM, 8G storage, dual-core CPU), I don't think
there's any real future for this handset except as a curio.

------
joshumax
Hey, I ported apt to Android 4.4 a while back and was hoping to eventually get
to design it in a way that it would be a suitable backend for a third party
app store that could also safely install core components and patches to phones
that allowed it. My main goal was to eventually get Android split up into a
collection of packages much like a modern Linux distribution in order to
improve security and upgradeability. I'm glad to see termux is taking the
first steps towards this :)

------
tambourine_man
This is amazing. I've been dreaming of something like this forever for the
iPhone. iOS restrictions are probably never going to be lifted, however.

I get by with Panic's Coda terminal, which is great, but even though I have
multiple remote servers, sometimes I'd like to run something on my local
network, like ping, wireshark, etc

Running mutt as a local mail client would be nice as well

~~~
tbodt
I'm currently developing something like this for iOS, and I hope to have a
basic proof of concept in the app store by the end of the year.
[https://github.com/tbodt/ish](https://github.com/tbodt/ish)

~~~
tambourine_man
Nice Theodore, best of luck!

------
stuaxo
This is really not too bad at all. I had a go on an Android Tablet. What got
in the way was Android itself and the weak hardware.

------
JepZ
While I love Termux too, I find it really sad that we need such a project to
have a usable cli on Android. Google hackers should know better, than to
deliver such a stripped down Linux.

I mean we have seen that mobile operating systems can bring a decent toolset
by default as Meamo did (don't know about tizen?!?).

------
Tepix
This will be amazing on the Gemini
([https://www.indiegogo.com/projects/gemini-pda-android-
linux-...](https://www.indiegogo.com/projects/gemini-pda-android-linux-
keyboard-mobile-device-phone))

~~~
piahoo
if it only had "normal" phonecalls (with placing next to an ear) I would
bought it right now. Damn, I miss physical-keyboard phone so much

------
mjmein
This works pretty well with Spacemacs and org-mode as well. The "space" key
based navigation is a good fit for touch keyboard.

Not for heavy use, but for quick notes and calendar checking.

I ssh into my home server and drive my spacemacs instance from there.

------
xerosanyam
Did anyone think of/tried running Pi-hole on it? [https://pi-
hole.net/](https://pi-hole.net/)

------
mattacular
Great project. You can install Termux on any Chromebook capable of running
Android apps and use it as a dev environment.

------
lin0tune
Just want to say thanks to the dev, working great on my BlackBerry Priv with
Right Shift mapped to Ctrl.

------
linenumber
Is there similar iOS alternative?

------
gcoda
nodejs, vuejs and webpack, android splitscreen, live development on my phone
like a charm, also got neet colors, and widgets to launch scripts. Awesome
project, i was surprised that it worked 'out of the box'

------
muthdra
I've been using this for years. USB OTG and a keyboard really help.

------
Giti
They also got metasploit-framework which is kinda awesome

------
musashizak
Node.JS and node-red van run inside an android phone

------
alexnewman
Just wish they had keybase

