Skip to content

FiveM Server in a Docker Container

License

Notifications You must be signed in to change notification settings

Auhrus/fivem-docker-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FiveM Docker Server 🦺

This image provides a FiveM/txAdmin server. After the first startup, it downloads the defined version from the CFX servers. If there is an update to the server files, simply recreate the container without having to redownload the image again. Everything will be downloaded again (only new) and you can continue.

Content🧾

Deployment👩‍💻

How to install this Docker Container

  1. Install Docker on your Server. [Here] you can find a guide.
  2. Run that command
docker run -d -t --name CONAINER_NAME -p 40120:40120/tcp -p 30120:30120/tcp -p 30120:30120/udp -e download=VERSION -v VOLUME_NAME:/opt/fivem/txData ghcr.io/auhrus/fivem:latest

Please replace all things written in CAPS.

  1. After all data has been downloaded, the txAdmin server will start.

  2. Now the txAdmin server must be set up. This is done via the web interface provided by FiveM.
    [Here] you can read from point 2 on, how to set up txAdmin. (The PIN can be found in the server console)

  3. After that the FiveM server will be started and you can play.

Environment Variables🔢

To run this container, you will need to set the following environment variables.

Variable Function Default
download With this variable you can determine which version of the FiveM server will be downloaded.
Below you will find a more detailed description of this variable.
recommended
PATH You can ignore this, it will be created automatically by the Alpine base. /usr/local/sbin:/usr/local/bin:
/usr/sbin:/usr/bin:/sbin:/bin
TZ This can be used to set the time zone within the container. Enter a TZ identifier for this. When unset its UTC time. --

Detailed description of the download variable

There are 3 ways to use the variable.

  1. Set it to 'recommended'
    In that case, the version that can be downloaded at the time of container creation via the "Latest Recommended" button. Seen in the picture below.

  2. Set it to 'optional'
    In that case, the version that can be downloaded at the time of container creation via the "Latest Optional" button. Seen in the picture below.

  3. or insert a link of the desired version
    If you need a specific version of the server, you can also insert the direct link to the desired version file. The link will look like this e.g.

https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/6622-d24291cd0e6119311f5b410be6167f6ccdc3e62d/fx.tar.xz

All versions can be found ->HERE

image



How the server get started:

SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
	
exec $SCRIPTPATH/alpine/opt/cfx-server/ld-musl-x86_64.so.1 \
--library-path "$SCRIPTPATH/alpine/usr/lib/v8/:$SCRIPTPATH/alpine/lib/:$SCRIPTPATH/alpine/usr/lib/" -- \
$SCRIPTPATH/alpine/opt/cfx-server/FXServer +set citizen_dir $SCRIPTPATH/alpine/opt/cfx-server/citizen/ $*

Up-/Downgrade⏫

How do i change the version of my FiveM Server?

  1. First stop and remove the existing Container.
docker stop CONAINER_NAME && docker rm CONAINER_NAME
  1. Then create him again like in the Deployment👩‍💻 with the same Volumes.

Please note that downgrading may cause compatibility problems e.g. with the txAdmin database.

Support❤️

If you find any bugs have improvements for this Documentation or have any other suggestions/improvements, please post a bug report or feature suggestion in the Issues Tab.