
82 ping on GitHub Codespaces Asia Region, playit.gg Anycast Global Region
This project lets you host a Minecraft Java Edition server inside a GitHub Codespace, with public access enabled through Playit.gg.
β οΈ Note: GitHub Codespaces aren't designed for long-term server hosting. You may only get up to ~30 hours/month on the highest-performance machines for free.
- π Launches a Minecraft server in a Codespace with 16 GB RAM (depending on region & machine type).
- π Easily share your server via Playit.gg tunneling (free and firewall-friendly).
- π Automatically fetches the latest release of Minecraft server.
- βοΈ Generates all required configs and startup scripts.
- π§ Built for Ubuntu-based Codespace environments.
- A GitHub account with Codespaces access.
- A Playit.gg account (for persistent tunnels and easier management).
- (Optional) A GitHub Pro or Teams plan for more Codespace hours.
Click the green "Code" button on this repo β "Create codespace on main"
π‘ You can select the region and machine type (e.g., 4 cores, 16GB RAM) when creating the codespace.
Once inside the Codespace terminal, run:
chmod +x setup.sh
./setup.shThis will:
- Install Java & dependencies
- Download the latest Minecraft server
- Set up the world and server config
- Install Playit.gg tunnel agent
- Create start scripts for server and tunnel
π§© Files Created
- ~/minecraft-server/server.jar: Latest Minecraft server.
- ~/minecraft-server/server.properties: Default config.
- ~/minecraft-server/start.sh: Starts Minecraft server (2G RAM by default).
- ~/minecraft-server/start_tunnel.sh: Starts Playit tunnel agent.
- ~/minecraft-server/eula.txt: EULA acceptance.
- Start Minecraft Server
cd ~/minecraft-server
./start.shcd ~/minecraft-server
./start_tunnel.shYou'll get a link like:
your-server.playit.gg:12345
Share this with your friends to connect!
βοΈ Customization
- Modify
start.shto change RAM usage (e.g.,-Xmx4G). - Edit
server.propertiesto configure gameplay settings. - Use
/op <username>in Minecraft console to grant yourself admin.
β³ Limits
GitHub Codespaces are not designed for 24/7 servers. Free-tier usage is limited:
| Machine Type | Monthly Hours | Notes |
|---|---|---|
| 2 cores, 8 GB RAM | 60 hrs | Standard performance |
| 4 cores, 16 GB RAM | 30 hrs | Higher Performance |
π¦ Future Improvements
- Auto-backup world saves to repo
- Add whitelist support
- Optional plugin/mod installation
- Auto-start on Codespace boot
π Acknowledgements
- Minecraft
- Playit.gg - Free tunnel service for games
- GitHub Codespaces - Dev environments in the cloud
π License
This project is released under the MIT License.