An ultra-lightweight, headless Minecraft client manager built with Node.js (v22 LTS) & Mineflayer, specially optimized for Ubuntu Linux Servers (even with just 1 GB RAM).
Run multiple Minecraft accounts simultaneously across different servers with an isolated multi-bot engine, automatic re-join, anti-AFK arm swinging, in-game chat & commands, and a modern reactive web dashboard.
Running vanilla Minecraft Java with a graphical environment requires at least 2 GB of RAM and a full desktop stack (X11 / VNC), instantly triggering Out-Of-Memory (OOM) crashes on low-end servers.
This client uses the Mineflayer headless protocol engine:
- Ultra-low memory footprint: Uses only 60 MB to 90 MB RAM per active bot.
- Fully Headless: Runs cleanly in the background managed by PM2.
- Automated 2 GB Swapfile: The installation script automatically provisions a 2 GB swapfile so the server never crashes during memory spikes.
- Multi-Bot Engine: Multiple Minecraft accounts can be active on completely different servers simultaneously.
Open PowerShell or a terminal on your computer and connect via SSH:
ssh root@YOUR-SERVER-IPsudo mkdir -p /opt/minecraft-bot
sudo git clone https://github.com/ldrnico/minecraft-bot.git /opt/minecraft-bot
cd /opt/minecraft-bot- Connect via SFTP to your server.
- Create directory:
/opt/minecraft-bot. - Upload all files from this project into that directory.
Navigate to the directory and run the included installer:
cd /opt/minecraft-bot
chmod +x install.sh
sudo ./install.shWhat the installer does automatically:
- ✅ Sets up a 2 GB swapfile (prevents OOM crashes on 1 GB VPS).
- ✅ Installs Node.js 22 LTS and npm.
- ✅ Installs production dependencies (
mineflayer,express,ws, etc.). - ✅ Opens firewall port
3000/tcp(ufw). - ✅ Installs PM2 process manager and enables systemd reboot autostart.
- ✅ Generates a default
.envconfiguration file.
Edit the .env file:
nano .envEnter your desired credentials for the web dashboard:
WEB_PORT=3000
WEB_USER=admin
WEB_PASSWORD=YourSecurePasswordHere(In nano, save with Ctrl + O, press Enter. Exit with Ctrl + X)
Note
The password in .env is used for the initial setup. Once logged in, you can update your password anytime directly in the dashboard under "Change Password".
Start the service using PM2:
cd /opt/minecraft-bot
pm2 start ecosystem.config.js
pm2 saveYour bot manager now runs 24/7 and restarts automatically if the server reboots.
Open your web browser on your PC or smartphone:
http://YOUR-SERVER-IP:3000
- Log in with the credentials defined in
.env. - Click
+ Newin the header to create your first bot profile (enter server IP, port, and Minecraft player name).
The client uses official, secure Microsoft Device Code Authentication (you never have to type your Microsoft password onto the server):
- Click "Connect" (
▶) in the dashboard. - A yellow alert box appears displaying a login code (e.g.,
ABCD-EFGH) with a Copy Code button. - Click the link to open https://microsoft.com/devicelogin.
- Enter the code and authorize access with your Microsoft/Minecraft account.
- The bot connects automatically and stores the encrypted session token in
./auth-cache/<botId>/. - Done! Future re-joins and server restarts will connect automatically without prompting for a code.
- Multi-Bot Profiles: Manage multiple accounts and servers simultaneously. Switch bots with a single click in the header dropdown.
- Auto-Rejoin Toggle: Automatically reconnects after server kicks or restarts.
- Periodic Reconnect: Disconnects and reconnects on a customizable interval (e.g. every 30 minutes) with a live countdown display.
- Live Console & Chat: Watch server messages and chat logs in real-time.
- In-Game Command Bar: Send chat messages or slash commands (e.g.,
/server cb1) directly from the web interface. - PaperMC / Velocity Anti-Cheat Compatibility: Integrated
tick_endpackets, resource-pack auto-handshakes, and configuration-phase handling prevent timeouts on modern Minecraft networks. - Password Management: Change admin password anytime under the "Change Password" tab.
# View live terminal logs
pm2 logs mc-client-bot
# Restart the bot client
pm2 restart mc-client-bot
# Stop the bot client
pm2 stop mc-client-bot
# Check process status and memory usage
pm2 status
# View server memory consumption
free -hEnsure port 3000 is open in your cloud provider's firewall as well as UFW:
sudo ufw allow 3000/tcpIf a token has expired, open the "Bot Settings" tab and click "Clear Auth Cache". The next time you click Connect, a fresh device code will be requested.
Configured bot profiles are saved in bots.json. Microsoft login tokens are isolated per profile under ./auth-cache/<botId>/. Both are ignored by Git via .gitignore.
Made by melonengolemm · GitHub: ldrnico