Run an SFTP Server on Android — AnExplorer Guide

Run an SFTP Server on Android — AnExplorer Guide

Last Updated :

Run an SFTP Server on Android

AnExplorer's SFTP Server turns your Android phone into an SSH-accessible file server. Connect from any SSH/SFTP client on a laptop, desktop, or remote server — your phone's storage is securely exposed over the network.

Unlike the basic FTP Server, SFTP is encrypted over SSH. Every file transfer is protected, making SFTP Server appropriate for accessing your phone remotely over the internet or on untrusted networks.


When to Use SFTP Server Instead of FTP Server

SituationUse
Home Wi-Fi, trusted networkFTP Server (simpler)
Public Wi-Fi, office, or remote accessSFTP Server (encrypted)
Automating backups from a PC/server to phoneSFTP Server
Another developer needs to scp files to your phoneSFTP Server
Connecting from a Linux/Mac terminal via sftp or scpSFTP Server

How to Start the SFTP Server

  1. Open AnExplorer
  2. Open the menu sidebar (tap ≡ or swipe right)
  3. Select SFTP Server
  4. Tap Start
  5. AnExplorer shows: Host: 192.168.x.x, Port: 2222 (or your configured port)
  6. Set a username and password in the SFTP Server settings — never leave an SFTP server open without credentials

The server only runs while AnExplorer is active. It shuts down when you close the app or the system kills it to free memory.


Connecting from a Computer

From Windows (command prompt or PowerShell):

sftp -P 2222 [email protected]

Then use SFTP commands: ls, get filename, put filename, exit

From Linux or Mac (terminal):

sftp -P 2222 [email protected]

From FileZilla (Windows/Mac/Linux):

  1. Site Manager > New Site
  2. Protocol: SFTP – SSH File Transfer Protocol
  3. Host: 192.168.1.105, Port: 2222
  4. Logon type: Normal, username, password
  5. Connect

From Cyberduck (Mac):

  1. Open Connection > SFTP (SSH File Transfer Protocol)
  2. Server: 192.168.1.105, Port: 2222
  3. Enter username and password

Automating: Pull Phone Files from a Linux Server

A common workflow for developers: automatically back up phone contents to a Linux home server using a cron job:

# cron entry (runs every night at 2am)
0 2 * * * sftp -P 2222 [email protected]:/sdcard/DCIM /backup/phone-photos/

Or use rsync over SSH (if the phone SFTP server supports rsync commands — varies by implementation):

rsync -avz -e "ssh -p 2222" [email protected]:/sdcard/ /backup/phone/

This is a reliable way to maintain an automatic photo/video backup from phone to NAS or home server without any cloud service.


SFTP Server Settings

SettingRecommendation
Port2222 (default, avoids conflict with system SSH on port 22)
UsernameChoose something non-trivial
PasswordUse a strong password
Root directoryRestrict to /sdcard/ or a specific folder
SSH key authAvailable for key-based clients

Security: SFTP Port Exposure

The SFTP Server binds to your phone's current IP on the local network by default. If you want to access it from outside your home:

  1. Enable port forwarding on your router: forward external port → phone IP port 2222
  2. Use your router's public IP or DDNS hostname to connect remotely
  3. Always use a password when exposing SFTP to the internet
  4. Consider a VPN (OpenVPN) instead of port-forwarding for better security

SFTP Server vs FTP Server vs Device Connect

SFTP ServerFTP ServerDevice Connect
Encrypted
Requires SSH client
Works from any browser
Best forRemote/secure accessLAN transfersQuick sharing
Related guideThis pageFTP ServerDevice Connect

Install

Install AnExplorer

Copyright © DWorkS 2011 – 2026 All rights reserved