Skip to content

Fr4nzz/Termux-Fr4nz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

140 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ubuntu in Android via Termux

Scripts for setting up Termux and running Linux containers with development environments on Android.


Table of Contents


Initial Termux Setup

SSH Access (Optional)

Enable SSH to run commands from your computer. See WINDOWS_SSH.md.

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/setup_ssh.sh | bash
# Set password
passwd

Zsh with Oh My Zsh (Recommended)

Better terminal with autosuggestions and syntax highlighting.

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/install_zsh.sh | bash

Storage Access

Grant Termux access to internal storage:

termux-setup-storage

Container Setup

Choose one container type. Default username is legend (customize with export DESKTOP_USER=name before running).

Rooted Container (Recommended if rooted)

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/setup_rooted_container_unattended.sh | bash

Enter container:

ubuntu-chroot

Rootless Container (No root required)

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/setup_rootless_container_unattended.sh | bash

Enter container:

ubuntu-proot

Note: Both scripts prompt to install Zsh in the container (default: yes).


Development Servers (Web IDEs)

Access these in your browser. All run from Termux (not inside container).

VS Code Server

Full-featured VS Code in browser with R and Python support.

Features:

  • ✅ R environment (radian console, httpgd plots, Shiny with F5)
  • ✅ Python environment (Ctrl+Enter to run)
  • ✅ HTTPS support (clipboard/webviews work over LAN)

Rootless (proot)

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/install_vscode_server_proot_unattended.sh | bash

Usage:

vscode-server-proot-start  # Start server
vscode-server-proot-stop   # Stop server

Access:

  • 📱 Phone: http://127.0.0.1:13338
  • 💻 Laptop (ADB): Run adb forward tcp:13338 tcp:13338, then open http://127.0.0.1:13338
  • 💻 Laptop (LAN): https://YOUR-PHONE-IP:13338 (requires certificate setup)

HTTPS Setup (one-time, for LAN access with clipboard/webviews):

cert-server-proot
# Open http://YOUR-PHONE-IP:8889/setup on laptop and follow instructions

Rooted (chroot)

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/install_vscode_server_chroot_unattended.sh | bash

Usage:

vscode-server-chroot-start  # Start server
vscode-server-chroot-stop   # Stop server

Access: http://127.0.0.1:13338

HTTPS Setup:

cert-server-chroot

RStudio Server

R statistical computing IDE.

Rootless

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/install_rstudio_server_proot_unattended.sh | bash

Usage:

rstudio-proot-start  # Start server
rstudio-proot-stop   # Stop server

Access: http://127.0.0.1:8787

Rooted

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/install_rstudio_server_chroot_unattended.sh | bash

Usage:

rstudio-chroot-start  # Start server
rstudio-chroot-stop   # Stop server

Access: http://127.0.0.1:8787


Desktop Environment (GUI)

Full XFCE desktop via Termux:X11.

Rootless

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/install_x11_desktop_rootless_unattended.sh | bash

Rooted

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/install_x11_desktop_root_unattended.sh | bash

Desktop Applications

Run these inside the container (ubuntu-proot or ubuntu-chroot).

Firefox

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/container-scripts/install_firefox.sh | bash

VS Code (Desktop)

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/container-scripts/install_vscode.sh | bash

Launch:

code-proot

RStudio Desktop

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/container-scripts/install_rstudio_desktop.sh | bash

Launch:

rstudio-proot

Package Manager (Synaptic)

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/container-scripts/install_app_manager.sh | bash

Desktop Icons Helper

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/container-scripts/install_desktopify.sh | bash

AI Assistant (ZeroClaw)

Lightweight AI agent (~3MB) with Telegram bot support. Runs in the chroot container using OpenAI (ChatGPT OAuth or API key).

Rooted

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/install_zeroclaw_chroot_unattended.sh | bash

Setup (ChatGPT OAuth — no API key needed):

zeroclaw-chroot onboard --provider openai-codex
zeroclaw-chroot auth login --provider openai-codex
# Open the URL in a browser, log in, paste the redirect URL:
zeroclaw-chroot auth paste-redirect --provider openai-codex --input 'REDIRECT_URL'

Setup (API key):

zeroclaw-chroot onboard --api-key sk-... --provider openai

Telegram bot (optional):

# 1. Get a bot token from @BotFather on Telegram
# 2. Add the channel:
zeroclaw-chroot channel add telegram '{"bot_token":"YOUR_TOKEN","name":"my-bot"}'
# 3. Start daemon and note the bind code:
zeroclaw-chroot-daemon
# 4. Send /bind <code> to your bot in Telegram

Usage:

zeroclaw-chroot agent              # interactive chat
zeroclaw-chroot-daemon             # background service + Telegram

Claude Telegram Bot

Chat with Claude via Telegram. Uses Claude CLI authentication (requires Claude/Anthropic subscription). Runs in the chroot container.

Rooted

Install:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/termux-scripts/install_claude_telegram_bot_chroot_unattended.sh | bash

Setup:

# Authenticate Claude CLI (opens browser):
ubuntu-chroot claude auth login

Usage:

claude-bot            # start bot daemon
claude-bot --off      # stop bot daemon
claude-bot --status   # check if running
claude-bot --log      # tail the log

Additional Tools

R with Binary Packages (bspm + r2u)

Install (inside container):

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/container-scripts/install_r_binaries.sh | bash

Zsh in Container

Install (inside container):

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/container-scripts/install_zsh.sh | bash

Note: Also prompted during container setup.


Remote Control (Claude Code)

Let a remote Claude Code instance control your phone via SSH reverse tunnel + ADB + Termux:API. No Tailscale needed after initial setup.

Capabilities: screenshots, tap/swipe/type, open apps, read notifications, dump UI, clipboard, camera, SMS, TTS, sensors, and more.

📖 Full guide: REMOTE_CONTROL_SETUP.md


Troubleshooting

Repair APT

Run inside container:

curl -fsSL https://raw.githubusercontent.com/Fr4nzz/Termux-Fr4nz/refs/heads/main/container-scripts/apt_heal.sh | bash

Keep Termux Running

Prevent Android from killing Termux during long tasks.

Acquire wakelock:

termux-wake-lock

Release wakelock:

termux-wake-unlock

Whitelist via ADB (from computer):

adb shell cmd deviceidle whitelist +com.termux

Browse Available Images

rurima lxc list

Manual Guides


Security Notes

  • Servers bind to 127.0.0.1 by default (safe for same-device)
  • For LAN access with security:
    • code-server: Add --auth password and set PASSWORD env var
    • openvscode-server: Remove --without-connection-token and use a token
    • VS Code Server HTTPS: Use cert-server to set up certificates

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors