How to Host a Minecraft Server on Android

Minecraft is one of the unique games which lets you create a personal server for multi-player gaming. You can host a Minecraft server on Windows, Linux, and macOS, but it doesn’t support Android devices which is a bummer. Having a portable server like an Android device would have surely made playing Minecraft a lot more fun. So in search of a solution, we discovered an interesting way which lets you host a Minecraft server on an Android device. The process is a bit lengthy and technical, but if you want to do it, you can definitely do it. So without further ado, let’s go ahead and learn how to host a Minecraft server on Android.

Host Minecraft Server on Android

Let me put it straight, the process is a bit complex and you will need some degree of technical knowledge in dealing with command terminal. From my side, I have tried to simplify the process as much as possible. Anyway, to give you a brief overview, we are going to install Ubuntu on top of Android. And from there, we can install a Minecraft server seamlessly. Now having said that, let’s begin with the first setup.

Note: We have done our testing on the OnePlus 7 Pro. You can use any other Android device preferably with higher RAM and decent processor.

  • Install Ubuntu on Your Android Device

1. First of all, install AnLinux (Free) and Termux apps (Free) from the Google Play Store.

2. Now, launch AnLinux app and tap on the “Choose” button and select “Ubuntu”. After that, tap on “Copy”.

Install Ubuntu on Your Android Device

3. Now open the Termux app, paste the copied script and tap the “Enter” key. Termux will start downloading Ubuntu and it will take 2-3 minutes to install Ubuntu.

Install Ubuntu on Your Android Device 3

4. After the installation is done, paste and run the following command to launch Ubuntu. Now, you will see root@localhost on Termux. It means Ubuntu is successfully running on your Android device.

./start-ubuntu.sh

Install Ubuntu on Your Android Device 2

  • Install Java Development Kit on Ubuntu

1. Now that we have installed Ubuntu, let’s install some packages required to run Minecraft server. First off, we will install the JDK package on Ubuntu. Copy the following command and run it on Termux. Now, wait for the installation to complete.

apt-get install software-properties-common

Install Java Development Kit on Ubuntu

2. After that, copy the following commands and run on Termux one by one. At times, Termux will seek your approval before installation so allow those requests. This whole process will take 3-4 minutes.

add-apt-repository ppa:openjdk-r/ppa

apt-get update

apt-get install openjdk-8-jre

Install Java Development Kit on Ubuntu 2

  • Install Minecraft Server on Android

With the installation of Ubuntu and JDK, we have almost set up the base required to run a personal server. Now, we will finally install a Minecraft server on Android. Here are the steps to follow.

1. Open the Minecraft Server page from this link on your Android device. Here, tap and hold on “minecraft-server.jar” and copy the download link.

Install Minecraft Server on Android

2. Now, move to Termux and paste the command mentioned below. Make sure to replace the https link with the download link copied above. It will look something like this on Termux. Now, tap the enter key to run the command and it will start installing Minecraft Server on your Android device.

wget -O minecraft_server.jar https://launcher.mojang.com/v1/objects/3dc3d84a581f14691199cf6831b71ed1296a9fdf/server.jar

Install Minecraft Server on Android 2

3. After the installation is complete, run the following command to change the file permission. This time, Termux won’t prompt anything, but changes have been made. Now move to the next section.

chmod +x minecraft_server.jar
  • Run Minecraft Server on Android

1. You have successfully installed a Minecraft server on Android. Now, we will try to run the server. Copy the following command and run it on Termux. Do note, it will fail on the first run due to non-compliance of the EULA agreement. Worry not, move to the next step to fix it.

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

Run Minecraft Server on Android

2. Run the following commands one by one. It will let you access the EULA agreement and then you can make changes accordingly.

apt-get install nano

nano eula.txt

3. On the Nano text editor, change “eula=false” to “eula=true”. Editing text file on Nano editor is tricky though. You can’t navigate using the touchscreen. So, press the “down” key thrice to bring the cursor below the last text. After that, press backspace to move to the above line and then keep pressing backspace to delete false. Now, you can type true.

Run Minecraft Server on Android 2

4. After you have changed the EULA text, tap “CTRL” and then tap the “x” key. It will ask for modifying the file, press “y” and it will save the changes. Finally, tap the “Enter” key and you will be back to Termux.

Run Minecraft Server on Android 3

5. Now, run the same command again as we did in the first step and this time, Minecraft Server will successfully run on your Android phone. Here is the command, if you need again. The process will not take more than a minute.

java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

Run Minecraft Server on Android 4

  • Tunnel Your Local Minecraft Server to the Internet

So far, we have installed a Minecraft server on our Android device, but we need to bring the server online through a secure tunneling tool called Ngrok. It creates a secure public URL of your server which you can share with your friends for multi-player Minecraft gaming. Here is how to do it.

1. Open the Ngrok download page and tap and hold on “Linux (ARM64)”. Now, copy the download link.

Tunnel Your Local Minecraft Server to the Internet

2. After that, go back to Termux and paste the following command. Make sure to replace the https link with the copied Ngrok link from the above step. Now, tap the “Enter” key and it will start installing Ngrok on your Android device.

wget -O ngrok.zip https://bin.equinox.io/a/nmkK3DkqZEB/ngrok-2.2.8-linux-arm64.zip

Tunnel Your Local Minecraft Server to the Internet 2

3. After the installation, run these commands one by one.

apt-get install zip unzip

unzip ngrok.zip

4. After you have done that, open the Sign Up page of Ngrok and create an account. Now log in and it will offer you an authentication token under “Connect Your Account” section. Copy the authtoken key.

Tunnel Your Local Minecraft Server to the Internet 3

5. Now run the authtoken key on Termux. It will look something like this.

./ngrok authtoken 1QVNoeHerkYbSncmdjIj2yfaGNk_3Zt1hTF1nY9WyGY5BoSU2

6. After that, run the below command and Ngrok status window will open. If it shows session status as “online”, you have successfully created your personal Minecraft server on Android. Your Minecraft server is live on the internet.

./ngrok tcp 25565

Tunnel Your Local Minecraft Server to the Internet 4

7. Now, copy the “Forwarding” address which starts with tcp. It’s the public URL that you can share with your friends for Minecraft multi-player gaming. It should look something like this.

0.tcp.ngrok.io:14970

Tunnel Your Local Minecraft Server to the Internet 5

8. If you want to exit from internet tunneling, tap “CTRL” and “C” keys and your Minecraft server will go offline.

  • Play Multi-Player Minecraft with Your Friends

Open Minecraft and log in to your account. Go to Multi-player menu and open “Direct Connect”. Here, paste the Forwarding address copied from Step 7 in the above section and press the “Join Server” button. Voila, you are connected to your personal Minecraft server hosted on an Android device. Enjoy!

Play Multi-Player Minecraft with Your Friends

SEE ALSO: 15 Best Sandbox Games like Minecraft You Should Play

Host Minecraft Server on Android and Enjoy Personal Gaming

So that was our long guide on how to create a Minecraft server on Android smartphones. As we can see, the steps are quite technical and you have to set up a lot of things before you can create an online server. Nevertheless, I have tried to make the process as simple as possible with collaborative steps and screenshots. Anyway, that is all from our side. If you were able to create a Minecraft server on your Android device, do share your forward address. We would love to play Minecraft with you.

#Tags
comment Comments 24
  • Evd0 says:

    How do i add geyser and viaversion to it?

  • Siddharth says:

    I wasn’t able to install Ubuntu it says unable to locate pakage wget

    • Jamais says:

      Same

      • Jay says:

        You want to update termux to 0.117

    • CatCraft3512 says:

      Download from “AnLinux” from google play store

  • Anonymous says:

    Make sure to type apt-get update before doing any of the commands other wise they won’t work

  • Hyn says:

    Would like to know if there’s a way to put the jar file manually, skipping the download part. The purpose is to install minecraft forge/bukkit instead of vanilla server. I’m kind of noob to this, so if someone could help. Thnaks

  • Akshay says:

    Guys. I’m not able to unzip the ngrok file !!

    • muso says:

      same problem

      • Draf says:

        Any update on this?

      • Sunny Guan says:

        The new zip file from ngrok uses .tgz file extension instead. To fix that, run `tar -xvzf ngrok-stable-linux-arm64.tgz` (or whatever you renamed it as) instead of using unzip. If it says that tar is not installed, run `apt-get install tar`

      • SQPD says:

        It gives me this:

        tar: ngrok-stable-linux-arm64.tgz: Cannot open: No such file or directory

  • ScratchyBear says:

    Can anyone help with this
    Its saying this command is invalid
    java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

    • gryffindor_001 says:

      the actual filename is changed in the tutorial the file you download is named “minecraft_server.1.15.2.jar”
      Make sure you enter the name correctly aal the time it is shown in the tutorial
      it happened with me too

    • Precious Nyaupane says:

      just type ls and see what is the name of your minecraft server and replace “minecraft_server” with the name of your minecraft server

  • ScratchyBear says:

    It’s saying this command is invalid
    java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

  • Ashik says:

    can u guys make a tutorial on how to host a bedrock server of minecraft?

  • Vynokris says:

    Hey !
    My server is now running on my android device, but how do I acess its files? I want to change the map to one that I have already started.
    Can anyone give me advice?

    • Greifent says:

      Look at ubuntu-fs directory inside termux, that is the / directory of the VM

  • Vynokris says:

    Hi,
    I’ve followed all the steps until and I ran the server. After this, I can only type in the command box of the server (minecraft commands like /kill or /ban). I can’t put it online because I have no way of executing the “./ngrok tcp 25565” command outside of the server command box.
    Could you help me with this please ?

    • Vynokris says:

      I figured it out : you need to make a second session for ngrok

      • Sadiq Ali says:

        how to make a second session for ngrok, please tell

      • Greifent says:

        tap on the left of the Termux session, you should see a white page, move that page to the right and click new session

Leave a Reply