Giter VIP home page Giter VIP logo

minecolab's Introduction

Logo

MineColab

Run Minecraft Server on Google Colab

Open In Colab

πŸ™‰ First of all, what is google Colab?

As the official FAQ says, colaboratory, or β€œColab” for short, is a product from Google Research. Colab allows anybody to write and execute arbitrary python code through the browser, and is especially well suited to machine learning, data analysis and education. More technically, Colab is a hosted Jupyter notebook service that requires no setup to use, while providing free access to computing resources including GPUs. In short, it is a vm provided for learning, running python code, machine learning or for general purpose.

πŸ’° Is it really free to use?

Yes, Colab is free to use. But there are some points which, according to me one should keep in mind:

  1. Though colab is a free service, it shouldn't be exploited indiscriminately or without any care. One should value that its a resource offered for no cost and can get depleted/restricted if the demand increases out of control.
  2. If it isn't obvious, one shouldn't run mission-critical services (like large and important servers/databases/python programs) on it. Its resources are not guaranteed and not unlimited, and the usage limits sometimes fluctuate. Also, the notebook has a maximum runtime of 12 hours, after which, it should be manually restarted.
  3. If you need to use it pretty often for intensive tasks, consider purchasing a vps server. A heavy increase in server load would force google to close the service.

In the end, it is just my personal opinion and can be ignored safely. Just ask your heart whats right and whats wrong. Also, please try to use it as a once in a while resource and not 24x7 so that others can avail the free resources too.

πŸ“ƒ Instructions

  1. Open the notebook in google colab.
  2. Read through the notebook, most of the code is self explanatory. Run the cells which are useful for your use-case.
  3. Run the first cell which runs the Minecraft server.
  4. Now you have three options. You can either use ngrok, playit.gg or cloudflare's argo. Ngrok is easy to setup and doesn't requires anything to be installed by the clients but it can often be quite unreliable. Argo doesn't have such limitations but requires a bit more work. Playit.gg's implementation is unpolished at the moment (debug log spam) but offers convenient static subdomains.
  • Ngrok: Change tunnel_service variable and follow the prompts.
  • Cloudflare argo:
    1. After running the first cell,Your free tunnel has started! Visit it <tunnel_address> would be logged in the notebook console.
    2. Download Cloudflared client on all the client machines.
    3. Now on your local machine, launch the binary with ./cloudflared-linux-amd64 access tcp --hostname <tunnel_address> --url 127.0.0.1:25565
    4. Finally, connect to 127.0.0.1:25565 from your minecraft client.
  • Playit.gg: Change tunnel_service variable, ignore the debug output (todo:fix) and follow the prompts.

⚑ So, how does it actually work?

As Google Colab is a VM running Ubuntu server as base OS, it can be easily used as a Minecraft server. Here are the steps which the notebook performs to setup the server:

  1. Update the system's apt cache.
  2. Install Openjdk-16 (Java) through apt-get.
  3. Mount Google Drive to access the minecraft folder (Drive is used here to provide persistent storage).
  4. Setup Argo/ngrok/playit Tunnel (Opening a tunnel at port 25565) depending on the tunnel_service variable.
  5. Change directory to the minecraft-server folder on google drive ("Minecraft-server" is the default, located in the root directory of my Google Drive.)
  6. List/Print the file list on the screen to indicate succesful directory change.
  7. Startup the Minecraft server (with optimized JVM parameters from Aikar's guide)

πŸ› Found a bug?

Report report the bug by creating a new issue and use this helpful issue template.

Or suggest a new feature using this template.

πŸ‘ Tips

  • If something does not work, try using a VPN like windscribe before opening an issue.
  • Switch between the three different tunnel providers and see which works best for you.
  • Make regular backups of your world.

ForTheBadge built-with-love

minecolab's People

Contributors

thecoder-001 avatar infibrocco avatar turtleship69 avatar iamtakingithard avatar thepotatochronicler avatar rhld16 avatar hyusap avatar imgbotapp avatar beliboba avatar orangemn6 avatar retronbv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.