HFS on Android - rejetto/hfs GitHub Wiki

First download and install Termux: https://github.com/termux/termux-app/releases

Now install the required packages in Termux:

pkg update

pkg install openssl nodejs -y

Run HFS:

  • stable: npx hfs@latest
  • beta: npx hfs@beta

To run it in the background:

pkg install tmux

tmux new -s hfs

  • now run HFS as normal
  • to exit, press Ctrl + b and quickly hit D
  • to re-enter later, run tmux a -t hfs
  • to stop HFS, just type quit
  • to remove the session: tmux kill-session -t hfs

Optional: SSH access to Termux:

passwd
pkg install openssh -y
sshd -p 2222

On another device:

ssh root@PHONELOCALIP -p 2222

Make sure to grant the Termux app the special "All files access" privilege; otherwise it will not have access to your files.

To add files from your internal storage, use the path /storage/emulated/0. The exact sdcard path varies, so you must determine it on your device.

Now HFS should serve the page on your phone's local IP address by default on port 8080.

Android won't allow port numbers less than 1024 without root access! (If you have root, run su or sudo <command> after installing tsu via pkg install tsu -y.)

⚠️ **GitHub.com Fallback** ⚠️