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:
-
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.
-
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.
-
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
-
Set up the RootFS for the emulator:
FEXRootFSFetcher
Type 1 and press Enter for everything, as this will download approximately 1GB of data.
-
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
-
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.
-
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.
-
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
-
Set up the RootFS for the emulator:
FEXRootFSFetcher
Type 1 and press Enter for everything, as this will download approximately 1GB of data.
-
Begin by running steps from 1 to 3 in the server manual.
-
Start the server using:
FEXInterpreter ~/FXServer/server/run.sh
-
Complete the txAdmin setup according to what you see on the screen.
-
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:
- Server Manual
- Opening Ports
- Packages required by the FEX emulator
- Idea of using FEX emulator and startup command
Feel free to test it out, and let me know if you have any questions or encounter any issues.