11 ms·
Termux: terminal emulator and Debian-style userland as an Android app
- shams93 9y agoThis 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.
- edoceo 9y agoI use this when teaching Linux. Let's people quickly get comfortable in a shell
- unlmtd1 9y agoThey should get nix working in there. That would be catastrophic!
- 4lch3m1st 9y agoBeen 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 9y agoI 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
- 4lch3m1st 9y agoI 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.
- colordrops 9y agoOh 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 9y agoOr 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
- rossy 9y agoI 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 9y agoWhat 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)
- wazanator 9y agoI 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.
- iamcwu 9y agoChromebook I'm still waiting for Amazon to restock after I saw this post go up: https://blog.lessonslearned.org/building-a-more-secure-development-chromebook/ https://blog.lessonslearned.org/building-a-more-secure-devel...
- tambourine_man 9y agoGreat link. It's got Apache! Always wanted to run a web server on my phone.
- fencepost 9y agoYou 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.
- pryelluw 9y agoI 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?
- deleted 9y ago[deleted]
- hyperpallium 9y agopython3 -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.
- npolet 9y agoI tend to run: python -m http.server 0.0.0.0:8000 That should allow you to access it externally.
- pryelluw 9y agoJust 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.
- icebraining 9y agoI 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 9y agoThanks! Is there a way to do it? It must support bi-dir streams, they just need to be initiated from the phone.
- wybiral 9y agoNeat! 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 9y agoCool!. Was that a non rooted phone?
- wybiral 9y agoYep, just a standard Pixel.
- ekianjo 9y ago> 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.
- deleted 9y ago[deleted]
- haberman 9y agoWow. 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.
- mattnewton 9y agoMaybe 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
- haberman 9y agoBecause 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.
- mattnewton 9y agoDon’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.
- andrepd 9y agoIt'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.
- keganunderwood 9y ago
- linenumber 9y agoIs there similar iOS alternative?
- tambourine_man 9y agoThis 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 9y agoI'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 9y agoNice Theodore, best of luck!
- goerz 9y agoThere's someone working towards this as part of the Blink app for iOS: https://github.com/blinksh/blink/pull/281 https://github.com/blinksh/blink/pull/281 I could see this getting onto the app store eventually.
- tambourine_man 9y agoDidn'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.
- mattacular 9y agoGreat project. You can install Termux on any Chromebook capable of running Android apps and use it as a dev environment.
- eltoozero 9y agoI 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 9y agoCan I create script which snaps a photo let's say every minute? Basically, is camera available through terminal?
- girst 9y agoYes. https://termux.com/add-on-api.html#termux-camera-photo https://termux.com/add-on-api.html#termux-camera-photo
- bohrshaw 9y agoI use it for git repository hosting and I like its power efficiency.
- morganvachon 9y agoI'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.
- noisem4ker 9y agoI 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_Nokias_Mobile_Web_Server.php 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.
- hossbeast 9y agoIf I open this on my phone, run vi <enter>, and type some text - how do I input <escape> so I can say :wq ?
- rd_o 9y agoPress Vol+ and 'e'
- ekianjo 9y agoyou a a terminal-friendly keyboard for that. Get one on Fdroid.
- avhon1 9y agoUse an alternative keyboard, like Hacker's Keyboard. https://f-droid.org/packages/org.pocketworkstation.pckeyboard/ https://f-droid.org/packages/org.pocketworkstation.pckeyboar...
- deivid 9y agoSome keyboards, like "hacker keyboard" (f-droid) have an escape key.
- Aissen 9y agoIt's actually one small thing ConnectBot has over Termux: embedded help, in particular, you want to look at this page: https://termux.com/touch-keyboard.html https://termux.com/touch-keyboard.html In fact, there's an issue about this: https://github.com/termux/termux-app/issues/184 https://github.com/termux/termux-app/issues/184
- stewbrew 9y agoSwipe from the left. Long press on keyboard -> you get a toolbar for special keys.
- growt 9y agohttps://termux.com/touch-keyboard.html https://termux.com/touch-keyboard.html here is a list of build-in keys that you can reach with volume up and down keys
- alexnewman 9y agoJust wish they had keybase
- deleted 9y ago[deleted]
- joshumax 9y agoHey, 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 :)
- rootw0rm 9y agoI've used this for a while, it's good.
- tjoff 9y agoI 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 9y agoYou need to use Hacker's Keyboard https://f-droid.org/packages/org.pocketworkstation.pckeyboard/ https://f-droid.org/packages/org.pocketworkstation.pckeyboar...
- tjoff 9y agoThanks, 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 9y agoThere is Gesture and key actions option inside Hackers keyboard options that allows to switch keyboard layout using Volume keys.
- mjmein 9y agoThis 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.
- dredmorbius 9y agoI'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.
- Tepix 9y agoThis will be amazing on the Gemini (https://www.indiegogo.com/projects/gemini-pda-android-linux-keyboard-mobile-device-phone https://www.indiegogo.com/projects/gemini-pda-android-linux-...)
- piahoo 9y agoif 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
- terrywang 9y agoTermux 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 9y agoWhere do you find the paid add-ons?
- edjw 9y agohttps://play.google.com/store/apps/developer?id=Fredrik+Fornwall https://play.google.com/store/apps/developer?id=Fredrik+Forn...
- terrywang 9y agoHighly recommend the Termux:Styling, most well known color schemes are available. The others are Boot, Widget, Fload, Task. Buy if you need or have $ to spare ;-)
- sicelo 9y agoI 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
- JJarrard 9y agoBeen 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
- stuaxo 9y agoThis 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.
- jeromenerf 9y agoTermux 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.
- jstimpfle 9y agoMake a separate ssh key for your phone with restricted sftp-only access to a phone-specific backup directory on your server.
- hsivonen 9y agoWhat's a good tutorial for restricting sftp access to a particular directory? (Assuming the same host supports ssh login, too.)
- jstimpfle 9y agoAssuming openssh-server, look for "internal-sftp" in sshd_config(5). And of course, also google a bit around that. It's worth pointing out that this will preclude use of rsync and similar tools that require running a server on the remote machine. I'm not aware of robust alternatives so if anyone else knows one please tell me! (and I consider rsync-restricted shells and similar approaches a hack)
- gcoda 9y agohow about running OpenSSH inside docker with bind mounts?
- darklajid 9y agoIn 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 9y agoAndroid 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.
- rkeene2 9y ago"Sentio" is selling the SuperBook which is a sort of universal dock for smartphones. It works by adding a video card over USB (DisplayLink).
- darklajid 9y agoThat sounded nice, their website looks cool. Unfortunately that is unreleased/only available for pre-order. And in a very limited subset of the world: "Available for pre-order in the US, Canada, and Mexico"
- darklajid 9y agoI 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.
- JepZ 9y agoWhile 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?!?).
- gcoda 9y agonodejs, 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'
- mordnis 9y agoIf you plan on trying Termux, you should also look into Hacker's Keybaord: https://f-droid.org/packages/org.pocketworkstation.pckeyboard/ https://f-droid.org/packages/org.pocketworkstation.pckeyboar... 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.pocketworkstation.pckeyboard https://play.google.com/store/apps/details?id=org.pocketwork...
- Giti 9y agoThey also got metasploit-framework which is kinda awesome
- muthdra 9y agoI've been using this for years. USB OTG and a keyboard really help.
- musashizak 9y agoNode.JS and node-red van run inside an android phone
- lin0tune 9y agoJust want to say thanks to the dev, working great on my BlackBerry Priv with Right Shift mapped to Ctrl.
- xerosanyam 9y agoDid anyone think of/tried running Pi-hole on it? https://pi-hole.net/ https://pi-hole.net/
- flyinghamster 9y agoArgh. 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.