Home › Minecraft › How to Host a Minecraft Server on Android

How to Host a Minecraft Server on Android

How to Host a Minecraft Server on Android

A spare Android phone is quietly one of the cheapest Minecraft servers you can own. It sips power, it is silent, and it probably has more RAM than the budget VPS people rent for the same job. Minecraft does not officially support Android as a server host, but there is a well-worn workaround: run a small Ubuntu environment on the phone, install Java inside it, and launch the normal PC server software. Here is the whole process, start to finish.

What You Will Need

  • An Android phone or tablet, ideally with 4 GB of RAM or more and a decent processor
  • The Termux app (a terminal emulator) and the AnLinux app, both free
  • A stable Wi-Fi connection and a charger — the phone has to stay awake and plugged in while it hosts
  • About 1–2 GB of free storage for Ubuntu, Java and your world

Step 1: Put Ubuntu on the Phone with Termux

Install Termux and AnLinux from the Play Store. Open AnLinux, tap Choose, select Ubuntu, and tap Copy. That copies a one-line install script. Switch to Termux, paste it, and press Enter. Ubuntu downloads and unpacks itself in a couple of minutes. When it finishes, run the start script it gives you:

./start-ubuntu.sh

When the prompt changes to root@localhost, you are inside Ubuntu. Everything from here happens in this terminal.

Step 2: Install Java

Minecraft's server is a Java program, so Ubuntu needs a Java runtime. Update the package lists and install a current OpenJDK:

  • apt-get update
  • apt-get install software-properties-common
  • apt-get install openjdk-21-jre-headless (recent server versions need a modern Java; older guides used Java 8, which no longer works)

Termux will ask you to confirm a few prompts along the way — accept them and let it work. This is the slowest part of the setup on an older phone.

Step 3: Download and Start the Server

Grab the official server file from the Minecraft website's server download page. Long-press the minecraft_server.jar link in your browser to copy its address, then download it inside Termux with wget:

wget -O minecraft_server.jar <paste the link here>

Make it executable with chmod +x minecraft_server.jar, then start it:

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

The first launch always stops. That is expected — the server generates its files and then refuses to run until you accept the EULA. Install the nano text editor (apt-get install nano), open eula.txt, and change eula=false to eula=true. Save with Ctrl+X, then Y, then Enter. Run the start command again and the world will generate. Your server is live on your local network.

Step 4: Let Friends Join from the Internet

Players on your home Wi-Fi can already join using the phone's local IP address. For everyone else, the simplest route is a tunnelling tool called ngrok, which gives your server a public address without touching your router settings:

  1. Download the Linux ARM64 build of ngrok and unzip it inside Ubuntu.
  2. Create a free ngrok account and copy your authtoken from its dashboard.
  3. Connect it with ./ngrok authtoken <your token>.
  4. Start the tunnel with ./ngrok tcp 25565.

Ngrok shows a forwarding address in the format 0.tcp.ngrok.io:14970. Send that to your friends. In Minecraft they open Multiplayer → Direct Connect, paste the address, and join. Note that the free ngrok address changes each time you restart the tunnel.

Honest Warnings Before You Commit

A phone is not a data centre. Keep view distance low in server.properties, expect the world to struggle once several players explore in different directions at once, and do not leave the phone unplugged — a dead battery is a server crash. Heat matters too; take the case off. Used this way, though, a retired phone makes a genuinely good always-on world for a small group of friends.

Frequently asked questions

Do I need to root my phone to host a Minecraft server on Android?

No. The whole setup runs inside Termux and a user-space Ubuntu install from AnLinux, so a completely stock, unrooted phone works fine.

Can Bedrock players join a server hosted this way?

Not directly. This method runs the Java Edition server software, so Java players can join with the tunnel address. Bedrock support would require a plugin-based server with a cross-play plugin such as Geyser, which is a heavier setup than a phone handles comfortably.

How much RAM should I give the server?

The -Xmx1024M flag in the start command gives it 1 GB, which suits two or three players on a phone with 4 GB of RAM. On a phone with 6–8 GB you can raise it to -Xmx2048M, but leave memory for Android itself or the system will kill the terminal.

Why does my server go offline when I close Termux?

The server process lives inside the Termux session, so closing the app or letting Android aggressively battery-manage it stops the world. Keep the phone plugged in, exclude Termux from battery optimisation, and leave the session running.