Turn Your Android Phone into a Linux Server: Step‑by‑Step Guide

This tutorial shows how to repurpose an Android device—either rooted or using Termux—into a functional Linux server by installing Linux Deploy, BusyBox, and Juice SSH, configuring a distro, and connecting via SSH from other devices.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Turn Your Android Phone into a Linux Server: Step‑by‑Step Guide

Overview

After losing student discounts, cloud server costs rise, prompting the author to explore turning an Android phone into a Linux machine as a low‑cost alternative. The guide walks through the required hardware, software, and configuration steps.

What You Need

Any Android phone with a usable screen (preferably a discarded device).

Three apps: Linux Deploy (requires root), Juice SSH (terminal client), and BusyBox (adds missing Linux commands).

If you lack a spare phone, a second‑hand Xiaomi 5 (around ¥200) is recommended because it includes NFC for transit cards and is inexpensive.

Root vs. Non‑Root Options

Two approaches exist: a fully‑rooted phone, which offers complete Linux capabilities, and a non‑root method using Termux, which provides a limited Linux environment (e.g., Python works, but many commands are missing).

Rooted phone : Requires wiping data; use only on disposable devices.

Non‑root phone : Install termux from the Play Store; you can run Python but lack many system utilities.

Installing Linux on a Rooted Android Phone

Assuming the phone is already rooted, follow these steps:

Install the three apps shown below.

三个必备的软件
三个必备的软件

Open Linux Deploy and configure the distribution. The author uses CentOS 7, but any preferred distro works.

基本配置
基本配置
显示调试信息
显示调试信息
开启 SSH,外界才能进行连接
开启 SSH,外界才能进行连接
修改 Linux 发型版本,选择你喜欢的
修改 Linux 发型版本,选择你喜欢的

Set the mirror for the chosen distro (example for CentOS 7):

http://chinanet.mirrors.ustc.edu.cn/centos-altarch/

Enable SSH in the Linux Deploy settings so you can connect from other devices.

启动手机 Linux
启动手机 Linux

Start the installation. It typically takes about half an hour. When the log shows extra/ssh ... done, the installation succeeded. extra/ssh ... done Connect via SSH using Juice SSH (or from a PC/iPad on the same LAN). Example screenshots of a successful Juice SSH session and an iPad connection are shown below.

Juice SSH connection
Juice SSH connection
iPad connecting to phone Linux
iPad connecting to phone Linux

Using Termux on a Non‑Root Phone

If the device cannot be rooted, install termux from the Play Store. While many Linux commands are unavailable, you can still run a Python interpreter and perform basic scripting.

Conclusion

By following these steps, you can transform an old Android phone into a functional Linux server, saving money on cloud instances and gaining a portable development environment. The author considers the guide a useful "dry‑run" and invites readers to try it out.

mobile developmentAndroidTermuxRootLinux Deploy
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.