
How to Turn Your Android Phone into an Online Server Using Termux and Tailscale
Person A:
Hey! I heard you turned your Android into a real server that you can access from anywhere using Termux and Tailscale. 😮 How did you even do that?
Person B:
Haha, yes! It’s easier than you think. Let me explain everything step-by-step, like we’re just chatting. 😄
First, all I needed was:
-
My Android phone 📱
-
The Termux app installed (from F-Droid or PlayStore)
-
A little knowledge of Linux basics
-
And Tailscale, the magic tool!
1. Installing Basic Server Stuff on Termux
Person A:
Okay, first question: how do you even start?
Person B:
Simple! I opened Termux and updated the system like this:
pkg update
pkg upgrade
Then I installed an SSH server (so I can remotely connect):
pkg install openssh
SSH server allows me to securely login into my Android from another device!
And since I needed to set a password (because SSH requires it), I ran:
passwd
✅ This sets the Termux user's password.
2. Starting SSH Server
Person A:
Alright. But how do you "start" the server?
Person B:
Super easy:
sshd
Boom! Now my Termux SSH server is running.
But there’s a catch: because of Android’s restrictions, Termux’s SSH server runs on port 8022, not the usual port 22.
3. Finding My Phone's Local IP Address
Person A:
Cool, but how do you find your phone's IP?
Person B:
I typed this inside Termux:
ip addr show wlan0
✅ It showed something like 192.168.1.105
.
That’s my local IP address on the Wi-Fi network.
Now if my laptop is on the same Wi-Fi, I can connect like this:
ssh -p 8022 username@192.168.1.105
4. Making My Server Reachable Globally (Enter: Tailscale)
Person A:
Wait wait! This works only in the same Wi-Fi. What about when you're outside, like mobile network?
Person B:
Exactly — and that’s where Tailscale comes in! 🚀
Inside Termux, I installed Tailscale:
pkg install tailscale
Then I logged into Tailscale:
tailscale up
When I ran this, it gave me a link to open in my mobile browser where I logged into my Tailscale account.
After login, my Termux got a private VPN IP like 100.101.102.103
.
I checked it by running:
tailscale ip
5. Connecting to My Termux Server from Anywhere!
Person A:
Awesome! So now you can SSH into your phone even if you're not home?
Person B:
Exactly! 😎
From my laptop, no matter where I am, I can connect:
ssh -p 8022 username@100.101.102.103
✅ And boom — my Android is a mini server on the internet!
6. How File Transfer Works (SCP Upload/Download)
Person A:
Okay, but how do you transfer files?
Person B:
Through SCP — it’s like cp
command (copy) but over SSH.
From laptop to phone (upload):
scp -P 8022 myphoto.jpg username@100.101.102.103:/data/data/com.termux/files/home/
From phone to laptop (download):
scp -P 8022 username@100.101.102.103:/data/data/com.termux/files/home/mydoc.pdf ~/Downloads/
✅ Just remember:
-
Always use
-P 8022
(capital P, because Termux's sshd is on 8022 port). -
The path inside Termux is
/data/data/com.termux/files/home/
for your home folder.
7. Does Tailscale Affect Other Apps? VPN? Internet?
Person A:
One doubt: when you use Tailscale inside Termux, does it turn on VPN on the whole phone? Like does it affect Instagram, YouTube, etc.?
Person B:
Very smart question! 🤓
-
If you install Tailscale Android App from Play Store, it sets up full device VPN, affecting all apps.
-
BUT, if you only install Tailscale inside Termux CLI (
pkg install tailscale
),
✅ ONLY Termux joins Tailscale network. ✅ Your other Android apps (YouTube, Chrome, etc.) use normal internet — no VPN interference!
So I only installed it inside Termux. No VPN icon on the phone, no problem for my apps.
8. Quick Summary Table
Step | Command |
---|---|
Update Termux | pkg update && pkg upgrade |
Install OpenSSH | pkg install openssh |
Set Password | passwd |
Start SSH Server | sshd |
Install Tailscale | pkg install tailscale |
Login to Tailscale | tailscale up |
Find Tailscale IP | tailscale ip |
SSH into phone from laptop | ssh -p 8022 username@tailscale-ip |
SCP file transfer | scp -P 8022 file username@tailscale-ip:~/ |
🌟 Conclusion:
"You don't need a big server! You already have one inside your pocket.
Just open Termux, install OpenSSH and Tailscale, and boom — you have a private cloud server, accessible from anywhere securely! 🚀"
0 Comments