Revamp Your Old Android Phone into a Mini Linux Server

📆 · ⏳ 5 min read · ·

Introduction

With the fast pace of technology, we often find ourselves upgrading to newer devices, leaving our old phones in a forgotten corner. But what if we could put that old device to good use?

By using the Linux Deploy app, we can convert an Android phone into a portable Linux server. This can be used for hosting websites, running scripts, and even as a development machine.

In this article, we’ll go over all the steps required to transform your Android phone into a mini Linux lab.

Install Linux Deploy

The first step to convert your Android phone into a Linux server is to install the Linux Deploy app. You can find this app on the Google Play Store ↗️ or directly check its Github repo ↗️ and it’s free to download.

Ensure you have already rooted your device since it will require root access to operate.

Configure the Linux Deploy App

Once you’ve installed the Linux Deploy app, it’s time to configure it. Open the app and click on the properties button which will be on the bottom right corner beside the “Start” and “Stop” buttons.

On this screen, update the configurations as below:

Distribution

Debian

Architecture

armhf

I initially tried with arm64 architecture however that didn’t work for me. So I would suggest you can try with arm64 and if it doesn’t work then try with armhf.

Distribution Suite

Buster

Installation type

File

Installation path

The default option is ${EXTERNAL_STORAGE}/linux.img. This will create the Linux image on your internal memory.

If you want to keep the Linux image on external storage like SD card, then you can change it to ${SECONDARY_STORAGE}/linux.img.

Note that EXTERNAL_STORAGE is internal storage and SECONDARY_STORAGE is any external storage like SD card.

Image size

This is an important section because the default option would be Automatic calculation. If we keep it as default it will allocate around 2GB of storage for the Linux server.

However, from my experience, I ran out of memory very quickly once I started running node applications on it. So I would suggest instead of Automatic calculation, pick a decent amount of size.

For me, I went ahead with giving it 80GB of storage because I’m using this old device as part of my minilab hence I can allocate much higher space to it. But feel free to allocate size as per your considerations. The more the better room for you to install stuff on the server.

File system

ext4

User name

android (you should change this as this will be your non root user in the linux system through which you will ssh into the system)

User password

Set a strong password here for your username above.

INIT

Tick the checkbox to enable it.

Init System

Select the option as sysv. This means your init system would be SystemV.

Read more about SystemV if you want to get some insights about what it is.

SSH

Tick the checkbox to enable it.

You can keep the SSH settings to default or modify it as per your choice.

Start the Installation

Once you’ve completed all the above steps, go back to the main screen and click on the 3-dot menu located on the TOP RIGHT corner and press Install.

You’ll see a progress bar showing the installation process. It may take a few minutes for the installation to complete.

When you see the last line shown as <<<deploy your installation is complete and now you have successfully installed Linux on your android device 🎉

On the BOTTOM LEFT corner press START to start the Linux containers and now we are ready to start using SSH.

Connect to Your Debian Server

Open a terminal of your choice on your other device (For eg a laptop or another mobile which have some terminal app installed like termux etc) and type the following SSH command to connect to your server:

Terminal window
ssh username@IPAddress

Here replace username with the user name you set above and IPAddress with the device IP address.

You can check the IP Address which is allocated to the server by checking on top of the Linux Deploy app.

Next, enter the password when prompted for one as the one you set above

Start using your Mini Linux Lab

You’re now ready to start using your mini Linux lab! You can install additional packages, host websites, or use it as a development machine. The possibilities are endless with your portable Linux server.

Suggestions from Reddit Community

I posted this article on Reddit r/linux ↗️ and got some amazing suggestions from the community. I’m listing them below:

Conclusion

By using the Linux Deploy app, you can turn an old Android phone into a portable Linux server. This is a great way to put your old phone to good use and have a mini Linux lab at your fingertips.

Whether you want to host websites, run scripts, or use it as a development machine, the options are endless. With this setup, you can take your Linux server with you wherever you go!

You may also like

  • Setup Jellyfin with Hardware Acceleration on Orange Pi 5 (Rockchip RK3558)

    Recently I moved my Jellyfin to an Orange Pi 5 Plus server. The Orange Pi 5 has a Rockchip RK3558 SoC with integrated ARM Mali-G610. This guide will show you how to set up Jellyfin with hardware acceleration on the Orange Pi 5.

  • Jellyfin + arr stack — Self-hosted media streaming in my Homelab

    Since ages, I have been collecting lots of movies, TV shows, and music. Ever since I got into self hosting, I have been looking for a way to stream my media collection to my devices. Jellyfin is the perfect solution for this.

  • Syncing made easy with Syncthing

    Syncthing is one of those tools which have made my life easier. It is a decentralized file synchronization tool which is open source and free to use. Learn how to set it up and use it.