Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
242

πŸ”₯Minecraft Server on Repl.it!πŸ”₯

Scoder12
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!

2 years ago

Voters

Comments

TopNew
40
5
TheJuiceTin
TheJuiceTin

@Coder100
lol haha I don't have minecraft too

2 years ago
3
natethemaker
natethemaker

@Coder100
u really should get it

2 years ago
17
gg2001
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!

2 years ago
2
Forgiving22
Forgiving22

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

2 years ago
2
Scoder12
Scoder12

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

2 years ago
3
astrochampcambr
astrochampcambr

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

2 years ago
2
mesquite2234
mesquite2234

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

2 years ago
2
Scoder12
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.

2 years ago
2
mesquite2234
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

2 years ago
1
Scoder12
Scoder12

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

2 years ago
1
mesquite2234
mesquite2234

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

2 years ago
2
mesquite2234
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?

2 years ago
2
Scoder12
Scoder12

@mesquite2234
using the ip in ip.txt

2 years ago
1
mesquite2234
mesquite2234

@Scoder12
I dont see one,where is it?

2 years ago
1
Scoder12
Scoder12

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

2 years ago
1
mesquite2234
mesquite2234

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

2 years ago
1
Scoder12
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

2 years ago
0
mesquite2234
mesquite2234

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

2 years ago
2
LeoXu2
LeoXu2

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

image

2 years ago
1
Blinkjs
Blinkjs

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

1 year ago
1
kogutkogut
kogutkogut

how to use this?

1 year ago
7
Onetopic
Onetopic

excited villager noises

2 years ago
4
Hasibix
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

1 year ago
4
Coder100
Coder100

ree not work here

basically whats the ngrok key reee

2 years ago
1
Scoder12
Scoder12

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

2 years ago
2
Coder100
Coder100

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

@Scoder12

2 years ago
3
angrydoge
angrydoge

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

2 years ago
3
PokeGirl1024
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.

2 years ago
3
Scoder12
Scoder12

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

2 years ago
3
DarshanRajpara1
DarshanRajpara1

Does it work for bedrock too?

2 years ago
1
tussiez
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.

2 years ago
1
Scoder12
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

2 years ago
Load more