FiveM
A new FiveM /RedM egg for the latest builds due to recent changes in FiveM
Ports
Add an allocation on the node for each port.
- Game 30110
- Game+1 30120
- txAdmin 40120
Install
- Installer image
- ghcr.io/ptero-eggs/installers:debian
- Install script
- 98 lines
Image
- Debian ghcr.io/ptero-eggs/yolks:debian
Startup
The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.
11 variables
Startup command
$(pwd)/alpine/opt/cfx-server/ld-musl-x86_64.so.1 --library-path "$(pwd)/alpine/usr/lib/v8/:$(pwd)/alpine/lib/:$(pwd)/alpine/usr/lib/" -- $(pwd)/alpine/opt/cfx-server/FXServer +set citizen_dir $(pwd)/alpine/opt/cfx-server/citizen/ +set sv_licenseKey {{FIVEM_LICENSE}} +set steam_webApiKey none +set sv_maxplayers 48 $( [ "0" == "1" ] || printf %s '+exec server.cfg' )Required to start the service. Get your keys at https://portal.cfx.re/
FIVEM_LICENSEUsers can edit
required|string|max:33A value is required.
Set the fivem max play count
MAX_PLAYERSUsers can edit
required|integer|between:1,48
The name that shows up in the server browser
SERVER_HOSTNAMEUsers can edit
required|string
The fivem version that is to be installed. Invalid versions will default to recommended. An example is `6013-d8ae399d15680da569022f57ab7f2474d307c821` You can get the latest version from here - https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/
FIVEM_VERSIONUsers can edit
required|string|max:50
This is the link to download fivem from. This is only used in the install script. The file you link to needs to be an fx.tar.zx file. Example: https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/6013-d8ae399d15680da569022f57ab7f2474d307c821/fx.tar.xz
DOWNLOAD_URLUsers cannot see
string|nullable
Use your Steam WebApiKey or set to 'none'. Get your key at https://steamcommunity.com/dev/apikey/
STEAM_WEBAPIKEYUsers can edit
required|string
The port for the txAdmin panel
TXHOST_TXA_PORTUsers can see
required|string|max:20
Enables txadmin. set to 1 to enable. (default is 0 for false)
TXADMIN_ENABLEUsers can edit
required|boolean
Restricts to only running either FiveM or RedM servers. The setup page will only show recipes for the game specified below ! Options are : fivem or redm
TXHOST_GAME_NAMEUsers can edit
required|in:fivem,redm
Value to be used : gta5 for FiveM and rdr3 for RedM ! Dont fill in any value it reads the game name variable and set the correct value for it !
GAME_TYPEUsers cannot see
string|nullable
Location for TX Admin
TXHOST_DATA_PATHUsers cannot see
required|string
Wings
- Stop command
- quit
- Running when the console shows
- succeeded. Welcome!
Files Wings edits
Wings sets these values in these files before each start.
server.cfg file
- endpoint_add_tcp
- endpoint_add_tcp "0.0.0.0:{{server.build.default.port}}"
- endpoint_add_udp
- endpoint_add_udp "0.0.0.0:{{server.build.default.port}}"
- sv_hostname
- sv_hostname "{{server.build.env.SERVER_HOSTNAME}}"
- set sv_licenseKey
- set sv_licenseKey {{server.build.env.FIVEM_LICENSE}}
- set steam_webApiKey
- set steam_webApiKey {{server.build.env.STEAM_WEBAPIKEY}}
- sv_maxclients
- sv_maxclients {{server.build.env.MAX_PLAYERS}}
Readme
FiveM
Supported architecture
FiveM ONLY supports amd64. arm64 is NOT supported (like Oracle free cloud)
Note on FiveM support from Pteroadactyl
Pterodactyl will not be providing support for FiveM. You are free to run a FiveM server but no support will be provided in the Pterodactyl Discord, check the discord annoucement below for details.
Worth a read if you plan on running a FiveM server Pterodactyl Discord Announcement
From the FiveM Site
FiveM is a modification for Grand Theft Auto V enabling you to play multiplayer on customized dedicated servers.
Notice
Currently the script can get versions from the builds site.
The FIVEM_VERSION variable.
- Defaults to
latestwhich is the latest recommended - Can be set to a specific version Ex.
2431-350dd7bd5c0176216c38625ad5b1108ead44674d.
The DOWNLOAD_URL only needs to be used if they turn on ddos protection. The variable needs to point to a fx.tar.xz file as I am too lazy to update the entire script.
txAdmin
txAdmin is now supported and disabled by default. You set TXADMIN_ENABLED to 1 to enable it.
The last update to the egg changes the server to use txadmin to run. On first startup it will print a key to use to sign into the txadmin panel.
[!WARNING]
Your server will not go online until it's started from txadmin
With latest update see txAdmin Github some things changed. For now this is added:
- TXHOST_TXA_PORT (Value can be changed by Admin)
- TXHOST_GAME_NAME (Value can be changed by Admin)
- TXHOST_DATA_PATH (hardcoded to /home/container/txData)
[!NOTE] This Egg can also be used for REDM (Same Framework/Artifact builds/TxAdmin).
When using this egg for REDM change value of Game name : to redm. [!WARNING] Reinstall is needed to write the correct values to files for correct functioning
(if you change Game Name, fivem <-> redm after first install ! )
Server Ports
Ports required to run the server in a table format.
| Port | default |
|---|---|
| Game | 30110 |
| Game+1 | 30120 |
| txAdmin | 40120 |
Changes
- Update FiveM egg (#218)
· brainshead · c55d566
- Validate and update embedded URLs
· Daniel Barton · bf9f3cb
- SteamCMD + Other fixes
· yesBad · edbf925
- Add standalone games
· Daniel Barton · 74c706a
Problem with this egg?
Open an issue on GitHub. Include your Panel and Wings versions.
Install script 98 lines bash in ghcr.io/ptero-eggs/installers:debian Show Hide
#!/bin/bash
# FiveM Installation Script
#
# Server Files: /mnt/server
apt update -y
apt install -y tar xz-utils file jq
mkdir -p /mnt/server/resources
cd /mnt/server
echo "updating citizenfx resource files"
git clone https://github.com/citizenfx/cfx-server-data.git /tmp
cp -Rf /tmp/resources/* resources/
RELEASE_PAGE=$(curl -sSL https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/)
CHANGELOGS_PAGE=$(curl -sSL https://changelogs-live.fivem.net/api/changelog/versions/linux/server)
if [[ "${FIVEM_VERSION}" == "recommended" ]] || [[ -z ${FIVEM_VERSION} ]]; then
DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.recommended_download')
elif [[ "${FIVEM_VERSION}" == "latest" ]]; then
DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download')
else
VERSION_LINK=$(echo -e "${RELEASE_PAGE}" | grep -Eo '".*/*.tar.xz"' | grep -Eo '".*/*.tar.xz"' | sed 's/\"//g' | sed 's/\.\///1' | grep -i "${FIVEM_VERSION}" | grep -o =.* | tr -d '=')
if [[ "${VERSION_LINK}" == "" ]]; then
echo -e "defaulting to recommedned as the version requested was invalid."
DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.recommended_download')
else
DOWNLOAD_LINK=$(echo https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/${VERSION_LINK})
fi
fi
if [ ! -z "${DOWNLOAD_URL}" ]; then
if curl --output /dev/null --silent --head --fail ${DOWNLOAD_URL}; then
echo -e "link is valid. setting download link to ${DOWNLOAD_URL}"
DOWNLOAD_LINK=${DOWNLOAD_URL}
else
echo -e "link is invalid closing out"
exit 2
fi
fi
echo -e "Running curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/}"
curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/}
echo "Extracting fivem files"
FILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*/} | cut -d',' -f2 | cut -d' ' -f2)
if [ "$FILETYPE" == "gzip" ]; then
tar xzvf ${DOWNLOAD_LINK##*/}
elif [ "$FILETYPE" == "Zip" ]; then
unzip ${DOWNLOAD_LINK##*/}
elif [ "$FILETYPE" == "XZ" ]; then
tar xvf ${DOWNLOAD_LINK##*/}
else
echo -e "unknown filetype. Exiting"
exit 2
fi
rm -rf ${DOWNLOAD_LINK##*/} run.sh
if [ -e server.cfg ]; then
echo "Skipping downloading default server config file as one already exists"
else
echo "Downloading default fivem config"
curl https://raw.githubusercontent.com/ptero-eggs/game-eggs/main/gta/fivem/server.cfg >>server.cfg
fi
# Map GAME_NAME to GAME_TYPE before writing to server.cfg
if [ "${TXHOST_GAME_NAME}" == "fivem" ]; then
GAME_TYPE="gta5"
elif [ "${TXHOST_GAME_NAME}" == "redm" ]; then
GAME_TYPE="rdr3"
else
echo "Invalid GAME_NAME specified: ${TXHOST_GAME_NAME}"
exit 1
fi
CFG_FILE="server.cfg"
# Only proceed if server.cfg exists
if [ -f "$CFG_FILE" ]; then
# Remove old gamename block: comment and actual line
sed -i '/^# set gamename/,+1d' "$CFG_FILE"
# Append clean new block
{
echo "# set gamename"
echo "set gamename \"${GAME_TYPE}\""
} >> "$CFG_FILE"
else
echo "Warning: $CFG_FILE not found. Skipping gamename insertion."
fi
mkdir -p logs/
echo "install complete"