A simple Minecraft bot that keeps your server active by maintaining a connection. Perfect for Aternos servers that shut down when empty!
- 🤖 Automatically connects to your Minecraft server
- ⏰ Keeps server online 24/7 (prevents auto-shutdown)
- 🔄 Auto-reconnects if disconnected
- 💚 Health monitoring endpoint for deployment platforms
- 📝 Detailed logging of all bot activities
- 🚀 Ready for Render deployment out-of-the-box
The fastest way to get your bot running:
- Fork/Clone this repository
- Push to your GitHub
- Deploy to Render - See DEPLOYMENT.md for detailed instructions
That's it! Your bot will keep your Minecraft server online 24/7.
- Node.js 22+ (for local development)
- GitHub account (for deployment)
- Render account (free tier works!)
- Minecraft server details
Want to test locally first?
-
Install dependencies
npm install
-
Create environment file
cp .env.example .env
-
Edit
.envwith your server detailsMINECRAFT_SERVER_HOST=your-server.aternos.me MINECRAFT_SERVER_PORT=12635 MINECRAFT_BOT_USERNAME=ServerKeeper MINECRAFT_VERSION=1.21.10
-
Run the bot
npm run dev
-
Test health check Open http://localhost:3000/health in your browser
All configuration is done via environment variables:
| Variable | Description | Example |
|---|---|---|
MINECRAFT_SERVER_HOST |
Your server address | myserver.aternos.me |
MINECRAFT_SERVER_PORT |
Server port | 12635 |
MINECRAFT_BOT_USERNAME |
Bot's in-game name | ServerKeeper |
MINECRAFT_VERSION |
Minecraft version | 1.21.10 |
- Deployment Guide - Complete GitHub + Render deployment walkthrough
- .env.example - Environment variable template
- Bot connects to your Minecraft server using Mineflayer
- Stays connected, preventing server auto-shutdown
- Automatically reconnects if connection is lost
- Provides health endpoint for monitoring
- Logs all activities for debugging
This bot is optimized for Render, but can be deployed to:
- ✅ Render (recommended - includes
render.yaml) - Railway
- Heroku
- Any Node.js hosting platform
- ✅ Make sure server is online
- ✅ Check server address and port are correct
- ✅ Verify Minecraft version matches your server
- ✅ Check
MINECRAFT_VERSIONmatches server version exactly - ✅ Some servers require whitelisting - add bot username
- ✅ Check server logs for kick/ban messages
- ✅ Make sure you're using Node.js 22+
- ✅ Verify
.envfile exists and has correct values - ✅ Run
npm installto ensure all dependencies are installed
Your bot exposes a health check endpoint at /health:
{
"status": "connected",
"bot": "ServerKeeper",
"uptime": 3600,
"timestamp": "2025-11-13T03:00:00.000Z"
}- Status 200: Bot is connected
- Status 503: Bot is disconnected/reconnecting
Contributions welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
ISC
- Free Hosting: Render's free tier includes 750 hours/month
- 24/7 Uptime: Upgrade to Render's paid plan ($7/month) for always-on service
- Multiple Bots: Deploy separate instances for different servers
- Monitoring: Use UptimeRobot to ping
/healthand get alerts if bot goes down