opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Turn your old Android phone into a Linux desktop with just Termux
GitHub RepoImpressions1.2k

Project Description

View on GitHub

Give That Old Android Phone a Second Life as a Linux Desktop

You've probably got an old Android phone sitting in a drawer somewhere. It still works fine, but it's too slow for modern apps, the battery drains fast, or you just upgraded. What if you could turn that device into a full Linux desktop or a smart home server — without rooting it, without plugging it into a PC, and without spending a dime? That's exactly what this project lets you do.

The repository provides two shell scripts that run inside Termux, the Android terminal emulator. One sets up a full GUI Linux desktop environment on your phone. The other turns it into a Home Assistant smart home hub. You can even run both on the same device.

What It Does

The project is essentially a pair of automated setup scripts for Termux. The main script, termux-linux-setup.sh, transforms your Android phone into a Linux desktop with a choice of four desktop environments: XFCE4 (the default), LXQt, MATE, or KDE Plasma. It handles all the package installation, configuration, and dependency management. You get a working GUI that runs inside the Termux-X11 app, complete with GPU acceleration on Qualcomm Snapdragon devices via Turnip/Adreno drivers.

The second script, setup-homeassistant.sh, installs Home Assistant Core for controlling WiFi smart devices like lights and plugs. Both scripts are independent — you can install one, the other, or both without conflicts.

The hardware requirements are modest: an arm64 (64-bit) processor, 3 GB of RAM (4 GB for KDE Plasma), and 5-10 GB of free storage. A Qualcomm Snapdragon chip is ideal for the best GPU performance, but the scripts work on Mali and other GPUs too. Crucially, no root access or custom ROM is required — stock Android works fine.

Why It's Cool

This project solves a real problem that a lot of developers have thought about but never got around to tackling. Here's what makes it worth your time:

  • No root required. Most projects that put Linux on a phone involve bootloader unlocking, custom recoveries, and flashing ROMs. This one works on stock Android. You just install two apps from F-Droid and GitHub, run a script, and you're done. That lowers the barrier to entry dramatically.

  • It's genuinely useful, not just a toy. A Linux desktop on your phone means you can run Firefox, VLC, SSH, and even Wine for Windows apps. That's a real development environment in your pocket. The Home Assistant option turns an old phone into a dedicated smart home controller — something people normally buy a Raspberry Pi for.

  • The script handles the hard parts for you. The README mentions a known crash involving libpcre and libandroid-selinux that the pre-upgrade step prevents. The script saves a full log to ~/termux-setup.log if something goes wrong. These details show someone who actually ran into these problems and fixed them, rather than just throwing a script together.

  • You get a choice of desktop environments. XFCE4 for most people, LXQt for low-RAM phones, MATE for a classic feel, or KDE Plasma if you have a powerful device and want something that looks like Windows 11. The default recommendation is XFCE4, which is a sensible choice.

How to Try It

First, install Termux from F-Droid (not the Play Store — that version is outdated) and Termux-X11 from its GitHub releases page. Grant any permissions they ask for.

Open Termux and run these commands to prepare your environment:

termux-wake-lock
pkg upgrade -y

The termux-wake-lock command keeps Termux alive when your screen turns off, which prevents Android from killing the installation process.

Then download and run the desktop setup script:

curl -O https://raw.githubusercontent.com/mayukh4/linux-anroid/main/termux-linux-setup.sh
chmod +x termux-linux-setup.sh
bash termux-linux-setup.sh

The script will ask you which desktop environment you want and whether you want Wine. Installation takes 10-30 minutes depending on your internet speed.

To start your desktop:

bash ~/start-linux.sh

Then open the Termux-X11 app on your phone. Your Linux desktop appears inside it.

To stop:

bash ~/stop-linux.sh

For the Home Assistant setup, run bash setup-homeassistant.sh instead. The full repository is at github.com/mayukh4/linux-android.

Final Thoughts

This project is best for developers who want to repurpose old hardware, learn Linux on the go, or set up a cheap smart home controller. It won't replace your main desktop — you're still running on phone hardware with limited RAM and storage — but it's a genuinely practical way to get a Linux environment without buying a new device. The scripts are well-documented, the requirements are clear, and the author clearly tested this on real hardware (a OnePlus 5T running LineageOS). If you've got an old Android phone collecting dust, this is worth an afternoon of your time.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: 38b446ff-e41e-46d4-95e6-1754bf1f467eLast updated: June 29, 2026 at 11:11 AM