FiveM Server Docker Image

:spouting_whale: fivem-docker — a flexible Docker image for FiveM servers

A lightweight, reusable Docker image for running any FiveM server. Nothing is baked in — you pick the version and point it at your content at runtime.

What it does

  • Pick your artifact version at runtime — set FXSERVER_VERSION to a build number, a pinned NUM-HASH, or a channel (recommended / latest / critical / optional). Downloaded + cached on boot; switch versions with a restart.

  • Your resources & configs, anywhere — bind-mount them from the host, or have the container pull them from a git repo on boot (monorepo or split resources/cfg repos).

  • Two launch modestxAdmin (web panel, default) or direct (TXADMIN=0, no panel, fxserver runs your server.cfg straight).

  • Git auto-update toggleGIT_AUTOPULL=1 keeps prod synced to a branch each boot; 0 for devs so their local work is never touched.

  • External database friendly — connect to MySQL running on the host (host.docker.internal).

  • Simple config — everything via env vars / a .env file. Secrets too.

  • Sane defaults — runs as a non-root user, healthcheck built in, persistent /data volume for cache + txAdmin state.

Quick start

docker run -d \
  -p 30120:30120/tcp -p 30120:30120/udp -p 47291:47291/tcp \
  -e FXSERVER_VERSION=recommended \
  -e LICENSE_KEY=■■■■■■■■■■
  -v /path/to/resources:/data/txData/server/resources \
  -v /path/to/server.cfg:/data/txData/server/server.cfg \
  -v fivem-data:/data \
  fivem-docker

Or use the included docker-compose files (dev + prod).

Github Repo: Click here!
License: MIT

If you don’t have experience with docker this probably isn’t for you. I do NOT plan on providing any support with getting this setup since the readme provided covers everything. If there are any bugs then please let me know either on here or via a github issue and I will do my best to push a fix ASAP. It does currently work and I’m using it during the development of my framework. :slight_smile:

11 Likes

GitHub - LeGrizzly/fxserver: FXserver · GitHub plus legere, opti, update auto tous les jours :eyes: :joy:

It’s lighter cause it’s really only a base image and nothing more. You published a wrench…I published the whole toolshed my dude. txAdmin, git provisioning, secrets, healthcheck, auto artifact resolve at boot…you can’t really compare the 2 breh. :eyes: :joy:

A lot of lines in your entrypoint.sh for nothing… fivem publishes artifact updates on their site /artifacts/ / FiveM Artifacts with the release of txadmin :rofl:

+1 for secret docker

Not everyone uses txAdmin. Artifact download is like 1 of my scripts…and yeah fivem publishes them, that’s exactly what artifact.sh fetches at boot (so you upgrade by restarting, not rebuilding the image). The rest isn’t fetching artifacts:

  • git provisioning → pulls resources + cfg from a repo on boot

  • secret resolution (the part you liked)

  • volume/bind-mount perm fixing so it doesn’t run as root

  • txAdmin env config + healthcheck + artifact caching/pruning

Honestly if you want something super simple then your repo is prob the way to go. I made mine as a more all inclusive docker image to manage EVERYTHING with multiple way to go about doing things. It’s more or less a 1 size fits all while yours is more simple and to the point. Both repo’s solve separate needs my friend. :slight_smile:

Edit - Apparently I can’t type or spell anything right today lmaooo.

2 Likes

Either way guys, thanks! The more resources out there for people to self-host the better.

I actually did something similar but for enhanced as I’m new to server hosting but quite familiar with Docker.

1 Like