Skip to content

RasmusLiltorp/MCRemoteControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCRemoteControl

MCRemoteControl lets you remotely start, stop, and manage your Minecraft server with a secure and easy-to-use interface. Generate your key pair, add the public key to your server, and take full control of your Minecraft world—right from your desktop! 🚀

MCRemoteControl is a tool split into two parts:

  • Client: An Electron (Vue 3/TypeScript/Vite) application that you can download from the Releases page.
  • Server: A FastAPI-based Python application for managing your Minecraft server, secured with RSA keys.

image


Client Setup

  1. Download the Client Installer:

    • Visit the Releases page.
    • Download the latest Windows installer (an .exe file).
  2. Install the Client:

    • Run the installer and follow the on-screen instructions.
    • Once installed, launch the application.
    • Use the settings menu to +generate a new RSA key pair.
    • Connect to your server after providing the host with your public key (copy it from the settings menu).

Server Setup

Prerequisites

  • Python 3.10 or later
  • pip

Step-by-Step Setup

  1. Clone the Repository and Navigate to the Server Directory:

    Open a terminal and run:

    git clone https://github.com/RasmusLiltorp/MCRemoteControl.git
    cd MCRemoteControl/MCRemoteControl-Server
  2. Set Up a Python Virtual Environment:

    Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install Dependencies:

    Install the required Python packages:

    pip install -r requirements.txt
  4. Configure Your Minecraft Server Folder Path:

    The server uses a configuration file (config.json). To set your Minecraft server root directory, run:

    python setup.py --mc-root "/path/to/your/minecraft/server/folder"

    Replace /path/to/your/minecraft/server/folder with the full path to your Minecraft server folder.

  5. Setting Up API Keys:

    If no authentication keys are found, the server will prompt you during startup.

    • Start the server with:
      python app.py
    • You will see a message like:
      No authentication keys found!
      To configure the server, run:
        python setup.py --add-key <path_to_public_key>
      Or use the interactive setup now:
      Would you like to run the setup now? (y/N):
      
    • To add a key, you can either:
      • Pass the entire public key as text on the command line, or
      • Use the interactive mode when prompted.
        Example interactive flow:
    • If prompted, type y and then you will see your public key printed.
    • Next, you will be asked:
      Enter a name for this public key:
      
      Provide a unique name without duplicates (if a key with that name already exists, the setup will warn you).
  6. Start the API Server:

    Once the above setup is complete, start the server again:

    python app.py

    The API will attempt to bind to host 0.0.0.0 on port 5000. Make sure this port is free.

  7. Verifying Server Operation:

    Use the client application to connect to your server. The client will use the RSA key pair for signing API requests.


Troubleshooting

  • Port 5000 Already in Use:
    Check which process is using port 5000:

    sudo lsof -i :5000

    Then kill the process using:

    sudo kill -9 <PID>

    Alternatively, you can force kill all processes with:

    sudo fuser -k 5000/tcp
  • Virtual Environment Issues:
    If you experience issues, make sure you have activated the correct Python virtual environment:

    source venv/bin/activate
  • API Key Setup:
    Ensure that when adding a key, you provide a unique name. The interactive setup will prompt you to enter a name if you did not supply one. Duplicate names are not allowed.

  • Server-side application stops when closing SSH session If you're experiencing issues with the server stopping after SSH sessions or system reboots, you need to set up the application as a system service. Follow these steps:

    • Create the service file Create a new service file with:

      sudo nano /etc/systemd/system/mcremotecontrol.service
    • Add the configuration below

      [Unit]
      Description=MCRemoteControl Server
      After=network.target
      
      [Service]
      User=YOURUSER
      Group=YOURUSER
      WorkingDirectory=/INSERTYOURPATH/MCRemoteControl/MCRemoteControl-Server
      ExecStart=/INSERTYOURPATH/MCRemoteControl/MCRemoteControl-Server/venv/bin/python app.py
      Restart=always
      RestartSec=5
      StandardOutput=journal
      StandardError=journal
      
      [Install]
      WantedBy=multi-user.target     
    • Save the file Press Ctrl+X, then Y, then Enter to save and exit.

    • Enable and start the service

       sudo systemctl daemon-reload
       sudo systemctl enable mcremotecontrol.service
       sudo systemctl start mcremotecontrol.service
    • Verify service status

      sudo systemctl status mcremotecontrol.service

Now you are ready to use MCRemoteControl to remotely manage your Minecraft server! Enjoy!

About

Give others control of starting and stopping your Minecraft server

Resources

License

Stars

Watchers

Forks

Packages

No packages published