A web-based control panel for managing a Discord bot process via PM2. Monitor status, start/stop the bot, and view logs all from a browser dashboard.
- View bot status, uptime, memory, and CPU usage
- Start and stop the bot remotely
- View the last 50 lines of bot logs
- Simple web UI served with Express
- Runtime: Node.js
- Web framework: Express
- Process manager: PM2
- Bot library: discord.js v14
- Config: dotenv
BotPanel/
├── index.js # Express server + PM2 API routes
├── bot/
│ └── bot.js # Discord bot (managed by PM2 as "bot")
├── public/
│ ├── panel.html # Dashboard UI
│ └── style.css
└── .env # Environment variables (not committed)
- Node.js
- PM2 installed globally:
npm install -g pm2
npm installCreate a .env file in the root:
Bot_Token=your_discord_bot_token
Port=3000pm2 start bot/bot.js --name botnode index.jsThen open http://localhost:3000/panel in your browser.
| Method | Path | Description |
|---|---|---|
| GET | /api/status |
Get bot process status, uptime, memory, CPU |
| POST | /api/start |
Start the bot |
| POST | /api/stop |
Stop the bot |
| GET | /api/logs |
Get last 50 lines of bot logs |
ISC