This project is a web-based dashboard for remotely managing a local Minecraft server. It provides a user-friendly interface to start, stop, and interact with your server's console, as well as monitor its performance in real-time.
The application works by connecting a web-based frontend to a local API "bridge" that you will run on the same machine as your Minecraft server. This setup allows the web interface to securely control and monitor the server.
The system has three main components:
- Frontend (This Project): A Next.js application that provides the user interface in your browser. It communicates with the API Bridge.
- API Bridge: A simple local server (e.g., built with Node.js/Express) that you need to create. It receives commands from the frontend and executes them on your machine (like starting the Minecraft server process). It also reads server logs and performance data and sends them back to the frontend.
- Minecraft Server: Your standard Java Minecraft server (
server.jar).
[Web Browser] <--> [Frontend (Next.js)] <--> [API Bridge (Node.js)] <--> [Minecraft Server]
(UI) (This project) (Listens on localhost:3001) (Runs on your PC)
Follow these steps to get the full application running.
The frontend is already configured. To run it, open a terminal and execute the following commands:
# Install all the necessary packages
npm install
# Run the development server
npm run devThe application will be available at http://localhost:9002. You will see an error in the console (WebSocket error), which is expected until the API Bridge is running.
You need to create a simple API server to act as a bridge. This server will listen for requests from the frontend and interact with your Minecraft server.
The frontend expects the API Bridge to be running on http://localhost:3001 and to expose the following endpoints:
- Action: Starts the Minecraft server process.
- Details: Should execute the command to run your
server.jarfile (e.g.,java -Xmx2G -Xms2G -jar server.jar nogui).
- Action: Stops the Minecraft server.
- Details: Should send the
stopcommand to the running Minecraft server's standard input.
- Action: Sends a command to the Minecraft server.
- Request Body:
{ "command": "your-command-here" } - Details: Should write the received command to the Minecraft server's standard input.
- Action: The frontend will establish a WebSocket connection to this address to receive real-time updates.
- The bridge should send JSON messages with the following
type:'LOG': For new log lines from the server.- Payload:
string(the log message)
- Payload:
'STATUS_UPDATE': For real-time server metrics.- Payload:
{ serverState: 'online' | 'offline' | 'starting' | 'stopping', players: number, cpu: number, ram: number }
- Payload:
'ERROR': To report an error to the frontend.- Payload:
string(the error message)
- Payload:
'INITIAL_STATE': To send the current server status right after the WebSocket connects.- Payload:
{ serverState, players, cpu, ram, logs: string[] }
- Payload:
You can find example implementations for this bridge server in various languages (like Node.js, Python, etc.) online. Search for "Node.js child process management" and "WebSockets".
- Start the API Bridge: Run the local API server you created.
- Start the Frontend: Run
npm run devin this project's directory. - Open the App: Navigate to
http://localhost:9002in your web browser.
You can now use the web interface to start, stop, and manage your Minecraft server!