FiveM artifacts are pre-built server binaries distributed by cfx.re. Understanding build types and update procedures is crucial for maintaining a stable server.
FiveM artifacts are categorized into three types based on stability and testing:
Purpose: Production-ready, stable builds for live servers.
Characteristics:
When to use:
How to identify:
recommended in the artifacts listPurpose: Newer builds with additional features, but may have minor issues.
Characteristics:
When to use:
Purpose: Bleeding-edge builds from the latest commits.
Characteristics:
When to use:
Warning: Latest builds can break your server or cause data corruption. Always test thoroughly before using in production.
The FiveM artifacts API provides programmatic access to available builds:
# Get recommended build for Linux
curl -s https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/recommended.json | jq -r '.version'
# Get optional build for Linux
curl -s https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/optional.json | jq -r '.version'
# Get latest build for Linux
curl -s https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/latest.json | jq -r '.version'Expected Output:
12345-abc123def456Visit the artifacts page:
Look for files marked as “recommended”, “optional”, or check the latest timestamp.
Create a script to automatically fetch the recommended build:
#!/bin/bash
# save as: /opt/fivem/update-artifacts.sh
set -e # Exit on error
ARTIFACTS_DIR="/opt/fivem/artifacts"
BACKUP_DIR="/opt/fivem/backups/artifacts"
BUILD_TYPE="${1:-recommended}" # Default to recommended
# Create directories
mkdir -p "$ARTIFACTS_DIR" "$BACKUP_DIR"
# Get version from API
echo "Fetching $BUILD_TYPE build version..."
VERSION=$(curl -s "https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/${BUILD_TYPE}.json" | jq -r '.version')
if [ -z "$VERSION" ] || [ "$VERSION" == "null" ]; then
echo "Error: Failed to fetch version"
exit 1
fi
echo "Found version: $VERSION"
# Check if already installed
if [ -f "$ARTIFACTS_DIR/$VERSION/version" ]; then
echo "Version $VERSION already installed"
exit 0
fi
# Backup current artifacts if they exist
if [ -d "$ARTIFACTS_DIR/current" ]; then
CURRENT_VERSION=$(cat "$ARTIFACTS_DIR/current/version" 2>/dev/null || echo "unknown")
BACKUP_PATH="$BACKUP_DIR/$(date +%Y%m%d-%H%M%S)-$CURRENT_VERSION"
echo "Backing up current version $CURRENT_VERSION to $BACKUP_PATH"
mkdir -p "$BACKUP_PATH"
cp -r "$ARTIFACTS_DIR/current"/* "$BACKUP_PATH/" 2>/dev/null || true
fi
# Download new artifacts
DOWNLOAD_URL="https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/$VERSION/fx.tar.xz"
DOWNLOAD_PATH="$ARTIFACTS_DIR/fx-$VERSION.tar.xz"
EXTRACT_PATH="$ARTIFACTS_DIR/$VERSION"
echo "Downloading from $DOWNLOAD_URL..."
wget -q --show-progress -O "$DOWNLOAD_PATH" "$DOWNLOAD_URL"
# Extract
echo "Extracting artifacts..."
mkdir -p "$EXTRACT_PATH"
tar -xf "$DOWNLOAD_PATH" -C "$EXTRACT_PATH" --strip-components=1
# Save version
echo "$VERSION" > "$EXTRACT_PATH/version"
# Update symlink
echo "Updating current symlink..."
ln -sfn "$EXTRACT_PATH" "$ARTIFACTS_DIR/current"
# Cleanup
rm -f "$DOWNLOAD_PATH"
echo "Successfully installed version $VERSION"
echo "Artifacts location: $ARTIFACTS_DIR/current"Usage:
# Make executable
chmod +x /opt/fivem/update-artifacts.sh
# Update to recommended (default)
sudo /opt/fivem/update-artifacts.sh
# Update to optional
sudo /opt/fivem/update-artifacts.sh optional
# Update to latest (not recommended)
sudo /opt/fivem/update-artifacts.sh latest# Set your desired version
VERSION="12345-abc123def456" # Replace with actual version
# Create directory
mkdir -p /opt/fivem/artifacts/$VERSION
cd /opt/fivem/artifacts/$VERSION
# Download
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/$VERSION/fx.tar.xz
# Extract
tar -xf fx.tar.xz
# Cleanup
rm fx.tar.xz
# Update symlink (if using)
ln -sfn /opt/fivem/artifacts/$VERSION /opt/fivem/artifacts/currentFollow this step-by-step process to update artifacts without downtime or data loss:
Check current version:
# If using the script above
cat /opt/fivem/artifacts/current/version
# Or check server startup logs
grep "version" /opt/fivem/logs/server.log | tail -1Verify backups are working:
# Check backup script/directory exists
ls -la /opt/fivem/backups/Check disk space:
df -h /opt/fivem
# Ensure at least 2GB free for artifacts downloadBackup artifacts:
BACKUP_DIR="/opt/fivem/backups/artifacts/$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BACKUP_DIR"
cp -r /opt/fivem/artifacts/current/* "$BACKUP_DIR/"
echo "Backed up to: $BACKUP_DIR"Backup server configuration:
# Backup server.cfg and important configs
tar -czf /opt/fivem/backups/config-$(date +%Y%m%d).tar.gz \
/opt/fivem/server.cfg \
/opt/fivem/resources/Database backup (if applicable):
# MariaDB/MySQL
mysqldump -u root -p fivem > /opt/fivem/backups/db-$(date +%Y%m%d).sqlStop FiveM server:
# If using systemd
sudo systemctl stop fivem
# Or if using txAdmin
# Stop via txAdmin interface or:
sudo systemctl stop txadminVerify services are stopped:
# Check no FXServer process is running
ps aux | grep fxserver
# Check ports are free
sudo netstat -tulpn | grep 30120
# Should return nothingUsing automated script:
sudo /opt/fivem/update-artifacts.sh recommendedOr manually:
# Follow manual download steps aboveVerify installation:
# Check version file exists
cat /opt/fivem/artifacts/current/version
# Check executable exists
ls -la /opt/fivem/artifacts/current/FXServer
# Should show executable permissionsIf you have a staging environment:
Start services:
# Start FiveM server
sudo systemctl start fivem
# Or start txAdmin
sudo systemctl start txadminMonitor startup:
# Watch logs
sudo journalctl -u fivem -f
# or
tail -f /opt/fivem/logs/server.logCheck for errors:
Verify server is running:
# Check process
ps aux | grep FXServer
# Check port
sudo netstat -tulpn | grep 30120
# Should show FXServer listening
# Test connection
nc -zv localhost 30120Check resource status:
Monitor for issues:
If the update causes issues, follow these steps to rollback:
sudo systemctl stop fivem
# or
sudo systemctl stop txadminIf using automated script backups:
# List available backups
ls -la /opt/fivem/backups/artifacts/
# Restore specific backup
BACKUP_VERSION="20241201-120000-12345-abc123"
cp -r /opt/fivem/backups/artifacts/$BACKUP_VERSION/* /opt/fivem/artifacts/current/Or manually restore:
# If you backed up to a specific location
cp -r /opt/fivem/backups/artifacts/YYYYMMDD-HHMMSS-version/* /opt/fivem/artifacts/current/# Restore server.cfg if you changed it
tar -xzf /opt/fivem/backups/config-YYYYMMDD.tar.gz -C /sudo systemctl start fivemKeep a log of artifact versions:
# Create version log
echo "$(date): Updated to $(cat /opt/fivem/artifacts/current/version)" >> /opt/fivem/version-history.logSolution:
# Verify symlink is correct
ls -la /opt/fivem/artifacts/current
# Check executable permissions
chmod +x /opt/fivem/artifacts/current/FXServer
# Verify version file
cat /opt/fivem/artifacts/current/versionSolution:
# Retry download
rm -f /opt/fivem/artifacts/fx-*.tar.xz
# Re-run update script or manual download
# Verify checksum (if available)
# Some builds provide MD5/SHA256 checksumsSolution:
After updating artifacts:
Check version:
cat /opt/fivem/artifacts/current/version
# Should match downloaded versionVerify server starts:
sudo systemctl status fivem
# Should show "active (running)"Test connection:
Check logs:
tail -n 50 /opt/fivem/logs/server.log
# Should show successful startup, no critical errors