And yes, the Lava Chicken makes an appearance at the end.
Keeping your Minecraft Bedrock server up to date is important, unless you enjoy surprise crashes, player complaints, and corrupt worlds. Updating it manually? That’s a whole saga: stop the server, back everything up, grab the latest release, restore configs, restart it all. Miss a step? Say goodbye to your Nether castle.
Naturally, I decided to automate the whole thing with a Bash script and Jenkins, so now my server updates itself while I’m off building pixel art and eating a pickle pizza.
🛠️ Why Jenkins?
Jenkins is like that overachieving robot butler you wish you had in real life. It’s open-source, endlessly configurable, and perfect for automating server-side rituals like this one.
With Jenkins, I get:
- Automatic updates on a schedule (e.g., 3 AM, when no one's online except Endermen).
- Logs and job status in a web UI (goodbye, mystery bugs)
- Failure notifications if something breaks
- One-click manual runs, for when I’m feeling fancy
🔄 How Jenkins Runs the Update Script
I set up my Bash script as a Jenkins freestyle job (pipeline works too):
- Stops the server (gently)
- Backs up all important files (just in case Creepers learn how to hack)
- Downloads the latest Bedrock release
- Restores worlds and configs
- Restarts the server
- Logs everything like it’s testifying before a redstone tribunal
If something fails? Jenkins sends me a passive-aggressive email like, “Hey, your server faceplanted, bozo!”
🧰 Jenkins Setup TL;DR
- Install Jenkins somewhere with access to your server files. I have it on my VPS which is connected to my home server.
- Make sure the Jenkins user can stop/start the Bedrock server and write to the backup directory
- Create a Jenkins job with a build step that runs the Bash script
- Use cron syntax in Build Triggers to schedule it or trigger it manually.
- Peek at “Console Output” in Jenkins if things get weird
📜 The Bash Script That Runs the Show
Pro tip: Put on headphones before running it. There’s a 1% chance the Lava Chicken song plays.
#!/bin/bash
# Variables
BEDROCK_DIR=<BEDROCK_DIR>
BEDROCK_LOG_FILE="$BEDROCK_DIR/bedrock_server.log"
BACKUP_DIR=<BACKUP_DIR>
TEMP_DIR=<TEMP_DIR>
WORLD_DIR="$BEDROCK_DIR/worlds"
CONFIG_FILES=("$BEDROCK_DIR/server.properties" "$BEDROCK_DIR/permissions.json" "$BEDROCK_DIR/whitelist.json")
LOG_FILE=<LOG_FILE>
BACKUP_FILE="$BACKUP_DIR/bedrock_backup_latest.tar.gz"
# Logging
exec > >(tee -i $LOG_FILE)
exec 2>&1
echo "Starting Bedrock Server update process..."
# Stop the server
echo "Stopping Bedrock server..."
pkill -f "bedrock_server" || echo "Bedrock server not running."
# Backup files
echo "Backing up world and configuration files..."
mkdir -p "$BACKUP_DIR"
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
tar -czf "$BACKUP_FILE" -C "$BEDROCK_DIR" .
# Save world/configs
echo "Saving world and configuration files..."
mkdir -p "$TEMP_DIR/config_backup"
cp -r "$WORLD_DIR" "$TEMP_DIR/config_backup"
for CONFIG_FILE in "${CONFIG_FILES[@]}"; do
[ -f "$CONFIG_FILE" ] && cp "$CONFIG_FILE" "$TEMP_DIR/config_backup/"
done
# Download latest version
echo "Downloading the latest Bedrock server version..."
mkdir -p "$TEMP_DIR"
LATEST_URL=$(curl -Ls -A "Mozilla/5.0" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://www.minecraft.net/bedrockdedicatedserver/bin-linux/[^"]*')
[ -z "$LATEST_URL" ] && echo "Error: Could not find latest Bedrock URL." && exit 1
wget --user-agent="Mozilla/5.0" "$LATEST_URL" -O "$TEMP_DIR/bedrock-server.zip" || { echo "Error: Download failed."; exit 1; }
# Update files
echo "Updating server files..."
unzip -o "$TEMP_DIR/bedrock-server.zip" -d "$BEDROCK_DIR"
# Restore world/configs
echo "Restoring world and configuration files..."
cp -r "$TEMP_DIR/config_backup/worlds" "$BEDROCK_DIR"
for CONFIG_FILE in "${CONFIG_FILES[@]}"; do
RESTORED="$TEMP_DIR/config_backup/$(basename "$CONFIG_FILE")"
[ -f "$RESTORED" ] && cp "$RESTORED" "$BEDROCK_DIR"
done
# Cleanup
rm -rf "$TEMP_DIR"
echo "Update complete. Cleaning up temporary files."
# Restart server
echo "Starting the Bedrock server..."
export BUILD_ID=dontKillMe
cd "$BEDROCK_DIR"
nohup bash -c "LD_LIBRARY_PATH=. ./bedrock_server" > "$BEDROCK_LOG_FILE" 2>&1 &
echo "Server restarted successfully. Log: $BEDROCK_LOG_FILE"
echo "https://youtu.be/41O_MydqxTU"
exit 0
🧠 Final Thoughts
Thanks to this setup, my Minecraft Bedrock server updates itself while I’m AFK. Safely, reliably, and without any “oops I overwrote my Nether base” moments.
If you're running a personal or community server, automating your updates with Jenkins + Bash is a power move. Add backups, clean logging, and a sprinkle of Lava Chicken magic, and you're golden.
Bonus: Yes, I actually listen to the Lava Chicken song every time this script runs. It’s tradition now.
La-la-la-Lava! Ch-ch-ch-chicken! 🐔🔥
Top comments (0)