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!
- Start a new bash repl
- In the console paste this:
wget -O mc.sh https://xpiredl.scoder12.repl.co/mc.sh
- 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
- If you already have a server, delete the files
mc/server.jar
andmc.sh
- Run the command above that starts with
wget
again (even if you already have the script) - In
mc.sh
, find the line that saysVERSION=1.16.3
and edit it to your desired version
Huge shoutout to @letsrepl for the initial concept.
Remember to upvote if you enjoyed!
it says "chmod: cannot access 'jre/bin/java': No such file or directory" please help me dude
@CroxyTheDev sorry, should be fixed now if you try again
chmod: cannot access 'jre/bin/java': No such file or directory
exit status 1
please help
@ByGoneNeutron delete repl and try again. If you are concerned about losing your world, delete mc.sh and re-download it
dont have a world yet D: @Scoder12
@ByGoneNeutron then delete the repl and try again, it was a bug in the script so dw its not your fault
i got an "unknown host" error inside minecraft.
Also how to update the server to latest minecraft version.
@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
how can I upgrade the server version?
it says outdated server i'm still on 1.15.1
@927gaming Delete the repl and try again, should work now
When is the minecraft Bedrock server coming out? I can help you test it if required
@yadunandanrocks i also want a minecraft bedrock server on repl
@yadunandanrocks not sure, I don't know how to set it up tbh
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
@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.
Hey, first of all thank you for the helpful tip! Can you upload an existing world onto the server?
@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.
coder dm me on discord. is it possible you and i can work on doing this but for SCP:SL servers instead?
i just create the server and got this Can't keep up! Is the server overloaded? :/
@DiveshTheReal yeah but it still works
It says the server is overloaded and cant keep up
aish, I'm a bash noob. How do u do the .env stuff?
Do we have to download Xpire?
ngrok.com does not load
@RossJames weird, I don't know how to fix
chmod: changing permissions of 'jre/bin/java': Disk quota exceeded
exit status 1```
It seems to have stopped working.
@gg2001 exactly what it says: disk quota exceeded. Try a new repl, don't load as many chunks next time
I dont know bash
It deos not work do u know to to fix it
@nahu you have to give more information than that.
i dont no where the console [email protected]
i can't connect - i keep getting io.netty.channel.abstractchannel$annotatedconnectexceptioon: connection timed out
@iPenguin weird, what does your IP look like?
@Scoder12 here's an example one: 0.tcp.ngrok.io:12679
@iPenguin thats completely expected. Are you sure you waited until the server printed out Done!
and your internet is fine?
@Scoder12 yeah. i thought it might have been something i messed with in server files, so i tried recreating the server a few times in a new completely new repl but with the same results
@Scoder12 also, the server console never logs that i attempted to join and the motd never appears in the server list
@iPenguin share the repl with me maybe I can help
@iPenguin Try running it again, make sure that it prints out "Done" before you join
@Scoder12 just did, doesnt work for me. i could try to get one of my friends to join later today and see if it works for them
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
!
Could you explain what this does?
(by the way everyone, I'm BACK!!!)
Is there a way to use a dedicated IP?
@iPenguin yeah, pay for ngrok pro plan or use some sort of dynamic dns
@Scoder12 ah ok
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.
@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.
@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
Java or Bedrock? (Not that I want to do it, I just want to find out) Im pretty sure its Java. :(
@CarlosRosiles yep java. Bedrock server might happen, stay tuned...
@Scoder12 yay!
where is the console?
@dm89263 The console is the normal console you have on the side of your IDE.
Do you have to run this file on the same computer that you play minecraft on? And is it a different IP address each time you run it, so that you can make multiple servers?
Other than those questions, I think this is totally, completely awesome!!!!!!!
@lphi71086 No, the repl can be open on any computer as long as it is open. And the IP address is different every time so you can have multiple servers.
For some reason, it keeps saying that I need to put ngrok_token in my .env file even though it's already there.
When I run bash mc.sh from the console is comes with the previous error, if I run it from the main.sh on start it comes with a new message:
Environment variable ngrok_region not set.
In your .env file, add a line with:
ngrok_region=
and then right after the = add your region, one of:
us - United States (Ohio)
eu - Europe (Frankfurt)
ap - Asia/Pacific (Singapore)
au - Australia (Sydney)
sa - South America (Sao Paulo)
jp - Japan (Tokyo)
in - India (Mumbai)
@QuintenBuwalda you can't run it from the console because if you run it in the console, the .env
doesn't work. This new message means that you set the first variable correctly, and now it wants you to add a second one.
@Scoder12 Is there a problem with my .env
now?
ngrok_token=TOKEN
ngrok_reigon=ap
I've run the the script from main.sh and it still comes with the invalid region error.
@QuintenBuwalda you spelled region wrong
@Scoder12 Oops! My bad...
Can you do this without Hacker? I'm a random kid wanting to play Minecraft and I've already used my savings for that.
@PokeGirl1024 You can use the Student Developer Pack to get hacker for free
how does it run in terms of performance?
does it lag?
how many players can it support?
@AyoX2 On hacker I played with 3 people with no lag, but I haven't tested with more than that.
I'm confused. Can you show me the steps in pictures along with captions please?
@ohnayR just follow the post. Also, you need to have hacker plan first or it won't work
@Scoder12
Dang, I really wish I had Hacker for free for a lifetime... What a dream.
how can i update the java version?