SimpleAFK is a lightweight AFK bot for Minecraft servers, built on mineflayer.
It connects to your server and keeps you logged in – perfect for AFK farms, chunk loading, or similar use cases.
- 🚀 Easy setup with Docker
- 🔄 Automatic reconnect on disconnect
- 🔑 Microsoft Account login (OAuth2)
- 📜 Simple configuration via environment variables
- 🖥️ Cross-platform (runs anywhere with Docker)
- Installed Docker
- Access to a Minecraft server with a valid Microsoft account
-
Clone the repository
git clone https://github.com/Lxca128/SimpleAFK.git cd SimpleAFK
-
Build the Docker image
docker build -t simple-afk .
-
Run the container
Example with all required environment variables:docker run --name=SimpleAFK -d -e MC_SERVER="127.0.0.1" -e MC_PORT=25565 -e MC_EMAIL="[email protected]" -e RECONNECT_INTERVAL=10000 simple-afk
-
Check logs
docker logs -f SimpleAFK
-
Authenticate
- Open the link from the logs in your browser
- Enter the displayed code
- Sign in with your Microsoft account
-
✅ Done! The bot is now connected to your server.
-
Stop the bot:
docker stop SimpleAFK
-
Restart the bot:
docker start SimpleAFK
Main environment variables:
Variable | Description | Default |
---|---|---|
MC_SERVER |
IP or hostname of the Minecraft server | none |
MC_PORT |
Port of the server (e.g. 25565 ) |
none |
MC_EMAIL |
Microsoft account email address | none |
RECONNECT_INTERVAL |
Time between reconnect attempts (milliseconds) | 10000 |
This project is powered by:
- mineflayer – a powerful Node.js library for Minecraft bots
- Docker – for simple and portable deployment