Deploying a FiveM server in Ubuntu on aarch64 (arm64) machine

Greetings forum members. As of you all probably know that the FiveM server files are compiled and meant to be used on an x86_64 machine. So there is no way to run FiveM server on an aarch64 machine natively, so I am going to show you how to deploy a FiveM server using an Emulator called FEX-Emu.

Machine Test Environment:

My test environment is a virtual machine running on Oracle Cloud with 4 OCPU (vCPU), 24GB RAM, and a 150GB SSD.

Steps to run a barebone FiveM server:

  1. Begin with the initial setup as outlined on the Server Manual Page, excluding step 7. Don’t forget to change the license key and game version.

  2. Open the required ports for FiveM:

    sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 30120 -j ACCEPT
    sudo iptables -I INPUT 6 -m state --state NEW -p udp --dport 30120 -j ACCEPT
    sudo netfilter-persistent save
    

    Important: You may also need to open those ports on your server provider.

  3. Install necessary packages for the emulator:

    sudo apt update && sudo apt -y install software-properties-common curl git iproute2 libssl-dev squashfuse fuse squashfs-tools tzdata tar wget zip build-essential unzip gdb gettext
    sudo add-apt-repository ppa:fex-emu/fex && sudo apt update
    sudo apt -y install fex-emu-armv8.0 fex-emu-binfmt32 fex-emu-binfmt64
    wget http://launchpadlibrarian.net/668077130/libssl1.1_1.1.1f-1ubuntu2.19_arm64.deb
    sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.19_arm64.deb && sudo rm libssl1.1_1.1.1f-1ubuntu2.19_arm64.deb
    
  4. Set up the RootFS for the emulator:

    FEXRootFSFetcher
    

    Type 1 and press Enter for everything, as this will download approximately 1GB of data.

  5. Start the FiveM server:

    cd $HOME/FXServer/server-data && FEXInterpreter $HOME/FXServer/server/alpine/opt/cfx-server/ld-musl-x86_64.so.1 --library-path "$HOME/FXServer/server/alpine/usr/lib/v8/:$HOME/FXServer/server/alpine/lib/:$HOME/FXServer/server/alpine/usr/lib/" -- $HOME/FXServer/server/alpine/opt/cfx-server/FXServer +exec $HOME/FXServer/server-data/server.cfg
    
  6. After a successful startup, you can use:

    cd $HOME/FXServer/server-data && $HOME/FXServer/server/run.sh +exec $HOME/FXServer/server-data/server.cfg
    

    Important: Execute the command from within the $HOME/FXServer/server-data directory.

    Note: To keep the server active even after leaving the console, quit the command above, use tmux, and then run the command again.

Steps to run a txAdmin server:

Note: You also need to set up a database, so make sure to do this before proceeding.

  1. Open needed ports:

    sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 30120 -j ACCEPT
    sudo iptables -I INPUT 6 -m state --state NEW -p udp --dport 30120 -j ACCEPT
    sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 40120 -j ACCEPT
    sudo iptables -I INPUT 6 -m state --state NEW -p udp --dport 40120 -j ACCEPT
    sudo netfilter-persistent save
    

    Important: You may also need to open those ports on your server provider.

  2. Install necessary packages for the emulator:

    sudo apt update && sudo apt -y install software-properties-common curl git iproute2 libssl-dev squashfuse fuse squashfs-tools tzdata tar wget zip build-essential unzip gdb gettext
    sudo add-apt-repository ppa:fex-emu/fex && sudo apt update
    sudo apt -y install fex-emu-armv8.0 fex-emu-binfmt32 fex-emu-binfmt64
    wget http://launchpadlibrarian.net/668077130/libssl1.1_1.1.1f-1ubuntu2.19_arm64.deb
    sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.19_arm64.deb && sudo rm libssl1.1_1.1.1f-1ubuntu2.19_arm64.deb
    
  3. Set up the RootFS for the emulator:

    FEXRootFSFetcher
    

    Type 1 and press Enter for everything, as this will download approximately 1GB of data.

  4. Begin by running steps from 1 to 3 in the server manual.

  5. Start the server using:

    FEXInterpreter ~/FXServer/server/run.sh
    
  6. Complete the txAdmin setup according to what you see on the screen.

  7. After completing everything, you should be able to run the server using:

    ~/FXServer/server/run.sh
    

    Note: To keep the server active even after leaving the console, quit the command above, use tmux, and then run the command again.

Testing Your Connection:

Visit http://yourserverip:30120/info.json and check if the page loads successfully.

Or instead of all of this work, use the Pterodactyl egg in your Pterodactyl panel:

FiveM aarch64 egg for Pterodactyl.

Conclusion:

By following this guide, you can successfully run a FiveM server on an aarch64 Ubuntu machine using the FEX-Emu emulator.

Resources:

Feel free to test it out, and let me know if you have any questions or encounter any issues.

6 Likes

You’re the best.

It worked without any issues.

You are in my heart.

Thank you.

1 Like

It works very well thanks friend

1 Like

I hope someone responds to this, I can’t make my own posts apparently…

I am using a docker on UNRAID, got the server running and configured with txAdmin and it’s all working great! The issue is that I can’t add any resources :confused: Each time I add a resource and change the system.cfg I get the “Cannot find resource” error, I have tried typing out the entire file path as well. Nothing is working!

Maybe you need to give read/write permissions to the resources folder. I cant say much because I didnt try it inside a docker.

1 Like

I gave up with esx and decided to try qbcore, I’ve been able to add resources with it! I’m running into issues now however where certain base game vehicles like the Hyrda and Lazer won’t spawn in either from the admin menu, or in their typical spawn locations. I’m going through the vehicle.lua but I don’t see any restrictions in there that would prevent them from spawning

It may be related to txAdmin version and game version. Try in different versions. I’ll test today and let you know.

Edit: I am actually able to spawn hydra using txadmin menu. Game version 3095, txadmin version 8981-e9195782416dcdb424e74d438b940a212f6ac316.

1 Like

I am also running 3095, I’m not 100% sure how to check txAdmin version, I see in the log it says I MAY be running 7.72?

======== txAdmin v7.2.2 atop fxserver 8981 Starting - 7/21/2024, 4:13:34 PM

so I’m not too certain what I am looking at there.

The txAdmin version seems to be same as me, but it may be the issue from the docker image. I will try to create a docker image and update the docs.

1 Like

TxAdmin 7.2.2 is the last, it’s avaliable with artifacts 8981.

1 Like

I wound up doing a fresh install and started running qbcore over esx and that has alleviated my issues! Thank you to everyone for all the help!!

As far as certain vehicles not working, I found that they were disabled in a qb-core config (can’t recall exactly which one)

I stumbled across it whilst trying to find a way to reduce the 5 minute long “bleed out”