Discord bot for managing Proxmox Virtual Machines via slash commands.
- ✅ Start/Stop Proxmox VMs from Discord
- 📊 Display VM status (CPU, RAM, uptime)
- 🔍 VM name autocomplete
- 🔒 VM whitelist for security
- 🐳 Docker containerized
- 🚀 CI/CD with GitHub Actions
- Proxmox VE 7.0+
- Proxmox API Token
- Discord Bot Token
- Docker & Docker Compose (for deployment)
Create an API Token in Proxmox:
- Navigate to Datacenter > Permissions > API Tokens
- Create a token with
VM.PowerMgmtpermissions - Copy the Token ID and Secret
- Create an application at https://discord.com/developers/applications
- Create a bot and copy the token
- Enable required intents (Message Content, Server Members)
- Invite the bot with
botandapplications.commandsscopes
# Clone the repository
git clone https://github.com/cleeryy/proxcontrol.git
cd proxcontrol
# Configure environment variables
cp .env.example .env
vim .env
# Start with Docker Compose
docker-compose up -d
# View logs
docker-compose logs -f
DISCORD_TOKEN=your_discord_token
DISCORD_GUILD_ID=your_server_id
PROXMOX_URL=https://proxmox.local:8006/api2/json
PROXMOX_TOKEN_ID=root@pam!discord-bot
PROXMOX_SECRET=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
PROXMOX_NODE=pve
ALLOWED_VMS=100,101,102
Available commands:
/vm start <vm>- Start a virtual machine/vm stop <vm>- Stop a virtual machine (graceful shutdown)/vm status <vm>- Display VM status and metrics/vm list- List all authorized VMs
The <vm> parameter supports both VM names and IDs with autocomplete suggestions.
# Install dependencies
go mod download
# Run in development mode
go run cmd/bot/main.go
# Build binary
go build -o proxcontrol ./cmd/bot
# Run tests
go test ./...
# Run linter
go vet ./...
proxcontrol/
├── cmd/
│ └── bot/ # Application entry point
├── internal/
│ ├── proxmox/ # Proxmox API client
│ └── config/ # Configuration management
├── Dockerfile # Multi-stage Docker build
├── docker-compose.yml # Docker Compose configuration
└── .github/
└── workflows/ # CI/CD pipelines
# Build image
docker build -t proxcontrol:latest .
# Run container
docker run -d --name proxcontrol --env-file .env proxcontrol:latest
# Stop container
docker stop proxcontrol
- API tokens should never be committed to version control
- Use environment variables or secrets management
- Restrict VM whitelist to only necessary VMs
- Consider implementing role-based access control via Discord roles
- Verify the bot has
applications.commandsscope - Check if the bot has proper permissions in the Discord server
- Review bot logs:
docker-compose logs -f
- Ensure the Proxmox API is accessible from the bot's network
- Verify API token has correct permissions
- Check if VM IDs in
ALLOWED_VMSexist
- Restart the bot after updating
ALLOWED_VMS - Verify the bot can connect to Proxmox API
- Check that VMs are in a valid state
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with DiscordGo
- Proxmox VE API documentation
- Docker multi-stage builds for optimized images
- Role-based permissions
- Activity logging and audit trail
- VM reboot command
- Multi-node Proxmox support
- Scheduled VM operations
- Resource usage alerts
For issues, questions, or suggestions, please open an issue on GitHub.