Home/Projects/Minecraft Colab Server
Minecraft Colab Server

Minecraft Colab Server

Overview

Host a free Minecraft server using Google Colab.

Documentation

๐ŸŽฎ Free Minecraft Server on Google Colab (with Playit.gg & Google Drive)

Open In Colab Minecraft Version Java Version Tunnel Provider Storage License: MIT

Host a high-performance Minecraft Server for FREE using Google Colab's cloud infrastructure (up to 12 GB RAM) and connect with friends anywhere in the world without any port forwarding using Playit.gg.

All your worlds, player inventories, and server configurations are synced directly to your Google Drive in real-time, ensuring zero data loss across sessions!


โœจ Features

  • โšก All-in-One Background Startup: Launches Playit.gg tunneling and your Minecraft server concurrently in the background in ~5 seconds.
  • ๐Ÿ’พ Google Drive Persistent Storage: Worlds, configs, and plugins save straight to your Drive in real-time.
  • โ˜• Latest Java 25 Support: Out-of-the-box support for the newest Minecraft releases (including 26.3+), powered by JDK 25.
  • ๐ŸŒ Dynamic API Version Resolution: Automatically downloads the latest builds for Vanilla, PaperMC, Purpur, or Fabric.
  • ๐Ÿ”— Zero Port-Forwarding (Playit.gg): Easily create a public IP/domain so friends can join with zero router configuration.
  • ๐Ÿ’ป Complete Console Output: Built-in command terminal with full output capture (no truncation when running large commands like help).
  • ๐Ÿ”“ Cracked / Offline Support: One-click toggle for offline launchers (TLauncher, PojavLauncher, etc.) with accurate offline UUID whitelist management.
  • ๐Ÿ”„ Persistent IP: Reuses your saved Playit configuration from Google Drive, so your server IP remains identical across Colab restarts!

๐Ÿ“‹ Table of Contents

  1. Prerequisites
  2. Quick Start Guide
  3. Step-by-Step Instructions
  4. How to Connect to Your Server
  5. In-Game Admin & Commands
  6. Stopping & Restarting
  7. Troubleshooting & Common Errors
  8. Advanced Tips

๐Ÿ“ฆ Prerequisites

Before starting, make sure you have:

  1. A Google Account (to access Google Colab and Google Drive).
  2. A free Playit.gg account.
  3. A Minecraft Java Edition client on your computer.

๐Ÿš€ Quick Start Guide

  1. Click the Open In Colab badge at the top to launch the notebook directly in Google Colab (no manual file download/upload required!).
  2. Alternatively, download Minecraft_Colab_Server.ipynb and upload it manually via File โž” Upload notebook in Colab.
  3. Run the cells in sequential order (Step 1 through Step 4).
  4. Click the Playit Claim Link to link your account, copy the provided IP address, and join the game!

๐Ÿ“– Step-by-Step Instructions

Step 1: Mount Google Drive & Select Server Source

  • SERVER_SOURCE:
    • Download New Server: Downloads a clean server into your Drive folder.
    • Use Existing Server from Drive: Loads an existing server folder already in your Drive (preserves all existing worlds and plugins).
  • DRIVE_FOLDER_NAME: The name of the folder in your MyDrive (Default: Minecraft_Server).
  • Click the Play (โ–ถ๏ธ) button and authorize Google Drive access when prompted.

Step 2: Install Java 25 & Playit.gg

  • Modern Minecraft releases (version 26.3+) require Java 25 (Class file 69.0).
  • This step installs system dependencies, downloads Oracle JDK 25, and prepares the Playit.gg standalone tunnel agent.
  • Takes approximately 10โ€“15 seconds.

Step 3: Server Download & Configuration

Customize your server preferences:

  • SERVER_TYPE: Choose between Vanilla, Paper (recommended for performance), Purpur, or Fabric.
  • VERSION: Keep latest to automatically fetch the latest release, or pick a specific version (e.g., 26.3, 1.21.4, etc.).
  • CRACKED_ACCOUNTS: Check this box if you or your friends use offline launchers (TLauncher, etc.).
  • FORCE_RE_DOWNLOAD: Check only if you wish to overwrite an existing server.jar.
  • Run the cell. EULA will be automatically accepted (eula=true) and server.properties will be configured.

Step 4: Launch Playit & Minecraft Server (All-in-One Start)

  • Set your allocated RAM (Colab gives ~12 GB of free RAM; 6G or 8G is recommended).
  • Run the cell. Both Playit and the Minecraft server will start in the background within ~5 seconds!
  • First-time setup: Look at the cell output. You will see a link like:
    ๐Ÿ‘‰ https://playit.gg/claim/xxxxxx
    Click this link, log in to your Playit.gg account, and click Continue / Add to Account.
  • In Playit, click Add Tunnel โž” select Minecraft Java (Port: 25565) โž” click Create Tunnel.
  • Copy the server address provided by Playit.

๐ŸŒ How to Connect to Your Server

[!IMPORTANT] Always check the Port number on Playit! Playit free tunnels typically format their connection address as something.tun.ply.gg:12345 or something.gl.joinmc.link. You must copy the complete address including the : and the 5-digit port number!

  1. Open your Minecraft Launcher and launch the version matching your server (e.g., 26.3).
  2. Click Multiplayer โž” Direct Connection (or Add Server).
  3. Paste your full Playit domain/IP (e.g., traded-ink.tun.ply.gg:28452 or my-server.gl.joinmc.link).
  4. Click Join Server!

๐Ÿ’ป In-Game Admin & Commands

Because the server runs in a detached background session, you can run commands anytime without freezing Colab:

1. Using Step 5 (Server Console in Colab):

Open Step 5: Server Console & Command Terminal:

  • Type your command into the COMMAND box:
    op YourMinecraftName
    or
    gamemode creative YourMinecraftName
    or
    help
  • Run the cell. The full, untruncated server response will appear in the output!

2. In-Game Chat Commands:

Once you have made yourself an operator via op YourMinecraftName, you can run any command directly inside the Minecraft chat window:

  • /gamemode creative
  • /weather clear
  • /time set day
  • /tp <player>

โน๏ธ Stopping & Restarting

How to Stop:

Run Step 7: Graceful Server Shutdown & Save. This automatically sends stop to the Minecraft server, safely saves chunks and player data to Google Drive, and halts the Playit process.

How to Restart Next Time:

  1. Open the notebook in Colab.
  2. In Step 1, select Use Existing Server from Drive (or keep Download New Server with the same folder name; it will automatically detect existing files).
  3. Run Step 1, Step 2, and Step 4.
  4. Because playit.toml was saved to your Google Drive, Playit will automatically reconnect to the exact same domain/IP without needing to re-claim!

๐Ÿ› ๏ธ Troubleshooting & Common Errors

โŒ Error: Connection reset by peer (-104)

This error happens for two common reasons:

  1. Missing Port Number: Look at your Playit dashboard (https://playit.gg/account/tunnels). If your tunnel is named xxx.tun.ply.gg, click on it to see the assigned port. You must enter xxx.tun.ply.gg:PORT into Minecraft.
  2. Server Still Loading: Minecraft takes 15โ€“25 seconds to generate spawn chunks. Run Step 6: View Live Server Logs to confirm the server has finished loading (Done (...)!).
  3. Wrong Agent: Ensure your active tunnel in Playit is assigned to your Colab Server agent (indicated by a green status dot).
โŒ Error: UnsupportedClassVersionError (class file version 69.0)

Minecraft 26.3+ requires Java 25.

  • Make sure you ran Step 2 of the notebook, which automatically downloads and installs JDK 25 into /opt/jdk-25.
  • Check the version in Step 2 output to ensure it says openjdk version "25.x".
โŒ Cell hangs on "Starting Playit.gg Tunnel..."

Older scripts used blocking readline pipes. The latest version of this notebook uses nohup non-blocking execution.

  • Ensure you are using the latest Minecraft_Colab_Server.ipynb from this repository.
  • Step 4 should complete in ~5โ€“7 seconds with a green checkmark.
โŒ Google Colab Session Disconnects

Google Colab free tier instances disconnect after periods of browser tab inactivity:

  • Keep the Colab browser tab open while playing.
  • Prevent your computer from going to sleep.
  • All world data is synced to Google Drive in real-time, so even if Colab disconnects, you can restart without losing your progress.

๐Ÿ’ก Advanced Tips

Sharing with Friends (Collaborative Servers)

If multiple friends want to run the server at different times:

  1. The world owner can share the Minecraft_Server Google Drive folder with friends with Editor permissions.
  2. Friends can open the link in Google Drive, right-click the folder, and choose Organize โž” Add shortcut.
  3. When they mount Google Drive in Colab, the shortcut acts like a native folderโ€”any changes made while they host will save directly to the original owner's Drive!

๐Ÿ“„ License

This project is licensed under the MIT License - feel free to modify, distribute, and build upon it!