Deploying on Baremetal
This guide will walk you through the process of installing and running BlueDragon software directly on the host machine.
Prerequisites
- This guide assumes you’re running on Linux. Other operating systems are not supported; though, you may be able to get it working on WSL.
- You must have Java 21 or later installed on your system and accessible in your
PATH.
Installation
First, clone the source repositories for the server, Puffin, and Komodo.
# You can choose any directory you want. `/work` is just an example.# Make sure you have write access to this directory!mkdir /work && cd /workgit clone https://github.com/BlueDragonMC/Servergit clone https://github.com/BlueDragonMC/Puffingit clone https://github.com/BlueDragonMC/KomodoNext, build each project:
# Servercd /work/Server && ./gradlew build
# Puffincd /work/Puffin && ./gradlew build
# Komodocd /work/Komodo && ./gradlew buildThen, copy the JARs into the appropriate directories:
mkdir -p /data/worldsmkdir -p /data/songsmkdir -p /run/proxy/pluginsmkdir /run/puffin
cp /work/Server/build/libs/Server-1.0-SNAPSHOT-all.jar /data/server.jarcp /work/Komodo/build/libs/Komodo-0.1.0-all.jar /run/proxy/plugins/komodo.jarcp /work/Puffin/build/libs/Puffin-1.0-SNAPSHOT-all.jar /run/puffin/puffin.jarDownload Velocity:
wget https://api.papermc.io/v2/projects/velocity/versions/3.4.0-SNAPSHOT/builds/483/downloads/velocity-3.3.0-SNAPSHOT-370.jar -O /run/proxy/velocity.jarThen, build your games as JAR files and place them in the /data/games directory. For more details on this, see Creating a Game or the Example Game.
Dependencies
The BlueDragon server, proxy, and Puffin require MongoDB and LuckPerms to be installed and running on your system. The easiest way to install these is to use Docker:
docker run -d -p 27017:27017 mongodocker run -d -p 8080:8080 -e LUCKPERMS_STORAGE_METHOD=mongodb -e LUCKPERMS_DATA_MONGODB_CONNECTION_URI="mongodb://localhost:27017/" -e LUCKPERMS_DATA_DATABASE=luckperms --net host ghcr.io/luckperms/rest-apiIf you prefer to run them without Docker, you can install them manually:
Configuration
Permissions
By default, LuckPerms does not give any permissions to anyone. To give yourself permissions, run the following command in a terminal:
docker run --rm -it -e LUCKPERMS_STORAGE_METHOD=mongodb -e LUCKPERMS_DATA_MONGODB_CONNECTION_URI="mongodb://localhost:27017/" -e LUCKPERMS_DATA_DATABASE=luckperms --net host ghcr.io/luckperms/rest-apiThen, when you see the prompt, type in lp user <your username> permission set * true. This will give you every permission. You may need to log in to the Minecraft server before running this command.
After you change permissions this way, you must restart your standalone LuckPerms instance for the change to take effect.
Puffin
Puffin reads the following configuration from environment variables:
PUFFIN_DEV_MODE=true # Disable Kubernetes service discovery for Minecraft servers and proxiesPUFFIN_WORLD_FOLDER=/data/worldsPUFFIN_MONGO_CONNECTION_STRING=mongodb://localhost:27017PUFFIN_LUCKPERMS_URL=http://localhost:8080PUFFIN_DEFAULT_GAMESERVER_IP=localhostPUFFIN_DEFAULT_PROXY_IP=localhostPUFFIN_GRPC_PORT=50051PUFFIN_GAMESERVER_GRPC_PORT=50052PUFFIN_PROXY_GRPC_PORT=50053
# The amount of milliseconds in between minimum instance checksPUFFIN_INSTANCE_START_PERIOD_MS=5000In addition, it reads configuration from the following files:
- Buffer config -
/service/config/buffer-config.properties - Worlds folder -
/data/worlds
These must be present for Puffin to work properly.
Proxy
First, configure environment variables:
KOMODO_PUFFIN_URI=localhost:50051 # Connect to Puffin on port 50051KOMODO_GRPC_PORT=50053 # Create a gRPC server on port 50053Komodo (the Velocity proxy plugin) reads the following configuration files:
-
/run/proxy/plugins/komodo/proxy-config.propertiesdefines the MOTD:motd.line_1.text=<rainbow>BlueDragon Test Instancemotd.line_1.center=truemotd.line_2.text=<blue>Version 1.20.1motd.line_2.center=trueUpdating this file while the proxy is running should change the MOTD without needing to restart the proxy.
-
/run/proxy/favicon_64.pngis the image shown in server list pings. This file is optional.
In addition, you must create a forwarding.secret file in the /run/proxy folder with your forwarding secret.
To play note block songs, add .nbs files created with Note Block Studio to the /data/songs directory.
You should be able to see the songs by typing /play in-game.
Finally, change the port that Velocity runs on since 25565 is taken by the Minecraft server. You can do this by starting up Velocity (cd /run/proxy && java -jar velocity.jar) and letting it create a velocity.toml file. Then, change the bind property. Players will connect to your server using this address.
Minecraft Server
BlueDragonMC/Server reads its configuration from environment variables. Follow this guide to set them up.
Here is an example:
BLUEDRAGON_QUEUE_TYPE=IPCBLUEDRAGON_MONGO_CONNECTION_STRING=mongodb://localhost:27017BLUEDRAGON_PUFFIN_HOSTNAME=localhostBLUEDRAGON_PUFFIN_PORT=50051 # The port that Puffin's gRPC server runs onBLUEDRAGON_LUCKPERMS_HOSTNAME=http://localhost:8080BLUEDRAGON_DEFAULT_GAME=lobby # This should correspond a game name found in the `game.properties` file in one of your games.BLUEDRAGON_AGONES_DISABLED=true # Agones is disabled without KubernetesHOSTNAME=server-1 # This is the internal name of the Minecraft server. It is used to identify the server to other services, like Velocity and Puffin.PUFFIN_VELOCITY_SECRET=<your velocity secret> # Add your Velocity forwarding secret hereBLUEDRAGON_GRPC_SERVER_PORT=50052 # The port used to create a gRPC serverLuckPerms
LuckPerms can be configured using environment variables:
LUCKPERMS_STORAGE_METHOD=mongodbLUCKPERMS_DATA_MONGODB_CONNECTION_URI=mongodb://localhost:27017LUCKPERMS_DATA_DATABASE=luckpermsLUCKPERMS_SYNC_MINUTES=5Common Configuration
Both Puffin and the Minecraft server need a /data directory.
mkdir -p /data/worldsThe /data/worlds directory should be configured as documented here.
Running
Before starting anything else, make sure LuckPerms and MongoDB are running!
Minecraft server:
# Before running, you must export the necessary environment variables from the Configuration section of this guide!cd /datajava -jar /data/server.jarVelocity proxy:
# Before running, you must export the necessary environment variables from the Configuration section of this guide!cd /run/velocity/java -jar /run/velocity/velocity.jarPuffin:
# Before running, you must export the necessary environment variables from the Configuration section of this guide!cd /run/puffin/java -jar /run/puffin/puffin.jar