Share your repls and programming experiences

← Back to all posts
🔥Minecraft Server on Repl.it!🔥
h
Scoder12 (797)

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.

Note: You need hacker plan for this to work right now!

Installation is super simple!

  1. Start a new bash repl
  2. In the console paste this:
wget -O mc.sh https://xpiredl.scoder12.repl.co/mc.sh
  1. In main.sh, paste this:
bash mc.sh

Run the repl and follow the instructions!
Once you see Done! in the console, connect to the ip shown in ip.txt
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 (even if you already have the script)
  3. In mc.sh, find the line that says VERSION=1.16.3 and edit it to your desired version

Huge shoutout to @letsrepl for the initial concept.

Remember to upvote if you enjoyed!

Comments
hotnewtop
Onetopic (5)

excited villager noises

gg2001 (4)

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!

Forgiving22 (0)

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

Scoder12 (797)

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

JasperLianLian (1)

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

Scoder12 (797)

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

Coder100 (15389)

ree not work here

basically whats the ngrok key reee

Scoder12 (797)

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

Coder100 (15389)

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

CroxyTheDev (2)

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

Scoder12 (797)

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

zhidao (13)

I actually made a server!!! You have to make a .env file beforehand and it will work!

zhidao (13)

@zhidao

and plus, I have Minecraft

ThomasHagan (2)

how did you make the .env file? @zhidao

zhidao (13)

@ThomasHagan

bruh

just make a .env file named .env and put ur ngrok token inside

ThomasHagan (2)

@zhidao I tried that. I'll start again and create the .env file first as you mentioned. I was thinking there was something in the naming I may have been missing. Thanks!

zhidao (13)

@ThomasHagan no the .env file is lit named ".env"

ThomasHagan (2)

@zhidao Thanks! Felt a bit dumb to find that out.

yadunandanrocks (1)

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

santacountdown (14)

@yadunandanrocks i also want a minecraft bedrock server on repl

Scoder12 (797)

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

DiveshTheReal (102)

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

PokeGirl1024 (2)

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

DarshanRajpara1 (13)

Does it work for bedrock too?

tussiez (734)

@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.

Scoder12 (797)

@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

IronBoy345 (0)

how to allow cracked clients to join the server?

Scoder12 (797)

@IronBoy345 find the line in server.properties that says online=true and replace it with online=false

VoltyDragon (0)

I am getting an error, though I believe I did all of the installation steps right. What did I do wrong?

Scoder12 (797)

@VoltyDragon that is very weird. It seems like a temporary repl.it issue. Try again and if it still doesn't work, replace https with http

VoltyDragon (0)

@Scoder12 thank you, it worked this time!

Ravens0606 (72)

why is it only hacker plan?

Scoder12 (797)

@Ravens0606 because minecraft servers use a lot of memory

Ravens0606 (72)

ok, do you know how to run it on my computer directly? @Scoder12

SiuIeng (0)

@Scoder12 Can I upload my existing world to the server? :D

Scoder12 (797)

@SrNox weird. I have no idea how to solve that.

YeetsaJr (19)

@Scoder12 Two things, Frist, I keep getting this error,
and idk what to do, pls help.
Second thing, I hate to ask this but in the instructions can you put down in all caps "YOU DON'T NEED TO FORK THE REPL BELOW" because I did, and worked on the web design only to find out I didn't need to lol. Hope you can help!

Scoder12 (797)

@YeetsaJr The error is because you don't have hacker plan. If you read the whole post you wouldn't have either of these issues.

YeetsaJr (19)

@Scoder12 Ah, sorry for my stupidity lol, by any chance do you know why you need hacker plan?

Scoder12 (797)

@YeetsaJr java is a memory hog and what you're seeing is the server not having enough memory. Hacker plan includes double the memory. (You can get hacker plan for free with GitHub student developer pack)

927gaming (0)

as the ngrok tunnel change, all the data in the server gets lost.
is there anyway i can use my ip and port or if i can save that data before ip port gets changed?

Scoder12 (797)

@927gaming You mean save your world data? Well, it would help to stop the server by typing stop in console or /stop in chat. I have also had issues with it saving and I think this is due to repl.it not snapshotting the files. I am not 100% sure how to fix it but maybe by opening all of the files in mc/world and it's subfolders in the editor before you leave the editor. Hope this helps!

927gaming (0)

@Scoder12 I was thinking if there was a way to use the ip address and port instead of using ngrok's tunnel, I have the hackers plan and I can make it 24/7 but as soon as the tunnel port changes all the data get deleted, so I guess using ip and port might help us.

Scoder12 (797)

@927gaming which data are you referring to? The repl.co URL only accepts websites, so minecraft data cannot be sent through it. The only way to get the IP and port to stay the same is to pay for ngrok premium.

927gaming (0)

@Scoder12 i was saying about the game data, anyways thanks for the help!!

Fletchermed (0)

Does it work for minecraft 1.16.5?

Scoder12 (797)

@Fletchermed it should, try with a brand new repl and follow the instructions in the post to change the version

DemonKingSwarn1 (0)

how to make someone OP in this repl server hosting ???

Scoder12 (797)

@DemonKingSwarn1 while its running type op TheirName in the console

927gaming (0)

how can i update the java version?

Scoder12 (797)

@927gaming why would you want to do that

ByGoneNeutron (0)

chmod: cannot access 'jre/bin/java': No such file or directory
exit status 1

please help

Scoder12 (797)

@ByGoneNeutron delete repl and try again. If you are concerned about losing your world, delete mc.sh and re-download it

ByGoneNeutron (0)

dont have a world yet D: @Scoder12

Scoder12 (797)

@ByGoneNeutron then delete the repl and try again, it was a bug in the script so dw its not your fault

DemonKingSwarn1 (0)

i got an "unknown host" error inside minecraft.
Also how to update the server to latest minecraft version.

Scoder12 (797)

@DemonKingSwarn1 Are you connecting to the ip that is in ip.txt after it says "Ready" in the console? and check the post, I updated it with instructions on how to update to latest version

927gaming (0)

how can I upgrade the server version?
it says outdated server i'm still on 1.15.1

Scoder12 (797)

@927gaming Delete the repl and try again, should work now

AcceleratedCode (37)

I got a SSL error "Unable to establish SSL connection." in wget. using Curl got me curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to xpiredl.scoder12.repl.co:443

Scoder12 (797)

@AcceleratedCode Hi, replit is experience issues with all server repls lately, so you'll have to manually copy and paste the script from the repl I linked to the post.

EpicBoomerMomen (0)

Hey, first of all thank you for the helpful tip! Can you upload an existing world onto the server?

Scoder12 (797)

@EpicBoomerMomen Yep, you can, once you run the script for the first time it should create the traditional server file structure. Then you can stop the server and replace the world .dat files by uploading into the repl. Only thing to keep in mind is that there is a size limit per repl that cannot be increased.

willuhmjs (13)

coder dm me on discord. is it possible you and i can work on doing this but for SCP:SL servers instead?

AyoX2 (1)

It says the server is overloaded and cant keep up

AphixDev (216)

aish, I'm a bash noob. How do u do the .env stuff?

athenaluo (34)

Do we have to download Xpire?