This guide covers deploying CraftCommand on Windows and Linux systems. For architecture details, see ARCHITECTURE.md.
- Node.js: 18.x or 20.x
- Java: JRE 17, 21, or 25
- OS: Windows 10/11 or Windows Server 2019+
- Install requirements.
- Clone repository and entry:
cd Craft-Commands. - Run
run_CraftCommand.batand select Option [1].
To keep CraftCommand running after reboot and auto-restart on crash:
-
Download NSSM and extract
nssm.exeto a folder in your PATH (e.g.,C:\Tools\) -
Build the backend:
cd backend npm run build -
Install the service:
nssm install CraftCommandPanel "C:\Program Files\nodejs\node.exe" "C:\path\to\Craft-Commands\backend\dist\server.js" nssm set CraftCommandPanel AppDirectory "C:\path\to\Craft-Commands" nssm set CraftCommandPanel AppEnvironmentExtra "NODE_ENV=production" nssm set CraftCommandPanel AppStdout "C:\path\to\Craft-Commands\logs\panel-stdout.log" nssm set CraftCommandPanel AppStderr "C:\path\to\Craft-Commands\logs\panel-stderr.log" nssm set CraftCommandPanel AppRotateFiles 1 nssm set CraftCommandPanel AppRotateBytes 10485760
-
Start the service:
nssm start CraftCommandPanel -
Verify:
nssm status CraftCommandPanel
To remove:
nssm stop CraftCommandPanel
nssm remove CraftCommandPanel confirm- OS: Ubuntu 22.04+, Debian 12+, Rocky Linux 9+
- Node.js: 18.x or 20.x
- Java: OpenJDK 17, 21, or 25 (headless is sufficient)
- Permissions: Sudo access for service installation
git clone https://github.com/Extroos/Craft-Commands.git
cd Craft-Commands
chmod +x run_CraftCommand.sh
./run_CraftCommand.shThis runs CraftCommand interactively. Close the terminal and it stops. For persistence, use systemd below.
sudo useradd -r -m -d /opt/craftcommand -s /bin/bash craftcommandsudo -u craftcommand git clone https://github.com/Extroos/Craft-Commands.git /opt/craftcommand
cd /opt/craftcommand
# Install dependencies
sudo -u craftcommand npm install
cd backend && sudo -u craftcommand npm install && sudo -u craftcommand npm run build && cd ..
cd frontend && sudo -u craftcommand npm install && sudo -u craftcommand npm run build && cd ..
cd agent && sudo -u craftcommand npm install && sudo -u craftcommand npm run build && cd ..sudo -u craftcommand cp .env.example .env
sudo -u craftcommand nano .envRequired changes in .env:
JWT_SECRET=<generate-a-random-64-char-string>
BACKEND_PORT=3001
NODE_ENV=productionGenerate a secure JWT secret:
openssl rand -base64 48sudo -u craftcommand mkdir -p /opt/craftcommand/{data,minecraft_servers,backups,logs,uploads}# Copy the service file
sudo cp /opt/craftcommand/scripts/systemd/craftcommand-panel.service /etc/systemd/system/
# Reload systemd
sudo systemctl daemon-reload
# Enable auto-start on boot
sudo systemctl enable craftcommand-panel
# Start the service
sudo systemctl start craftcommand-panel
# Check status
sudo systemctl status craftcommand-panelsudo journalctl -u craftcommand-panel -f# Ubuntu/Debian (ufw)
sudo ufw allow 3001/tcp comment "CraftCommand Panel"
sudo ufw allow 25565/tcp comment "Minecraft Default"
# RHEL/Rocky (firewalld)
sudo firewall-cmd --permanent --add-port=3001/tcp
sudo firewall-cmd --permanent --add-port=25565/tcp
sudo firewall-cmd --reloadIf you prefer PM2 over systemd:
sudo npm install -g pm2
cd /opt/craftcommand/backend
pm2 start dist/server.js --name craftcommand-backend
# Auto-start on reboot
pm2 startup
pm2 saveFor managing server instances on machines separate from the Primary Panel, use the technical enrollment protocol:
- Navigate to Node Registry -> Add Node.
- The system generates a join token (TTL: 15 minutes) and a bootstrap command.
Execute the bootstrap command on the target host.
Linux / macOS:
./run_CraftCommand.sh --join http://<panel-url>:3001 <token>Windows (PowerShell):
.\run_CraftCommand.bat --join http://<panel-url>:3001 <token>The agent uses the token to retrieve persistent Ed25519 identity strings from the panel via WebSocket. Upon successful handshake, the status transitions to ONLINE in the Node Registry.
The docker-compose.yml orchestrates the backend services and the local agent daemon.
cd Craft-Commands
docker-compose up -dIf you wish to spin up a remote agent strictly via Docker, you can use the standalone enrollment:
docker run -d \
--name craftcommand-agent \
-e PANEL_URL=http://<panel-url>:3001 \
-e JOIN_TOKEN=<token> \
-v /var/run/docker.sock:/var/run/docker.sock \
extroos/craftcommand-agent:latest| Path | Contents |
|---|---|
data/ |
Panel metadata (configs, users, sessions, audit logs) |
data/servers.json |
Server configurations |
data/users.json |
User accounts (bcrypt-hashed passwords) |
minecraft_servers/ |
Actual Minecraft server files (JARs, worlds, configs) |
backups/ |
Server backup ZIP archives |
logs/ |
Panel and health logs |
.env |
Environment config (JWT secret, ports) |
# Check logs
sudo journalctl -u craftcommand-panel -n 50
# Common issues:
# - "JWT_SECRET is not set" → Edit .env and add a proper secret
# - "EACCES permission denied" → Fix ownership: chown -R craftcommand:craftcommand /opt/craftcommand
# - "EADDRINUSE" → Port 3001 in use. Kill the other process or change BACKEND_PORT in .env# Check agent logs
sudo journalctl -u craftcommand-agent -n 50
# Common issues:
# - "Connection failed" → Verify PANEL_URL is reachable (curl http://panel:3001/api/system/status)
# - "Token Expired 401" → Join tokens expire after 15 minutes. Generate a new one in the UI.
# - Firewall blocking → Ensure port 3001 is open on the panel machine- Check the server's Diagnosis tab in the panel UI
- Common auto-fixed issues: EULA not accepted, port conflict, Java not found
- If server enters Safe Mode after 3 crashes: review logs, fix the root cause, then click "Reset Safe Mode"