Turn any Android phone into a zero-touch Linux server

Posted: 4/13/2026 | Updated: April 13, 2026

This is the complete, start-to-finish guide for turning any Android phone into a 24/7 autonomous Linux server using the 2026 Google Play Store version of Termux.

I wrote this after testing the same setup on two different phones and one tablet; the steps are small, but the result is a surprisingly capable Android SSH server.

Phase 1: Core installation and updates

  1. Install Termux from the Google Play Store: Google Play Store
  2. Open Termux and update the package list: pkg update && pkg upgrade -y
  3. Install the basics for your Termux server: pkg install openssh termux-services nano -y
  4. Set a password for SSH access: passwd Enter your password twice. The characters will not show while you type.

Phase 2: System-level stay-alive settings

Android can kill background apps unless you explicitly whitelist them.

  1. Battery optimization:
    • Go to Settings > Apps > Termux > Battery.
    • Change battery optimization from “Optimized” to “Unrestricted.”
  2. Notification permission:
    • In the same Termux App Info screen, open Notifications.
    • Make sure notifications are allowed. Wake lock behavior depends on this.
  3. Allow Termux to use external apps: In Termux, run: mkdir -p ~/.termux && echo "allow-external-apps = true" >> ~/.termux/termux.properties

Phase 3: Automating SSH and the wake lock

This makes sure your Android SSH server is ready to accept connections and does not go to sleep.

  1. Enable the SSH service: sv-enable sshd
  2. Keep the device awake whenever Termux starts:
    • Open your shell config: nano ~/.bashrc
    • Add this line at the end: termux-wake-lock
    • Save and exit: Ctrl+O, Enter, Ctrl+X.
  3. Enable Termux boot behavior: echo "token-active-on-boot = true" >> ~/.termux/termux.properties

Phase 4: Zero-touch autostart with Tasker

Android prevents apps from automatically launching at boot. Tasker is the ignition switch that starts Termux after reboot.

  1. Install Tasker from the Play Store: Tasker
  2. Create a boot profile:
    • Open Tasker.
    • Tap Profiles > + > Event > System > Device Boot.
  3. Create the task:
    • Name it “Start Termux.”
    • Add action: App > Launch App > Termux.
  4. Commit the changes:
    • Go back to Tasker’s main screen.
    • Tap the checkmark (✓) in the top right to save the profile.

I usually test this by rebooting once and then checking my PC right away. If the phone boots and the SSH prompt appears without me opening Termux, the setup is doing its job.

Phase 5: The first connection

  1. Find the phone’s IP address in Termux: ifconfig Look for the inet address under wlan0.
  2. Connect from your PC to your new Android SSH server: ssh [username]@[IP_ADDRESS] -p 8022 The username can be any name; the password is the one you set in Phase 1.

If Termux is running and Tasker starts the app at boot, the phone can act like a headless Android web server or Termux server on your local network.