Based on: How to make Minecraft Server Using Github [Java Edition] by BlueOnTheSky
Server Type: PaperMC (Java Edition)
Hosting: GitHub Codespaces (60 hrs/month free) + GitHub Actions (2000 min/month free) + playit.gg tunnel
- Fork this repo → Click "Fork" button above
- Open in Codespaces →
Code→Codespaces→Create codespace on main - Wait for setup (auto-runs
scripts/setup-server.sh) - Claim your tunnel: In terminal, run:
./playit claim
- Copy the claim code shown
- Go to https://playit.gg/claim and paste it
- Set claim code as Codespace secret:
- Codespace → Settings (gear) → Codespace secrets → New secret
- Name:
PLAYIT_CLAIM_CODE| Value: your claim code
- Start server:
./start-server.sh
- Connect using the address from playit.gg (e.g.,
cool-name.region.ply.gg:12345)
- Add
PLAYIT_CLAIM_CODEas Repository Secret (Settings → Secrets → Actions) - Enable Actions on fork
- Run workflow manually or wait for scheduled runs (every 6 hours)
minecraft-github-server/
├── .devcontainer/
│ └── devcontainer.json # Codespaces config (Java 21, ports, post-create)
├── .github/
│ └── workflows/
│ └── minecraft-server.yml # GitHub Actions workflow
├── scripts/
│ ├── download-paper.sh # Downloads latest PaperMC
│ ├── setup-server.sh # Sets up server.properties, playit, EULA
│ ├── start-tunnel.sh # Starts playit.gg tunnel
│ └── start-server.sh # Main entry point
├── server.properties # Generated on first run
├── eula.txt # Generated on first run (eula=true)
├── paper.jar # Downloaded on first run
├── playit # playit.gg tunnel binary
├── start-server.sh # Run this to start
└── README.md # This file
Key settings for Codespaces + playit.gg:
server-port=25565
server-ip=0.0.0.0
max-players=20
view-distance=10
simulation-distance=6
gamemode=survival
difficulty=easy
enable-command-block=false
white-list=false
enforce-secure-profile=true-Xms1G -Xmx2G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 ...Located in .devcontainer/devcontainer.json and start-server.sh
Drop .jar files into plugins/ folder (created on first run):
mkdir -p plugins
# Download plugins from https://hangar.papermc.io/ or https://modrinth.com/plugins
# Example: ViaVersion, ViaBackwards, LuckPerms, EssentialsX, WorldEdit- Free TCP/UDP tunneling (no port forwarding needed)
- Works from Codespaces, GitHub Actions, any cloud
- Custom subdomain (e.g.,
myserver.na.ply.gg:12345) - Supports Bedrock cross-play with GeyserMC plugin
# In Codespace terminal or locally:
./playit claim
# Follow the link, authorize, copy claim code| Platform | Location |
|---|---|
| Codespaces | Codespace Settings → Secrets → PLAYIT_CLAIM_CODE |
| GitHub Actions | Repo Settings → Secrets → Actions → PLAYIT_CLAIM_CODE |
| Platform | Free Limit | Strategy |
|---|---|---|
| GitHub Codespaces | 60 hours/month (personal) | Primary 24/7; keep tab open |
| GitHub Actions | 2000 minutes/month | Backup: scheduled runs every 6h |
| playit.gg | Unlimited tunnels | Always free |
- Primary: Codespaces (keep browser tab open, auto-stops after 30 min inactivity)
- Backup: GitHub Actions scheduled workflow (runs 6h every 6h = 24h coverage)
- World persistence: Commit
world/folder to repo periodically (see workflow)
Add to plugins/:
- GeyserMC + Floodgate (from https://download.geysermc.org/)
- Bedrock players connect via same playit.gg address (port 19132 UDP)
| Command | Description |
|---|---|
./start-server.sh |
Start server + tunnel |
./playit claim |
Get new tunnel claim code |
./playit --secret <code> |
Run tunnel manually |
stop |
In server console: graceful shutdown |
save-all |
Force world save |
save-off / save-on |
Disable/enable auto-save |
Add to workflow or run manually:
# Commit world folder to repo (keeps history)
git config user.name "github-actions"
git config user.email "actions@github.com"
git add world/
git commit -m "World backup $(date)"
git pushNote: GitHub has 100MB file limit, 1GB repo limit. For large worlds, use Git LFS or external storage.
- PaperMC Downloads: https://papermc.io/downloads
- playit.gg: https://playit.gg/
- Aikar's Java Flags: https://mcflags.emc.gs/
- GeyserMC (Bedrock): https://geysermc.org/
- Plugin Sources: https://hangar.papermc.io/ | https://modrinth.com/plugins
MIT License - Feel free to fork and customize!
Based on: BlueOnTheSky's YouTube Tutorial
Enhanced for: GitHub Codespaces + Actions 24/7 free hosting