147 comments

[ 3.6 ms ] story [ 223 ms ] thread
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.
I use this when teaching Linux. Let's people quickly get comfortable in a shell
They should get nix working in there. That would be catastrophic!
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.
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

I use it more for programming quick scripts and handling source code that people happen to send me over Telegram -- it even integrates well as a system editor. I'll take a look at orgzly, thanks.
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...
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

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)
I run our clubs website using Jekyll. With this I could make a quick change to a markdown file and push it if I needed to update while out and about.
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...

Great link. It's got Apache! Always wanted to run a web server on my phone.
You might also look at Servers Ultimate Pro from Ice Cold Apps. It has.... many servers. Perhaps too many. Perhaps enough that it looks like a "Hold my beer" response to a question about how many servers could actually be compiled for Android.

I wouldn't run most (any?) of them on a connection exposed to the real world, but at least in theory if you want to run an AAMP stack I believe you could, though on a quick glance you might actually have to be content with Nginx. You can also provide your own little bit of Gopherspace if you so desire.

This makes chromebook all that more appealing now I slightly regret selling my old one
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

Termux works on stock chromebooks _without_ switching to developer mode.
This is very important for schools which may lend students Chromebooks and thus likely restrict dev mode.
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.
Yeah, that's a valid question. I do use it on a phone and I don't think a phone's on-screen keyboard is suited for programming or heavy terminal use, but I've used termux for small things that I need to do when away from home. For example, rsyncing music from a server to the phone so I can listen to it, or fixing the config file in RetroArch with Vim, since sometimes fiddling with options can get it into a state where it needs an external text editor to fix, and Vim is easy to use on a restricted keyboard.
I use it as a replacement for Android apps in several cases.

- Need to jot a note: vim is far better than most native apps

- Need to access a remote system: use ssh or mosh

- Need a calculator: Python is there, with a lot of useful libraries

It even emulates a mouse, so elinks is quite usable on text heavy websites. For some mobile hostile websites it is more usable since the text is large enough to be legible.

A similar user friendly tool are the widgets, which makes it easy to launch a command from the launcher with a tap.

Given the number of development tools available, it is quite easy to write a program on the computer and run it on a mobile device.

Do you do vim with Gboard/SwiftKey or do you have a hardware keyboard?
If you're doing much with Termux or SSH to other systems (or roguelikes), you should probably look into Hacker's Keyboard (https://play.google.com/store/apps/details?id=org.pocketwork...). If you miss the autocompletion aspect, there are multiple companion dictionaries that you can load as well for various languages.
Just wish that compact 5 row would get some more love.

Switching it to anything but english to make use of dictionaries makes potential special characters vanish from the long-press popups...

I tried hacker's keyboard but didn't find it as good as the keyboard built in JuiceSSH. All the special keys important during a ssh session like Ctrl, Tab, arrow keys are very conveniently placed. I am yet to find a soft keyboard that good.
In termux, swipe from the left and long press the keyboard button to get those keys.
An on screen keyboard is fine for vim, at least for things light duty tasks. I use the one provided by my phone's vendor (it provides the number row) and Termux offers a row of common keys that usually gets the job done.

I also find that vim is easier to use for editing than Android editors. It is easier to use insertion, movement, and deletion commands instead of trying to tap on the right position or dragging to select.

I used it for SSH and scripts like youtube-dl. Also for the short time that I played Pokemon Go, I deployed a flask server (to track pokemon overlayed on gmaps) in termux and accessed it from Android's browser. It was sweet.
If you're using youtube-dl, take a look at mps-youtube (a Python application, install via pip).

Search, download, and play video (or soundtrack) interactively from console. Manage playlists (and save them permanently, locally), etc. Very impressive app.

I mainly use it to run vi for small notes (i don't think it has full vim by default). I'm not really a vi fan (i used vim at the past, but today vi in termux is the only vi i use) but i just couldn't find any note taking application that i liked.

I also run mc sometimes.

Btw i use it with "Hacker's Keyboard", although the only reason i use that is because it has an esc key :-P.

Termux + full keyboard is a game-changer. That's how I run my 9" tablet, and whilst not quite the laptop-replacement I'd like it to be, it's closer than anything else I've seen. The fact that I don't have the critical weak point of the laptop hinge to deal with, and the portrait/landscape flexibility of a tablet (I read a lot of formatted docs) is tremendously useful.

TL;DR: Your Android device really is a fully-capable computer, if the goddamned vendors will just get out of your goddamned way.

what keyboard do you recommend?
You can pretty much use any keyboard you want with USB. I used to use my tablet with one of those usb thinkpad keyboards - thin and easy to carry around.

For my phone - I looked at some folding Bluetooth keyboards on aliexpress which /look/ nice but at ~$30 it's a little steep for something that might be crap and end up never used/trashed. Maybe on Nov 11th i'll bite the bullet if there is a good sale.

Just search "folding keyboard" on ali.

None.

This is a major frustration point for me, as I'm working with a keyboard that's missing one physical key and has two others which only intermittently generate the requested character(s). I have ... workarounds, but they're frustrating.

I've written about this at more length than is good for either my sanity or its reputation here:

https://ello.co/dredmorbius/post/lqgtwy_rhsfbdh5cdxb1rq

Upshot: industry standardisation on device sizes, case attachments, and keyboard layouts would be an exceedingly good thing. The pictured keyboard/case (a Logitech device) seems to be among the better general options, though I question its attachment hardware.

Again, given the near-ideal nature of the form-factor, the industry fuckwittedness here is pretty staggering. I've spent more time than I care to think combing through Amazon, Newegg, and other shopping sites (product descriptions themselves make this tedious), and through various online forums and discussions.

The ability to pretty-much instantly, and without concern, switch between keyboarded/landscape and touchscreen/portrait modes is exceptionally useful. "Kickstand" type cases, and loose keyboards, don't offer this, or the ability to use the device in my lap (as I am now) as well as on a table or desk, or (in tablet mode) freestanding.

http://archive.is/FYE7D

Much as I don't care for iOS devices, the standardisation and sales volume Apple have attained make for a far superior accessories market than Android. The killer there is the lack of a true compute environment (shell, dev tools) on iOS.

Other options include laptops (including hybrids), though for my use case (many, many, many formatted documents), landscape-mode-only is a tremendous negative, and I am exceedingly averse to all-in-one, hinge-based designs. (For all its faults, Bluetooth doesn't physically wear.)

Mostly I play Old Man Yells At Clouds.

I have a set of scripts that work on my local network, as well as arbitrary useful commands.

E.g. I can control the volume of the radio via a simple ssh command that turns the media center volume down. Termux has an additional extension that lets you map arbitrary scripts to a button / widget on the android home screen.

Mostly for tablets, I suspect, though I do occasionally restart servers etc. from my phone but that tends to be via an ssh connection so I don't need a "local" userland...

But the replacement for my recently-dead Chromebook is an Android tablet/notebook hybrid (detachable keyboard), and while it's not comfortable, it does provide a tolerable alternative for when I don't want to drag my 17" laptop around.

Going to reply to myself as it's too long so I can't edit: Installed Termux and the API package and widget, and the API package (paid) has me tremendously excited. Not because it's all that advanced, but between the ability to open quick little dialog boxes to collect text, and the widgets ability to spawn them from a button, it just looks amazingly useful to automate quick little tasks without going down the particularly hellish route that is full app development for mobile...
I used it on my phone to run mp3Gain to adjust some mp3's volume, and I've also use it to write and run a couple of short C programs (not more than 20 lines of code) I had in mind. It's good also if you need to quickly SSH to a server and you can easily use your RSA key if you have one.
> What exactly would you use it for?

Give me an Android tablet, Bluetooth keyboard, this and Emacs...

And you’ll be surprised at what I can accomplish.

(You'll find patches to pretty big projects around the world which I've delivered this way :) )

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?
(comment deleted)

  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.

I tend to run:

    python -m http.server 0.0.0.0:8000
That should allow you to access it externally.
Just tested it and wont work.

Edit:

Works if you just run:

    python3 -m http.server
Thanks for the help

Edit[1]:

Works great with python's built in web server but wont work with flask's built in development web server.

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.

Thanks! Is there a way to do it? It must support bi-dir streams, they just need to be initiated from the phone.
You can use a tunnel like 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.

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.

> Sometimes I forget that these devices are just little computers!

When vendors try so hard to lock everything down, yes, users tend to forget about what you can do once you have freedom to do what you want with your device.

(comment deleted)
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.

Maybe a stupid question but why not just run Debian on a chrome book, or any cheap laptop? Or spend a bit more for a thinkpad or dell XPS
Because I don't want to be a sysadmin. I want to take advantage of all the work Google has done to make ChromeOS a slick user experience, including good drivers, seamless and invisible auto-update, fast boot, integration with Google services, etc.
Don’t know why you are being downvoted- this is the exact reason I bought a Mac, can totally sympathize. I hear the dell and thinkpad have this problem solved from the driver point of view at least though.
It's false that you have to be a sysadmin to run Linux, and the users here know it perfectly well. There hasn't been a laptop (or desktop for that matter) I owned in the past ~8 years that hasn't worked flawlessly out of the box on the latest Ubuntu/Linux Mint (granted, with the exception of dedicated GPU drivers). And I got everything you mentioned: slick UX, good drivers, auto updates, fast boot on SSD. Granted, no integration with Google services, and I consider that a feature. I also have this little extra:

Owning my computer, as opposed to paying for it to be controlled by Our Benevolent Overlords.

With fedora and gnome, I don't even dnf upgrade anymore. When I turn of the computer, I just check "install updates" which is unchecked by default. This is how updates should work.
I don't think this sort of bottom-up approach will make you happy, though. You never know what kind of technology you need tomorrow and whether your Chromebook allows you then to handle that. And fixing that then is not possible, not with a bit of sysadmin work.
> I don't want to be a sysadmin

Hence "run Debian on it". The whole reason to run a Linux distribution is that the maintainers do most the sysadmin work for you, and Debian maintainers are among the most skilled sysadmins you can find.

You have to keep your filesystems from being full, but apart from that things will Just Work as long as you stay within the Debian tooling.

> Debian on a chrome book

Easier said than done, Chromebooks aren't "computers" in the sense that you could easily or natively install Windows/Linux.

ChromeBooks run ChromeOS and often don't even have a BIOS, thus to shoehorn a different OS requires installing SeaBIOS when it isn't present.

They're more like an appliance, though GalliumOS[0] works on (most?) x86 Chromebooks.

[0]: https://galliumos.org

Why is the definition of a computer suddenly dependent on whether or not you can "easily" install Linux or Windows on it?
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.
That's a bummer to hear.
I couldn't do bumpy and jupyter notebook Even though there are tutorials online.
I can run create-react-app. just be sure to change npm's global directory.
Just a warning, unless you get a "free" Chromebook from a hacker friend you're looking at probably $100 for a new one.

In the end you're way better off with a beater $50 eBay thinkpad like my favorite x201. Which supports LibreBoot, is a repairable real computer.

Thick is the new thin.

$50? Nice find. I have come in possession of a t42 with a cracked display. I've set it up so I can ssh into it but it seems not worth the hassle because 1GB RAM and core2duo (afaik) processor. What is your setup and use case if you don't mind sharing.
> $50

If not cheaper, they're sometimes lacking AC adapter and/or drive caddy but that's maybe another $20.

X201 (not the tablet x201s) is i5/i7 12", enough pep for my needs, also you can get DisplayPort and modular UltraBay for optical with the optional dock thing.

The "dock" actually latches on and can even charge a standby battery with the most awkward external connector ever, if you desire extra thickness in your laptop, and frankly who doesn't.

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

There's someone working towards this as part of the Blink app for iOS: https://github.com/blinksh/blink/pull/281

I could see this getting onto the app store eventually.

Didn't know about blink, thanks. They get around the “no forking” limitation by turning everything into a function, it seems. Running CoreUtil is what I wanted, a port of BusyBox, basically.
Great project. You can install Termux on any Chromebook capable of running Android apps and use it as a dev environment.
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.

I use it for git repository hosting and I like its power efficiency.
I've tried using a phone as a server in a similar fashion in the past, and found it to be too unstable and unreliable. With a Pi (at least, any Pi made since the Model B+ revision) stability and robustness is not an issue, however I've tried repurposing several Android devices from various manufacturers and they always end up rebooting themselves at inopportune times, or locking up, or the server app I'm using constantly crashes. By contrast, I've had the same RPi 3 running nonstop for nearly a year as a camera server.

I think it's more to do with the Android OS itself rather than the hardware, but I could be wrong. It's possible the SoC was overheating on those phones from the extended duty cycles; they simply aren't designed for much more than sporadic use.

I remember the idea of "cellphone as a server" being around as far back as in Symbian times. Nokia Mobile Web Server, more than just an idea, actually was an Apache port capable of loading modules and running Python scripts on your phone (e.g. in order to access the camera) and serve dynamic pages on your DDNS-reachable mymobilesite.com subdomain.

The original project website appears to have been axed, but there's still traces of people who used to talk about it: http://www.allaboutsymbian.com/features/item/Previewing_Noki...

>MWS, in its default install, comes with a default pre-configured web site which has a number of functions, including a guestbook, a blog, the ability to send SMS messages to the phone, share Calendar information, view contact information and access the phone's camera.

If I open this on my phone, run vi <enter>, and type some text - how do I input <escape> so I can say :wq ?
you a a terminal-friendly keyboard for that. Get one on Fdroid.
Some keyboards, like "hacker keyboard" (f-droid) have an escape key.
Press Vol+ and 'e'
Swipe from the left. Long press on keyboard -> you get a toolbar for special keys.
(comment deleted)
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 :)
I've used this for a while, it's good.
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.

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).
There is Gesture and key actions option inside Hackers keyboard options that allows to switch keyboard layout using Volume keys.
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.

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...

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.
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.

Well, if you've seen it you've seen it. I was suggesting a workaround in the form of tmux inside your termux session.
Noted, I'll give it a shot. Haven't much looked at tmux given long-term use of screen.
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).

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

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