コミュニティソリューション

How to Run a FiveM Server on CasaOS with Docker

A 2023 CasaOS user asked whether an old gaming PC could host a private FiveM server. Community replies confirmed that FiveM's FXServer can run in Docker and supplied a CasaOS-compatible Compose starting point.

Yes, a FiveM server can run on a CasaOS host through Docker. That was the answer reached in the September 2023 IceWhale Community thread: the user's old gaming PC already had enough resources for CasaOS workloads, and community members pointed out that FiveM's FXServer has Linux builds and can be containerized as a custom CasaOS application.

The historical thread used the third-party spritsail/fivem image and exposed both the FiveM game port and txAdmin. That remains a useful starting architecture, but it should not be confused with an official Cfx.re CasaOS package. Current Cfx.re documentation still supports Linux FXServer, while explicitly warning that the Linux server is a courtesy port and Windows generally receives better compatibility and diagnostic support. In 2026, Linux/Docker-specific FiveM issues have also continued to appear, so test the exact server artifact and game build you plan to use.

What the Original CasaOS Thread Confirmed

The source post asked whether a private FiveM server could be run on an old gaming PC already acting as a CasaOS server. Two replies provided the useful answer:

  • FiveM/FXServer can run on Linux and in Docker.
  • A custom CasaOS application can expose the required ports and persist configuration/data.
  • The server still needs a valid Cfx.re license key.
  • Hardware must be sufficient for the number of players, resources, scripts, and database workload.

The Community Docker Compose Starting Point

The 2023 reply proposed a CasaOS custom-app definition based on the third-party spritsail/fivem image:

services:
  fivem:
    image: spritsail/fivem
    restart: on-failure
    environment:
      LICENSE_KEY: YOUR_LICENSE_KEY
      NO_DEFAULT_CONFIG: 1
    ports:
      - "40120:40120"
      - "30120:30120"
      - "30120:30120/udp"
    volumes:
      - /DATA/AppData/fivem/config:/config
      - /DATA/AppData/fivem/data:/txData
    stdin_open: true
    tty: true

This is source-derived historical configuration, not an IceWhale-maintained app definition. Review the current image documentation before importing it into a live CasaOS system.

Which Ports Does FiveM Need?

The community configuration exposed:

  • 30120/TCP — main FXServer game traffic.
  • 30120/UDP — main FXServer UDP traffic.
  • 40120/TCP — txAdmin web interface in the source configuration.

Current Cfx.re txAdmin documentation still lists port 40120 as the default txAdmin HTTP port. See the current txAdmin documentation.

Create a Cfx.re License Key

Current Cfx.re server setup documentation requires a server license key before starting FXServer. Register the server through the current Cfx.re/Cfx Portal workflow and keep the key private.

Official reference: Setting Up a Server.

Do not commit the key into a public Git repository or paste it into screenshots. CasaOS environment variables are convenient, but anyone with administrative access to the Docker configuration may be able to read them.

Persist Configuration and txAdmin Data

The original Compose mounted:

/DATA/AppData/fivem/config → /config
/DATA/AppData/fivem/data   → /txData

The principle is more important than those exact paths: server configuration and txAdmin profiles should live on persistent host storage so recreating the container does not erase the server state.

Before changing container images or server artifacts, back up those directories.

Current FiveM Documentation Still Treats Linux as a Secondary Server Port

Cfx.re's current vanilla setup documentation contains an important Linux warning: the Linux version of FXServer is provided as a courtesy port because Linux distribution compatibility and native diagnostic tooling can be more difficult. It says issues are more likely to receive fixes on Windows.

This does not mean Linux servers are unusable. It means a CasaOS Docker deployment has an additional compatibility layer compared with a normal supported Windows server.

Docker-Specific FiveM Issues Still Exist in 2026

Recent CitizenFX issue reports show that a Linux FXServer can run correctly inside Docker while specific enforced game builds or Enhanced artifacts still trigger container-specific failures. For example, a 2026 issue reproduced a client crash with sv_enforceGameBuild 3751 on Linux/Docker while the same vanilla container worked without that setting.

That is why a working container start and reachable txAdmin page do not guarantee every FiveM artifact/resource combination is stable.

How Much Hardware Do You Need?

The original 2023 reply quoted old FiveM minimum desktop requirements. Those values are not a reliable modern server-sizing formula. Dedicated-server demand depends heavily on:

  • player count;
  • framework and resource count;
  • Lua/JavaScript/C# script quality;
  • database workload;
  • OneSync configuration;
  • additional services such as MariaDB/MySQL.

For a small private server, an old gaming PC can be adequate, but CPU single-thread performance and RAM headroom matter more than simply matching a historical minimum list.

FiveM Frameworks May Need a Separate Database

If you install ESX, QBCore, or another framework, the FiveM container may need to reach a MariaDB/MySQL container. Put both services on a user-defined Docker network so they can communicate by stable service name rather than changing container IP addresses.

Keep the database data in its own persistent CasaOS AppData directory and back it up independently of the FXServer files.

Test on the LAN Before Opening the Server to the Internet

Start with a local test:

  1. Confirm the FiveM container remains running.
  2. Open txAdmin at http://CASAOS_IP:40120 if the image uses the default port.
  3. Finish the txAdmin configuration.
  4. Confirm 30120/TCP and 30120/UDP are mapped.
  5. Join from another device on the LAN.
  6. Only after local testing, configure router/firewall rules if internet players need access.

Internet Hosting Adds Security Responsibilities

A public game server receives unsolicited internet traffic. Keep CasaOS itself, SSH, the Docker API, and database ports private. Only expose the ports required by FXServer/txAdmin, and consider restricting txAdmin access rather than leaving its management interface open broadly.

Do not expose MariaDB/MySQL directly to the internet simply because FiveM needs a database.

CasaOS FiveM Server Checklist

  1. Confirm the host has sufficient CPU, RAM, and storage.
  2. Create a Cfx.re server license key.
  3. Choose a maintained FiveM/FXServer Docker image or build the image yourself from current artifacts.
  4. Persist configuration and txData outside the container.
  5. Expose 30120/TCP and 30120/UDP.
  6. Expose txAdmin only as needed.
  7. Test locally before configuring public firewall/NAT rules.
  8. Back up txData, resources, server.cfg, and any external database.
  9. Expect Linux/Docker compatibility differences from Windows FXServer.

FiveM on CasaOS FAQ

Can FiveM run on CasaOS?

Yes. The source thread supplied a working Docker architecture for a custom CasaOS app. The container image itself was third-party rather than an official CasaOS package.

Is spritsail/fivem an official Cfx.re image?

No. It is a third-party Docker image referenced by the community. Check its current maintenance state before using it.

Which ports should I map?

The source configuration used 30120/TCP, 30120/UDP, and 40120/TCP for txAdmin.

Is Linux/Docker as well supported as Windows?

Not exactly. Current Cfx.re documentation explicitly describes Linux FXServer as a courtesy port and says Windows is more likely to receive fixes for compatibility problems.