Share files Between computer and phone Locally : Wireless File Transfer with Termux

Hey, what's up, guys! It's been long since i wrote a post for you guys. but anyways, Have you ever been in a situation where you needed access to files on your Android phone in your pc but it's too hectic to plug your phone into your pc with data cables, well forget that old method. I'm excited to share a game-changing solution: turning your Android device into an FTP (File Transfer Protocol) server using Termux. 🔥

I stumbled upon this gem during my own tech explorations. Termux, with its powerful terminal emulation capabilities, allows you to unleash the full potential of your Android device. By setting up an FTP server right on your phone, you gain the ability to wirelessly transfer files between devices seamlessly. This isn't just about convenience; it's about empowering yourself with the tools to stay connected and productive no matter where you are! 🚀


What is FTP and How Does It Work?

FTP, short for File Transfer Protocol, is a standard network protocol used for transferring files between a client (like your computer) and a server (in this case, your Android device). Setting up an FTP server on your Android device essentially creates a wireless file-sharing hub within your own network. It's like having your personal cloud storage, accessible anytime and anywhere within reach!


Wireless File Transfer with Termux

Ready to harness the power of Termux and transform your Android phone into a file-sharing powerhouse? Here's a step-by-step guide to get you started:

Step 1: Install Termux

Skip this if you have termux in your phone (obvioulsy), but if you don't then you have to install it in your phone, for that you can search it on google or you can just download from thos post of mine, keep in mind that you can't install it from google playstore, because that version is not working. [ Install Termux Now ]


Step 2: Install Python

Open Termux and run the below command, it will install python as well as pyftpdlib libarary into your termux. If you wanna learn how you can install them individually then you can read termux basics commands.

pkg install python && pip install pyftpdlib


Step 3: Start FTP Server in Termux

To initiate your FTP server using Termux, execute the following command within the terminal:

python -m pyftpdlib -p 2122 -w -d /data/data/com.termux/files/home/storage/shared

This command starts the FTP server, assigning port 2122 for communication, enabling write (-w) permissions, and setting the server's root directory to /data/data/com.termux/files/home/storage/shared.

This action activates the FTP server on your Android device, making it ready to facilitate file transfers within your local area network.


Step 4: Connect to the FTP Server on your PC

Once the FTP server is running, you can connect to it by typing below command: Just open windows file manager and type the below ftp address in the address bar. 

ftp://<phone_ip_address>:2122/

Replace <phone_ip_address> with your phone's IP address (find it using ifconfig in Termux).

e.g: ftp://192.168.0.100:2122/

How to find you local IP address:

just open termux and type:
ifconfig


Now you have to find your wlan Ip address, see below image if you don't know were you can find it. 

Step 4: Advanced Tip - Create FTP Shortcut on PC

To create a convenient shortcut on your PC for quick access to your Android device's FTP server, follow these steps:

Open Notepad:
@echo off
start explorer "ftp://192.168.0.100:2122 /" 
Replace 192.168.0.100 and 2323 with your Android device's IP address and the FTP server port (e.g., 2122 if you used port 2122 in Termux).

Save the File:
Name the file as Andftp.bat (including the .bat extension).

Start your Termux FTP server by following Step 3.
Double-click on the Andftp.bat file to launch the FTP client instantly.

Notes:
This shortcut will open Windows File Explorer and connect to the specified FTP server (ftp://192.168.0.100:2122/).
Ensure to replace 192.168.0.100 and 2122 with your actual IP address and FTP port.
You can customize the file name and save location as needed.


Conclution: 

Turning your Android device into an FTP server using Termux isn't just a cool tech trick; it's a game-changer for anyone who values flexibility and productivity on the go. Whether you're a digital nomad, a tech enthusiast, or someone who simply wants to stay connected without boundaries, this setup empowers you to manage your files with ease. I myself use this setup to quickly share files between my phone and my windows system. well that's it for this post, thanks for reading and as always, Stay ethical. 👾

Post a Comment

0 Comments