Skip to content
← Back to Community
🔥Minecraft Server on Repl.it!🔥
Profile icon
h
has Hacker Plan
Scoder12

How to run a minecraft server on repl.it

Hey guys today I'm going to show you how to run a minecraft server on repl.it.

Installation is super simple!

  1. Fork this repl.
  2. Run the repl and follow the instructions.
    If you get any errors make sure that you typed everything right or try starting from scratch. Otherwise, comment and I may be able to help you.

Once you see Done! in the console, connect to the ip shown in ip.txt. If you don't want the IP to change you can purchase ngrok premium or use a dedicated minecraft host such as PebbleHost
If you have questions ask in the comments!

How to change minecraft version

  1. If you already have a server, delete the files mc/server.jar and mc.sh
  2. Run the command above that starts with wget again
  3. In mc.sh, find the line that says VERSION=1.16.3 and edit it to your desired version

If you get "signal: killed" or "OutOfMemoryError"

You have two options:

  1. Buy hacker plan
  2. Change the line at the bottom of mc.sh that starts with java to be java -Xmx1G -Xms1G -jar server.jar nogui" to "java -Xmx200M -Xms200M -jar server.jar nogui (thanks @gomgo)

Credits

Huge shoutout to @letsrepl for the initial concept.

Remember to upvote if you enjoyed!

Voters
Profile icon
ANTHONYCAJAMARC
Profile icon
SeX2
Profile icon
VanessaTheng
Profile icon
seomg
Profile icon
FouJi
Profile icon
SagnikRaha
Profile icon
MamiS
Profile icon
IvanShliakhov
Profile icon
SenamGbesemete
Profile icon
HaphyScream
Comments
hotnewtop
Profile icon
Coder100

Just found out I didn't have Minecraft. Take an upvote!
https://repl.it/@coder100/minecraft-or-something-idk-scoder-but-i-have-hacker#ip.txt

Profile icon
TheJuiceTin

@Coder100 lol haha I don't have minecraft too

Profile icon
Coder100
Profile icon
natethemaker

@Coder100 u really should get it

Profile icon
gg2001

Consider putting php -S 0.0.0.0:3000 ip.txt & bash mc.sh in main.sh, instead of just bash mc.sh. This automatically sets up a website for it, making it easier to use with uptime robot.

Once this is setup, go to uptime robot and create a keyword monitor that checks every 5 minutes for the keywords "Server running on". That way the server will stay up all the time.

Don't forget to put the ngrok_token and ngrok_region values in your .env!

Profile icon
Forgiving22

@gg2001 What IP should I use? How do I forward this ever-changing IP to a domain?

Profile icon
Scoder12

@Forgiving22 buy ngrok premium if you want to have an IP that doesn't change https://ngrok.com/pricing

Profile icon
astrochampcambr

@Scoder12 are there any free alternatives to ngrok that have a static IP?

Profile icon
Scoder12

@astrochampcambr you tell me

Profile icon
mesquite2234

@Scoder12 Could you use a Microsoft azure VM? (Not saying they're free, but they have a constant IP)

Profile icon
Scoder12

@mesquite2234 yes, you could do this on any VPS. Here is a tutorial. The one thing I would do differently from that tutorial is using a high-performance jar from https://papermc.io instead of the vanilla jar.

Profile icon
mesquite2234

@Scoder12 Thanks, how do I connect it to repl?
Edit: sorry for the unclear question, I meant to say how would I replace the ngrok thing with a VM

Profile icon
Scoder12

@mesquite2234 I don't know, it would probably require reverse proxies and stuff and would get pretty complicated

Profile icon
mesquite2234

@Scoder12 I have the code to start it, its the connecting from minecraft thing I needed help with.

Profile icon
Scoder12

@mesquite2234 start what

Profile icon
mesquite2234

@Scoder12 I figured out the commands to start and run the server, but I can't connect to a server when I run it on replit, How do I connect?

Profile icon
Scoder12

@mesquite2234 using the ip in ip.txt

Profile icon
mesquite2234

@Scoder12 I dont see one,where is it?

Profile icon
Scoder12

@mesquite2234 in the file ip.txt in the mc folder once you run the server

Profile icon
mesquite2234

@Scoder12 I have my own code for running the server, how do I find the IP? (Again, sorry for the unclear questions)

Profile icon
Scoder12

@mesquite2234 well if its not my code then you can google an ip finder service for the commandline, get your server's IP, and if your azure VM doesn't have any firewalls interfering with it you should be able to connect

Profile icon
mesquite2234

@Scoder12 I invited you to my repl, I need help connecting to this

Profile icon
mesquite2234

@Scoder12 Are you on?

Profile icon
LeoXu2

@gg2001 doesn't work for me. after it starts it just shows this ;-;

image

Profile icon
Blinkjs

@gg2001 i tryes adding that line to mc.sh but webpage dies when server lodes ****sry fr bad English

Profile icon
Blinkjs

@LeoXu2 same

Profile icon
kogutkogut

how to use this?

Profile icon
Onetopic

excited villager noises

Profile icon
Hasibix

how to make it bungeecord i just need to know how to make a bungeecord proxy on replit i know how to connect the servers

Profile icon
Coder100

ree not work here

basically whats the ngrok key reee

Profile icon
Scoder12

@Coder100 You have to login to the dashboard that it gives you, and then copy the auth token

Profile icon
Coder100

ok what do i log in with i don't want to make acc reee @Scoder12

Profile icon
MarcusWeinberger

@Coder100 u have to make acc

Profile icon
Coder100

LMFAO just found out @MarcusWeinberger

Profile icon
angrydoge

Just set up this server then realized that this is a java server after waiting 5 minutes wondering why it wasnt connecting.

Profile icon
PokeGirl1024

Can you do this without Hacker? I'm a random kid wanting to play Minecraft and I've already used my savings for that.

Profile icon
Scoder12

@PokeGirl1024 You can use the Student Developer Pack to get hacker for free

Profile icon
DarshanRajpara1

Does it work for bedrock too?

Profile icon
tussiez

@DarshanRajpara1 If you could find low-level access to the Linux host of the Repl servers, yes. I'm still not sure if you can. With third-party hosts like PocketMine that runs on PHP, I bet you could.

Profile icon
Scoder12

@DarshanRajpara1 Someone was asking for help with a bedrock server using pocketmine, but they were having trouble connecting. I think thats its definitely possible in theory but hasn't been pulled off yet

Profile icon
Leviticusz

unzip not found?

Profile icon
Scoder12
Profile icon
CipherHYt

@Scoder12 your project says that i cannot unzip.. Help?

Profile icon
SquidOrigins

@CipherHYt download the file and unzip it manually on your PC

Profile icon
Scoder12
Profile icon
JuicyGoat

Untitled (51)

it keeps failing to download vanilla

Profile icon
JohannMhl

@JuicyGoat same here

Profile icon
ghost3131

how to install spigot?

Profile icon
OverdriveAR

mine won't run...

mc.sh: line 114: 376 Killed

what does this mean?

Profile icon
Scoder12

@OverdriveAR It means you don't have hacker. Adjust the memory settings according to the comment about it or buy hacker.

Profile icon
JasperLianLian

@Scoder12 How do you do this I couldn't find any .env file
image

Profile icon
Scoder12

@JasperLianLian click main.sh then press the add file button and type .env and then press enter

Profile icon
JasperLianLian
Profile icon
Scoder12
Profile icon
CroxyTheDev

it says "chmod: cannot access 'jre/bin/java': No such file or directory" please help me dude

Profile icon
Scoder12

@CroxyTheDev sorry, should be fixed now if you try again

Profile icon
yadunandanrocks

When is the minecraft Bedrock server coming out? I can help you test it if required

Profile icon
[deleted]

@yadunandanrocks i also want a minecraft bedrock server on repl

Profile icon
Scoder12

@yadunandanrocks not sure, I don't know how to set it up tbh

Profile icon
SquidOrigins

@yadunandanrocks there is a java plugin called geyser that lets them connect to each other i use it sadly its only 1.17 but thanks to viaversion and its other versions you can now connnect 1.7-1.17.11 Java (this includes Minecraft VR) and the current Bedrock edition to each other on 1 server with no lag issues the only issue may be PvP related but that is only an issue for big servers.

Profile icon
DiveshTheReal

i just create the server and got this Can't keep up! Is the server overloaded? :/

Profile icon
Scoder12

@DiveshTheReal yeah but it still works

Profile icon
DiveshTheReal
Profile icon
kreemrs

Hey, any way to keep the server alive? The server closes very quickly even with hacker plan, I even lost ~5min of progress (autosave).
I wasn't able to listen to port 8080 & host the mc server at the same time as the http server would close as soon as the mc server started.

Any suggestions or plans?

Unrelated: Inside of your server.properties, I'd recommend setting sync-chunk-writes=false to improve performance & enable-rcon=false as rcon is not being used.

Profile icon
Scoder12

@APCSPShehadaK its very tricky to have multiple ports listening on repl.it and have the correct one be forwarded but you might be able to get it to work.

Profile icon
kreemrs

@Scoder12
Solved with a vanilla php server on port 3000.
index.html is a placeholder, the file can hold anything but should exist.

main.sh:
php -S 0.0.0.0:3000 index.html & bash mc.sh

Profile icon
12944qwerty

Yo, apparently the api no longer works and you need to update to paper v2 api. Do I just change the install link that's in the code and that's it?

image

Profile icon
12944qwerty
Profile icon
seomg

trash

Profile icon
uuuukatman

ngrok: command not installed, but was located via Nix. How Can I fix it?

Profile icon
roblokstop
Profile icon
AdvaitArun
Profile icon
seikuraz

image

503 error occurs and it stops

Profile icon
CodingPotatos

Doesn't work ;(

Profile icon
mochakiji

Looks useful. I was just looking for a new server. I am not sure if I will be able to run it myself, but I will ask my friend, a programmer, to do that. If it works out, we will play there. If not, we will continue to play on minecraft servers https://servers-minecraft.net where we used to play before that. They are cool, but sometimes you want to try something new. However, if this new idea does not work or becomes too troublesome, we will return to the good old places that we already know well and love. Also, if we cannot play on this server without our programmer friend, this all be senseless because he’s often absent.

Profile icon
dietcok

How do I fix error code 8?

Profile icon
LucasPerrone

this thing is dumb

Profile icon
aaaaaa1233455

hello how do i make it crossplay so i can play with my frkend on bedrock edition

Profile icon
Emile2021coding

hey everyone
here it's just not loading
I am using fabric as server.jar
please help
I just moved from falixnodes because they removed mods and I'm searching a solution