My Journey with Termux
How I turned my phone into a coding machine using Termux, npm, and zsh - complete with all the problems I faced and how I solved them
Setting Up a Proper Dev Environment on Android
Look, I’ll be honest with you - I don’t have a laptop or PC. And like many kids who got interested in coding, I had this ridiculous thought that if I downloaded some “hacking apps” and used them, I’d magically become a hacker overnight. Yeah, I know, pretty childish thinking 😂😅
But that’s actually how I discovered Termux.
The Beginning: From Play Store to F-Droid
I started my Termux journey by downloading it from the Play Store. At first, I didn’t even know what F-Droid was. I just opened Termux, saw a black screen with a terminal, felt like a hacker, and… had absolutely no idea what to do next.
After spending some time in the community and reading forums, I realized something important: the Play Store version of Termux is outdated and no longer maintained. The real, actively developed version lives on F-Droid.
So here’s what you need to do:
Step 1: Get Termux the Right Way
- Uninstall the Play Store version if you have it
- Download F-Droid - it’s like an alternative app store for open-source apps
- Search for Termux in F-Droid and install it
- Also grab Termux:API and Termux:Widget while you’re at it (you’ll thank me later)
Why F-Droid? Because that’s where the devs actually update Termux. The Play Store version is basically dead.
Setting Up the Basics
Once you’ve got Termux installed, open it up. You’ll see a terminal. First things first:
# Update package lists
pkg update
# Upgrade existing packages
pkg upgrade
Type y when it asks for confirmation. This might take a while on the first run.
Installing Node.js and npm
Now here’s where things get interesting. I needed npm because I wanted to work with modern web dev tools - Astro, TypeScript (tsx), and all that good stuff.
# Install Node.js (this includes npm)
pkg install nodejs
Wait for it to finish, then verify:
node --version
npm --version
If you see version numbers, congrats! You’re good to go.
Common Problems I Faced with npm
Problem 1: “Cannot find module” errors
Sometimes npm packages would install but then throw module errors. The fix? Clear the cache:
npm cache clean --force
rm -rf node_modules
npm install
Problem 2: Permission denied errors
Never, and I mean NEVER, use sudo in Termux. It doesn’t work the way you think. Termux runs in its own isolated environment. If you’re getting permission errors, it’s usually because you’re trying to install something globally without the -g flag, or you need to use:
npm install -g package-name
Problem 3: Native modules failing to compile
Some npm packages need to compile native code. If you get errors, you might need:
pkg install python
pkg install build-essential
pkg install binutils
Making It Beautiful: Setting Up Zsh
Okay, so now you’ve got a working terminal, but it looks boring. Let’s fix that.
# Install Zsh
pkg install zsh
# Install git (you'll need this)
pkg install git
# Install Oh My Zsh (this is where the magic happens)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
When it asks if you want to make zsh your default shell, say yes.
Oh My Zsh Plugins I Actually Use
Edit your .zshrc file:
nano ~/.zshrc
Find the line that says plugins=(git) and change it to:
plugins=(
git
npm
node
zsh-autosuggestions
zsh-syntax-highlighting
)
But wait - those last two plugins need to be installed first:
# zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Restart Termux, and boom - you’ve got autocomplete suggestions and syntax highlighting.
Theme Time: Powerlevel10k vs Starship
I’ve tried both, and honestly, both are amazing.
Powerlevel10k (What I Used Before)
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Then edit .zshrc:
nano ~/.zshrc
Change the theme line to:
ZSH_THEME="powerlevel10k/powerlevel10k"
Restart Termux and run through the configuration wizard. Powerlevel10k is beautiful - seriously, it’s one of the most gorgeous terminal themes out there. Lots of customization options.
Starship (What I Use Now)
But here’s what I use currently - Starship:
# Install Starship
curl -sS https://starship.rs/install.sh | sh
Add this to your .zshrc:
echo 'eval "$(starship init zsh)"' >> ~/.zshrc
Why Starship? It’s faster, cross-shell compatible, and super minimal. But honestly, you can’t go wrong with either. Powerlevel10k is more feature-rich and pretty, Starship is lightweight and modern. Your choice!
What I Actually Do with This Setup
So now I’ve got this setup, what do I do with it?
- Web development: I work with Astro, build static sites, test stuff
- TypeScript projects: tsx works perfectly fine in Termux
- Git work: I contribute to some organization repos, push code, manage branches
- Package management: npm, npx - all the usual workflow stuff
- Quick scripts: Python, Node.js scripts for automation
Yeah, I’m doing real development work from my phone. Is it ideal? Absolutely not.
The Hard Truth About Mobile Development
Here’s what nobody tells you: you won’t get the real coding experience without a PC.
There, I said it.
Mobile development with Termux is amazing for:
- Learning
- Quick fixes
- Small projects
- Contributing on the go
- Testing ideas
But for serious, long-term development? You need a proper computer. The screen is small, typing on a phone keyboard gets tiring, running heavy builds drains your battery, and some things just don’t work the same way.
However, for mobile users who want to code, Termux is the best thing that exists. It’s not perfect, but it’s incredibly powerful for what it is. I’ve learned so much just by having access to a real terminal environment on my phone.
Useful Links and Resources
Storage Access (Important!)
If you want Termux to access your phone’s storage:
termux-setup-storage
Grant the permission when asked. Now you can access ~/storage/ to get to your phone’s files.
Final Tips
-
Use a keyboard: Get a Bluetooth keyboard or use Hacker’s Keyboard from F-Droid. The regular phone keyboard is painful for coding.
-
Get Termux:Widget: Lets you run scripts from your home screen. Super convenient.
-
Session management: Learn to use
tmuxorscreenfor managing multiple terminal sessions:pkg install tmux -
Backup your setup: Your
.zshrc,.bashrc, and other config files. Trust me on this. -
Don’t expect miracles: Termux is powerful but has limitations. Some packages won’t work, some builds will fail. That’s just how it is.
That’s my journey with Termux so far. Started as a kid thinking I’d become a hacker, ended up actually learning real development. Not the path I expected, but I’m not complaining.
If you’re in a similar situation - no PC, just a phone and the desire to code - give Termux a shot. Just manage your expectations, be patient with the learning curve, and remember: this is a starting point, not the destination.
-Ashikur sheikh shoudo