I got a server running on a phone, and here's how!

  • Thread starter Thread starter /u/Kindly_Swim8051
  • Start date Start date
U

/u/Kindly_Swim8051

Guest
It turns out it's really simple to host a server on a phone, as long as it runs android or is android based.

Steps 1-11: Basic java server

Step 12+: Java server with geyser and floodgate


  1. Install F-DROID


  2. Install Termux (Do it from the link, there are a lot of misleading Termux apps in F-DROID. You can get Termux from Google Play, but it doesn't have the same permissions/capabilities)


  3. Install java by running pkg install openjdk-21


  4. Make the directory for it by running mkdir <directory name>


  5. Go into it by typing cd ~/<directory name>


  6. Install wget by running pkg install wget


  7. Install paper by running wget https://fill-data.papermc.io/v1/objects/84f4283253ae7e50a25b26ef3b03d57818145534fb0c8a27925b7bae59222ba6/paper-1.21.11-99.jar


  8. Change the paper jar file to something better by running mv paper-1.21.11-99.jar paper.jar The file is now called paper.jar


  9. Start the server by running java -Xms512M -Xmx8192 Change the second number to 75% or less of the RAM of your phone.


  10. Accept the eula. The server will stop, and tell you to accept the eula. Run nano eula.txt and change eula=false to eula=true


  11. Start the server again, and you're done! To let people outside your network connect, either forward the port, or, as I did, set your phone a static IP and use playit on another device. To set your phone to static IP, go to your WiFi settings, find the network you're connected to, and change IP settings to static, then change the IP to something high, like 192.168.1.150. Then make a playit tunnel to your phone and people can connect.

Optional: Change the server properties file by running nano server.properties and editing the file to however you want.


  1. Change into the plugins folder by running cd ~/<directory name>/plugins


  2. Download geyser by running wget https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot


  3. It will be named spigot, so rename it by running mv spigot geyser.jar


  4. Install floodgate with wget https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot


  5. Again, it will be called spigot, so use mv spigot floogate.jar to change it.


  6. Make a second playit.gg tunnel for it, and run the server. Geyser and Floodgate will set up.


  7. Edit the Geyser config file to use Floodgate by running cd ~/<directory name>/plugins/Geyser-Spigot then use nano config.yml and look for the line where auth-type: online and replace it with auth-type: floodgate

Now, your server is fully set up, and to start it run java -Xms512M -Xmx8192, again changing the second number to 75% or less of your phones RAM. I did this on a Samsung S20 5G with 12GB RAM and it ran perfectly. If you have any issues post them below and I'll try to help.

submitted by /u/Kindly_Swim8051
[link] [comments]

Continue reading...
 
Back
Top