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:

  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 click 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 must be able to 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: If you want to keep the server active even after disconnecting from SSH, quit the command you ran above then use tmux, after that run the command above again.

Testing Your Connection:

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

Or instead all of those 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.

3 Likes