Turn your Android phone into a mini-server. Because why not?
Droidploy lets you run Node.js backends on your Android phone and deploy them to the internet. No root required, no sketchy workaroundsβjust pure Android magic.
Good question! Here are some legit use cases:
- Quick prototyping - Test your backend ideas without touching AWS
- Personal APIs - Run your own micro-services from your phone
- IoT hub - Turn your phone into a home automation server
- Learning - Understand how servers work by deploying on hardware you already own
- Flex on your friends - "Yeah, my phone is hosting my website" π
β
Node.js on Android - Full Node.js runtime running natively
β
Cloudflare Tunnels - Automatic HTTPS and public URL generation
β
Zero Configuration - Import your project, click deploy, done
β
No Root Required - Works on any Android 10+ device
β
Background Execution - Keeps running even when you lock your phone
β
Custom Domains - Use your own domain via Cloudflare
Droidploy does some pretty cool engineering under the hood:
- Native Libraries Hack - We package Node.js and Cloudflared as native libraries (
.sofiles) to bypass Android's W^X security restrictions - Cloudflare API Automation - Automatically creates tunnels, configures DNS, and routes traffic
- Foreground Service - Keeps your server alive in the background
- QUIC Protocol - Uses Cloudflare's QUIC protocol to establish tunnels (because Android's DNS can be wonky)
The magic? We leverage Android's nativeLibraryDir to execute binaries that would normally be blocked. Check out ServerService.kt if you want to see the sorcery.
- Android 10+ (API Level 29+)
- A Cloudflare account (free tier works!)
- A domain managed by Cloudflare
- ~100MB free storage
You'll need these from your Cloudflare dashboard:
- API Token - Go to dash.cloudflare.com β My Profile β API Tokens β Create Token
- Use "Edit Cloudflare Tunnel" template or create custom with these permissions:
- Account β Cloudflare Tunnel β Edit
- Zone β DNS β Edit
- Use "Edit Cloudflare Tunnel" template or create custom with these permissions:
- Account ID - Found on any domain's overview page (right sidebar)
- Zone ID - On your domain's overview page (right sidebar)
- Domain - Your actual domain (e.g.,
example.com)
- Open Droidploy
- Tap the Settings icon (βοΈ)
- Enter your Cloudflare credentials
- Hit "SAVE CONFIGURATION"
Option 1: Use the demo server
- Just hit "DEPLOY SERVER" to see it in action
- It'll deploy a sample Node.js server
Option 2: Deploy your own code
- Zip your Node.js project (make sure
index.jsis at the root or adjust the command) - Tap "IMPORT PROJECT (ZIP/FOLDER)"
- Select your zip file
- (Optional) Customize the command (default:
node index.js) - Hit "DEPLOY SERVER"
- Wait ~10 seconds for magic to happen
- Click the URL to open your live site! π
Your Node.js project should look like:
my-project.zip
βββ index.js # Entry point
βββ package.json # Dependencies (optional)
βββ ... other files
Important: The app extracts your zip and runs the command from the root. Make sure your entry file matches the command!
- Make sure your
index.jsis at the root of the zip - Check that the custom command matches your file structure
- The app uses hardcoded Cloudflare edge IPs to bypass DNS issues
- If it still fails, check your internet connection
- Android is aggressive about killing background processes
- Keep the app in "Recent Apps" or whitelist it in battery settings
- This means the native binaries aren't in
jniLibs/arm64-v8a/ - Make sure
useLegacyPackaging = trueis set inbuild.gradle.kts
For the nerds (like me):
Android 10+ blocks execution of binaries from writable directories. We bypass this by:
- Packaging executables as
.sofiles injniLibs/arm64-v8a/ - Android extracts them to
/data/app/.../lib/arm64/(read-only, executable) - We launch them via
ProcessBuilderas if they were shared libraries
- Node.js needs to be statically linked or built for Android's Bionic libc
- Standard Linux ARM64 binaries won't work (they use glibc)
- We use a custom Android-compatible Node.js build
- Creates tunnel via REST API (not CLI)
- Configures ingress rules programmatically
- Creates DNS CNAME automatically
- Uses QUIC protocol with hardcoded edge IPs (DNS workaround)
- Kotlin - Android app
- Jetpack Compose - UI
- Node.js (statically linked) - Runtime
- Cloudflared - Tunnel daemon
- Cloudflare API - Tunnel/DNS management
- Retrofit - HTTP client
# Clone the repo
git clone https://github.com/YadavYashvant/droidploy.git
cd droidploy
# Add binaries to jniLibs
# Place these in app/src/main/jniLibs/arm64-v8a/:
# - libnode.so (Android-compatible Node.js binary)
# - libcloudflared.so (Cloudflared ARM64 binary)
# Build
./gradlew assembleDebug
# Install
adb install app/build/outputs/apk/debug/app-debug.apk- Node.js: Use nodejs-android-prebuilt-binaries or build from source
- Cloudflared: Grab from Cloudflare releases (use linux-arm64, rename to
.so)
- β No npm install at runtime (pre-bundle dependencies)
- β ARM64 devices only (no x86 support yet)
- β Single server per app instance
- β Updates require re-importing the project
β οΈ Battery drain if running 24/7 (it's still a phone!)
PRs welcome! Some ideas:
- Support for Deno/Bun runtimes
- Built-in code editor
- Python/Go server support
- Auto-restart on crashes
- Server monitoring dashboard