Termux Files Share

(Phone to PC/Mac/Linux). This guide will show you how to transfer files, folders, and directories between your Android phone and a computer using Termux, all over your local WiFi.

Method 1: The Best & Most Powerful Way (SFTP Server)

This method turns your phone into a secure file server (SFTP) that you can access from any computer with a file transfer client. You get a full file browser and can drag-and-drop files in both directions (upload and download).

Part 1: On Your Android Phone (Inside Termux)

  1. Update and Install Packages:
    Open Termux and run the following commands to make sure everything is up-to-date and to install OpenSSH, which provides the server.
    pkg update && pkg upgrade -y
    pkg install openssh -y

  2. Set Your Password:
    You need to create a password for the connection. This is not your phone's lock screen password; it's a new password just for Termux.
    passwd

    Enter your new password twice. (You won't see any characters as you type).

  3. Grant Storage Access (Crucial!):
    To access your phone's "Internal Storage" (like your Downloads, DCIM, and Pictures folders) from your computer, you must give Termux permission.
    termux-setup-storage

    Your phone will pop up a permission request. Accept it. This creates a new folder in Termux's home directory called storage, which is a symbolic link to your phone's files.

  4. Find Your Connection Details (Username & IP):
    You need two pieces of information for your computer to find your phone.

    • To find your Username, run:
      whoami

      The output will be something like u0_a123 or similar. Write this down.

    • To find your Phone's IP Address, run:
      ip addr show wlan0

      Look for the line that says inet. You'll see your phone's local WiFi IP address. Write this down.

  5. Start the Server:
    Now, simply start the SSH server.
    sshd

    The server is now running in the background.

Part 2: On Your Computer (PC/Mac/Linux)

  1. Get an SFTP Client:
    You need a program that can speak SFTP.
    • Windows: FileZilla or WinSCP are excellent free options.
    • Mac: FileZilla or Cyberduck work great.
    • Linux: You can use FileZilla or your file manager (e.g., in Nautilus, go to "Other Locations" and enter sftp://YOUR_USERNAME@YOUR_IP:8022).
  2. Configure the Connection:
    Open your client (e.g., FileZilla) and look for the "Site Manager" or "New Connection" settings.
    Fill in the details you found in Part 1:
    • Protocol: SFTP - SSH File Transfer Protocol
    • Host: Your phone's IP address (e.g., 192.168.1.5)
    • Port: 8022 (This is very important! Termux uses port 8022, not the default 22.)
    • User: Your username (e.g., u0_a123)
    • Password: The password you set with the passwd command.
  3. Connect and Transfer!
    Click "Connect". You may get a warning about an "unknown host key." This is normal; just accept it.
    You are now connected! You will see your computer's files on one side and your Termux files on the other.
    • To find your phone's files (Photos, Downloads, etc.), navigate into the storage folder.
    • You can now drag and drop files and entire folders between your computer and your phone.

Method 2: The Quick & Easy Way (Download-Only Server)

If you just want to quickly download some files from your phone to your computer and don't want to install software, this is a great option.

  1. On your phone (in Termux):

    • Install Python (if you don't have it):
      pkg install python

    • Navigate to the folder you want to share. For example, to share your main Downloads folder:
      cd ~/storage/downloads

    • Start the simple web server:
      python -m http.server 8000

  2. On your computer:

    • Open any web browser (Chrome, Firefox, Safari).
    • In the address bar, type your phone's IP address (the one you found in Method 1), followed by :8000.
      Example: IP-PHONE-WIFI:8000
    • You will see a simple list of all files and folders in that directory. You can click on any file to download it.

To stop this server, just go back to Termux and press Ctrl + C.