A web-based administration panel for Minecraft servers. Its created to make server management easier and more accessible, providing real-time insights and control over server operations. Its designed to look like a native Minecraft interface, ensuring a familiar experience for server administrators.
- Real-time Player Monitoring: View currently online players with auto-refresh
- Whitelist Management: Add and remove players from the server whitelist with Mojang username validation
- Player Actions: Kick players directly from the web interface
- RCON Console: Execute raw RCON commands with syntax highlighting
- Discord OAuth Authentication: Secure access control via Discord login
- Server Information Display: Customizable server name, version, and description
- HTMX-Powered UI: Dynamic updates without page refreshes
- Graceful Shutdown: Proper cleanup of connections and resources
The application follows a clean three-layer architecture:
- Protocol Layer (
internal/rcon/): Low-level RCON protocol communication using thegithub.com/gorcon/rconlibrary - Service Layer (
internal/services/): Business logic and data transformation - API Layer (
internal/api/): HTTP handlers and routing using the Gin framework
All HTML is rendered server-side with templates located in templates/, and HTMX is used for dynamic content updates.
- Go 1.25.4 or later
- A Minecraft server with RCON enabled
- Discord application credentials (for authentication)
- Optional: Kubernetes cluster (for remote server access)
- Clone the repository:
git clone git@github.com:tekikaito/mc-admin.git
cd mc-admin- Create a
.envfile based on the provided.env.example:
cp .env.example .env- Fill in the required environment variables in
.env:
RCON_PASSWORD: Your Minecraft server's RCON passwordDISCORD_CLIENT_ID,DISCORD_CLIENT_SECRET,DISCORD_REDIRECT_URI: Your Discord OAuth credentials (if using Discord authentication)
- Run the application:
go run main.go- Open your browser and navigate to
http://localhost:8080
- Create an application in the Discord Developer Portal
- In OAuth2 settings, add a redirect URL:
- Local development:
http://localhost:8080/auth/discord/callback - Production:
https://your-domain/auth/discord/callback
- Local development:
- Copy the Client ID and Client Secret to your
.envfile - Optionally, restrict access by adding Discord user IDs to
DISCORD_ALLOWED_USER_IDS
All routes except /auth/* require a valid Discord session. If DISCORD_ALLOWED_USER_IDS is set, only those users can sign in.
| Variable | Description |
|---|---|
RCON_PASSWORD |
RCON password for your Minecraft server |
| Variable | Default | Description |
|---|---|---|
RCON_HOST |
localhost |
Minecraft server hostname or IP |
RCON_PORT |
25575 |
RCON port on the Minecraft server |
SERVER_NAME |
Minecraft Server |
Display name shown in the UI |
SERVER_HOST |
localhost |
Public server address displayed in the UI |
GAME_PORT |
25565 |
Minecraft game port displayed in the UI |
SERVER_VERSION |
Unknown Version |
Server version displayed in the UI |
SERVER_DESCRIPTION |
Live status for your community |
Server description text |
MINECRAFT_DATA_DIR |
/data |
Directory path for Minecraft server data |
MAX_FILE_DISPLAY_SIZE |
1048576 |
Max size (in bytes) for displaying files in the UI |
DISCORD_OAUTH_ENABLED |
false |
Enable Discord OAuth authentication |
ENABLE_MINECRAFT_USERNAME_CHECK |
false |
Enable Mojang username validation for whitelist management |
Those variablesa are required only if a feature flag is enabled (by setting its value to true).
Feature-Flag: DISCORD_OAUTH_ENABLED
| Variable | Default | Description |
|---|---|---|
SESSION_SECRET |
- | Secret key for session encryption (use a long random string) |
DISCORD_CLIENT_ID |
- | Discord OAuth application client ID |
DISCORD_CLIENT_SECRET |
- | Discord OAuth application client secret |
DISCORD_REDIRECT_URI |
- | OAuth callback URL |
DISCORD_ALLOWED_USER_IDS |
(nil = every discord user is allowed) |
Comma-separated list of Discord user IDs allowed to access the panel |
- Ensure you have Go installed (version 1.25.4 or later)
- Clone the repository and navigate to the project directory
- Create and configure a
.envfile as described in the Quick Start section - Run a local Minecraft server with RCON enabled for testing
docker compose -f minecraft.docker-compose.yml up -d- Start the application:
go run main.gogo test ./...