Minecraft Server on DigitalOcean¶
Self-hosted Minecraft on a DigitalOcean droplet. Automated world backups to Google Drive, idle detection, Discord notifications, and a hibernate/revive system that destroys the droplet when nobody's playing — dropping the monthly cost from $24 to under $1.
How it's built¶
Your machine
┌────────────────────────────────────┐
│ hibernate.py / revive.py │
│ (Python 3, runs locally) │
└──────────┬──────────────┬──────────┘
│ DO API │ Cloudflare API
▼ ▼
┌──────────────────────────────────────────────────────┐
│ DigitalOcean Droplet (Ubuntu 22.04, 4 GB / 2 vCPU) │
│ │
│ nginx │
│ └── Pterodactyl Panel (Laravel / PHP-FPM) │
│ └── Pterodactyl Wings │
│ └── Docker container │
│ └── PaperMC │
│ │
│ idle-monitor.py ──► backup.sh ──► restic │
│ log-tailer.py ──► webhook.sh ──► Discord │
└───────────────────────────────┬──────────────────────┘
│ rclone (OAuth)
▼
Google Drive
(minecraft-backups/)
Panel and Wings run on the same droplet. No separate database host, no load balancer — the complexity budget for a personal server is low.
What it actually costs¶
The recommended droplet (s-2vcpu-4gb) is $0.036/hour — you only pay for hours the droplet exists. Snapshots (while hibernated) cost $0.06/GB/month, typically $0.30–$0.60/month total.
| How you play | Monthly cost |
|---|---|
| Running 24/7 | $24.00 |
| 2 weeks on, 2 weeks off | ~$12.50 |
| 1 week on, 3 weeks off | ~$6.50 |
| Fully hibernated | ~$0.50 |
The 5-minute revive time is the only cost of hibernating.
Are you a student?¶
GitHub Education gives you $200 in free DigitalOcean credit
If you have a .edu email or a school-verified GitHub account, you qualify for the GitHub Student Developer Pack. It includes $200 in DigitalOcean credit — enough to run the recommended 4 GB droplet for over 8 months, or play freely without worrying about the bill.
- Apply at education.github.com/pack (takes 1–3 days to approve)
- Redeem the DigitalOcean offer from your pack dashboard
- Come back here and follow the setup guide
The 4 GB droplet is the right choice for a student server — comfortable headroom for 1–10 players without needing to think about memory pressure.
What's in this repo¶
| File | Purpose |
|---|---|
hibernate.py |
Snapshot and destroy the droplet |
revive.py |
Recreate from snapshot, update DNS, fix post-revive state |
_common.py |
Shared helpers: env loading, HTTP, SSH |
.env |
All secrets and runtime config (gitignored) |
.env.example |
Template for .env |
droplet/scripts/ |
Scripts deployed to /opt/mc-tools/ on the droplet |
droplet/services/ |
Systemd units for idle monitor and log tailer |
droplet/config/ |
Reference config files for nginx, Wings, backup env |
Where to start¶
Easiest path: Clone this repo, open it in Claude Code, Cursor, Codex, or any AI coding assistant, and say "help me set up my server". The agent will figure out the rest.
Manual path: Follow Setting it up step by step.
Already running and just need something specific? Use the nav on the left.