Skip to content

Repository files navigation

Tailscale Termux CLI (Android 11+ Ready)

This project provides a patched version of the official Tailscale CLI (tailscale and tailscaled) designed specifically to run inside Termux on Android 11 and above without requiring Root or /dev/net/tun.


🚀 Quick Start (Easiest Installation)

Run this single command in Termux to download and install the latest package:

curl -fsSL https://raw.githubusercontent.com/bropines/tailscale-termux-cli/main/remote-install.sh | bash

Once installed, the tailscaled background service is automatically enabled and started. You can immediately connect:

tailscale up

(or tailscale-cli up)


✨ Features & Patches

  1. Netmon Bypass (Android 11+): Intercepts interface discovery using an ifconfig parser to bypass Android netlink restrictions.
  2. Userspace Networking: Runs without Root or /dev/net/tun out of the box.
  3. Automatic Socket Resolution: Both tailscale and tailscale-cli automatically route requests to ~/.tailscale/tailscaled.sock without requiring manual --socket flags.
  4. Auto-Start Daemon: Invoking tailscale or tailscale-cli automatically starts the tailscaled daemon if it is not currently running.
  5. Runit (termux-services) Integration: Native background service management with auto-start on boot support.

🛠️ Usage & Commands

You can use standard tailscale commands or the tailscale-cli wrapper interchangeably.

Tip

Subcommands like tailscale funnel, tailscale serve, tailscale status, and tailscale ping work natively out of the box!

Common Commands

  • Connect / Log in:
    tailscale up
  • Check connection status:
    tailscale status
  • Expose a local service (Funnel / Serve):
    tailscale funnel 8096
  • Run functional test (SOCKS5 & DNS):
    tailscale-test

⚙️ Managing the Background Service

The background daemon is managed via termux-services (runit) or helper commands:

  • Check daemon status:
    tailscaled-start --service=status
  • Enable auto-start on boot & start daemon:
    tailscaled-start --service=on
  • Disable auto-start & stop daemon:
    tailscaled-start --service=off
  • View daemon logs:
    tailscaled-log

🔧 Configuration (.env)

Configure daemon settings by creating/editing ~/.tailscale/.env. Variables are automatically loaded on start:

Variable Tailscaled Flag Description
TS_SOCKS5_PORT --socks5-server Set a specific SOCKS5 port (e.g. 1055)
TS_SOCKS5_SERVER --socks5-server Full address (e.g. 127.0.0.1:1055)
TS_HTTP_PROXY --outbound-http-proxy-listen HTTP Proxy address
TS_PORT --port UDP port for WireGuard
TS_VERBOSE --verbose Log verbosity level (1, 2...)
TS_EXTRA_ARGS (raw flags) Additional raw flags to pass

Example ~/.tailscale/.env:

TS_SOCKS5_PORT=1055
TS_VERBOSE=1
TS_EXTRA_ARGS="--hostname=termux-node"

🏗️ Local Building

If you have Go installed in Termux, you can build from source:

./build.sh
./install.sh

💡 Troubleshooting

1. "failed to connect to local tailscaled process"
If the daemon was stopped manually, start it using:
tailscaled-start

Or ensure termux-services is running:

sv up tailscaled
2. Shell Autocompletions not working
Autocompletions for **Bash**, **Zsh**, and **Fish** are installed automatically. Restart your shell session or reload your shell profile to apply them.

Credits & Attribution

Note: This project is not affiliated with Tailscale Inc.

About

A "working" implementation of the tailscaled daemon under termux

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages