Turn any Android phone into a private AI server, Git forge, and web host.
Zero emulation. Zero cloud dependency. True Bionic VPS orchestration.
Moltis transforms a spare Android phone into a true private VPS running on the device's native hardware. All binaries are compiled natively against Bionic. Services are orchestrated via termux-services (runit) just like systemd on a real server.
| Service | Port | What it does |
|---|---|---|
| Moltis AI | 46697 |
Multi-provider AI gateway with 340+ models, web UI, MCP integrations, and robust SQLite memory. |
| Forgejo | 3001 |
A full Git forge — repositories, issues, PRs — mapped instantly on Android's secure Ext4. |
| Caddy | 3002 |
Automated web hosting routing docs & dashboards. |
| VS Code Patcher | N/A | Self-healing watchdog that auto-patches VS Code Remote-SSH binaries for Bionic. |
To make a phone act like a server, Moltis automatically accounts for core Android "quirks":
- The Phantom Process Killer: Android 12+ randomly kills child background apps to save battery. (See Setup section regarding the ADB command to fix this).
- The Hardcoded Path Trap (
/bin/bashmissing): We seamlessly intercept hardcoded unix paths usingtermux-exec(LD_PRELOAD), allowingnode-pty, python bots, and random bash scripts to work as if they are running on Ubuntu. - No
systemd/ Init bindings: Bootstrapstermux-services(runit module) so if Forgejo or Moltis crashes, they automatically auto-restart. - OOM Killer: Services run with elevated
nice/ionicepriority, andtermux-wake-lockprevents CPU sleep. - VS Code Impedance Mismatch: The self-healing patcher intercepts glibc Node.js binaries and hot-swaps them with native Bionic node, fixing the
cxx_abstract/File Not Foundlinker errors.
Get Termux (via F-Droid, NOT Google Play). Then paste:
curl -fsSL https://raw.githubusercontent.com/Muxd21/moltis-termux/FULL/install.sh | bashYou must disable the Phantom Process Killer holding your server back, or Android will mysteriously kill your AI gateway after a few hours:
Plug your phone into a PC (or use Wireless Debugging tools) and run:
adb shell "settings put global phantom_process_handling false"(Also set Termux AND Tailscale Battery usage to 'Unrestricted' in Android Apps settings).
Because Moltis uses termux-services, you don't rely on brittle background commands. You use the service manager (sv).
moltis-up # Starts moltis, caddy, forgejo, vscode-patcher via sv + wakelock
moltis-dev # Pro mode (adds SSLH stealth multiplexer on :4433)sv up caddy # Start Caddy web server
sv down forgejo # Stop Git Forge
sv status moltis # Check if the AI gateway is running
cat $PREFIX/var/log/moltis/current # Read your service logsmoltis-status # Shows service status, network IPs, and VS Code patch statusVS Code Remote-SSH fails on Android because it downloads a generic Linux Node.js binary compiled for glibc. Moltis includes a Self-Healing Patcher that:
- Intercepts glibc Node.js binaries in
~/.vscode-server/bin/ - Hot-swaps them with a Bionic wrapper that
execs into Termux's nativenode - Grafts native
pty.nodeC++ bindings compiled against Bionic - Watches for new VS Code updates via
inotifywaitfilesystem watchdog
# Manual patching
moltis-fix-vscode # Patch all VS Code servers
moltis-fix-vscode --force # Force re-patch everything
moltis-fix-vscode --watch # Start filesystem watchdog (auto-patches new updates)The watchdog also runs as a runit service (sv status vscode-patcher), so new VS Code updates are patched automatically in the background.
The installer deploys a hardened sshd_config at $PREFIX/etc/ssh/sshd_config with:
- Port 8022 — non-standard port for Android
- TCPKeepAlive + ClientAliveInterval — prevents Android from reaping the SSH process
- AllowTcpForwarding + GatewayPorts — enables VS Code port tunneling
- Compression — optimized for mobile data
Add this entry for a frictionless "always-on" connection:
Host moltis
HostName 100.x.x.x # Your Tailscale IP
User termux
Port 8022
# Antigravity connection stability
ServerAliveInterval 15
ServerAliveCountMax 3
# Reuse connections for instant reconnect
ControlMaster auto
ControlPath ~/.ssh/moltis-%r@%h:%p
ControlPersist 5m
Along with core services, install.sh provisions a native pocket toolkit designed to emulate root-level workflows inside the unprivileged Bionic sandbox:
mosh: Persistent SSH connections surviving network handoffs between LTE and home Wifi.socat/entr: Advanced port forwarding and directory live-watching.sslh(Dev Mode): Automatically detects if an incoming connection is SSH or HTTP on a single port (like4433) bypassing corporate firewalls.tmux: Terminal multiplexer for persistent sessions.
| Command | Description |
|---|---|
moltis-up |
Start all services with wakelock + process priority elevation |
moltis-stop |
Stop all services + release wakelock |
moltis-dev |
Pro Mode (all services + SSLH stealth mux on :4433) |
moltis-status |
Health check: services, network, VS Code patch status |
moltis-fix-vscode |
Patch VS Code servers for Bionic (--force, --watch) |
moltis-update |
Self-update installer + re-patch VS Code |
moltis-bot-setup |
Add any script as a supervised runit service |
sv status <name> |
Check individual service (moltis, forgejo, caddy, sslh, vscode-patcher) |
Standard public binding fails on mobile networks due to CGNAT. Connect the Termux instance to Tailscale natively:
pkg install tailscaletailscaled 2>&1 & tailscale up- Access your phone's stable
100.x.x.xIP globally.
MIT - See the LICENSE file for details.