Skip to content

An easily deployable Minecraft server template for Replit.

License

Notifications You must be signed in to change notification settings

etcherfx/MCServerTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCServerTemplate

An easily deployable Minecraft server template.

CodeFactor License GitHub issues
GitHub Release

Links

Projects Used

Deployment

Method 1 - Deploy from Github:

Run on Replit

  • Open the Run on replit button in a new tab and press Import from Github

Method 2 - Manual Cloning:

  • Create a new Bash repl

  • Type the following command into the shell:

    git clone https://github.com/etcherfx/MCServerTemplate.git && shopt -s dotglob && mv MCServerTemplate/* MCServerTemplate/../ && rm -rf MCServerTemplate main.sh
    

Setting Java Versions

  • In the files section on replit, click the three dots and hit Show hidden files

  • Navigate to replit.nix and follow these intructions:

    • For Minecraft 1.16.x and below, do not change anything.
    • For Minecraft 1.17.x and above, make sure to change pkgs.openjdk8-bootstrap to pkgs.openjdk17-bootstrap

Creating Enviornment Variables

  • Click on the Secrets button in the tools section on the far left side of your screen

  • Create a new secret called ngrok_region and input one of the regional codes from the list below as the value:

    Choose the closest region for better network connectivity.

    Region Code
    United States (Ohio) us
    Europe (Frankfurt) eu
    Asia/Pacific (Singapore) ap
    Australia (Sydney) au
    South America (Sao Paulo) sa
    Japan (Tokyo) jp
    India (Mumbai) in
  • Do the same for the variables in the list below:

    Key Value
    ngrok_token Your authtoken for ngrok.
    SERVER The server software in all lowercase. e.g purpur
    VERSION Version of Minecraft your server is running on. e.g 1.19.4
    BUILD The build number of your server software. Only use this if you have paper as the server software

    If you don't have a ngrok authtoken, you can visit here and make an account to get your token.

  • List of server software supported:

  • Here are some recommended build numbers for paper:

    Minecraft Version Build #
    1.20.4 364
    1.19.4 550
    1.18.2 388
    1.17.1 411
    1.16.5 794
    1.15.2 393
    1.14.4 245
    1.13.2 657
    1.12.2 1620
    1.11.2 1106
    1.10.2 918
    1.9.4 775
    1.8.8 445

    To get a list of all build numbers for paper, visit here

Running the Server

  • Run the repl and follow the instructions on the console
  • Once the console displays Done! For help, type "help", navigate to status.log and copy the IP address on line 7 and enter it inside of Minecraft. The IP should be something like tcp://9.tcp.eu.ngrok.io:46797 and you want to copy the whole address EXCEPT the tcp:// part.

Server Optimization

  • Follow this server optimization guide