How to install FiveM on home hosted Linux servers

Playing GTAV online with your friends is really fun…until one of those hackers gets in your lobby at which point the fun is over completely. Thankfully there are solutions to that problem. For one you can follow our guide on how to install ragecoop which offers the possibility to play the singleplayer with your friends. Should you be interested in playing the online mode though you need to bring the bigger guns. So lets take a closer look on how to install FiveM on a home hosted Linux server.

Preparation

For this tutorial to work you should have SSH access to a server running a Ubuntu/Debian based Linux distribution. In best case the server should have at least a 2 core x64/x86 processor and a SSD equipped. Furthermore it is needed to have a public IP address if your friends should be able to connect to the server as it is otherwise only accessible from your home network. You should also have access to your home router to be able to change the port forwarding rules.

Installation

1. Creating structure

Before we begin downloading the right files it is advised to update and upgrade all the packages on the server by running:

Bash
sudo apt update && sudo apt upgrade

Furthermore it is a good idea to manage all the files within one folder. To do this create a folder by typing:

Bash
mkdir fivem && cd fivem

Note: should the following commands return a permission denied error you likely need to retry it with the word sudo in front of it

2. Download the files

Now head over to the official download page of FiveM to get the newest server files for linux. By right clicking on the latest download button you are able to copy the link too it and paste it inside the ssh connection to your server like this:

Bash
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/5848-4f71128ee48b07026d6d7229a60ebc5f40f2b9db/fx.tar.xz

With the wget command you will then download the tar file directly into the folder. As tar files are packages you will need to unpack them before doing anything with it:

Bash
tar xf fx.tar.xz

3. Port forwarding and IP addresses

Port forwarding can be a real pain when it comes to servers. Depending on you network configuration this is more or a less a problem. In the following it is expected that your home connection has a public IP so that you can simply tell your router which port to open from which device and it will make the reachable from a static IPv4 address.

Should this be the case, log in into your routers admin panel and search for the IP of your Linux server which you can obtain by simply typing “ifconfig” into the console. Once you found the right device set a forwarding rule for TCP port 30120 and UDP port 30120.

3. Starting the admin panel

Now proceed to start the server admin panel by running:

Bash
bash run.sh

After the admin panel has started up you can try to connect to it. If your server is in your home network simply type in its local IP address followed by “:40120”. Should it not be in your home WiFi you first need to open the port in the firewall.

Once you accessed the admin panel you will see that it requires a pin from you. Go back to the server console and search through the server output until you find the small blue box with the instructions to connecting with the server. Now copy this pin and copy it into the website from before.

4. Create an account at FiveM

Before you are able to proceed further you will need to register your server at the FiveM keymaster service. Once you are logged in switch over to the new server option and register you server by typing in the public IP address of you router and a random name you would like your server to be saved under. Also choose home hosted for the server provider. Once the newly registered server has been saved you are given a key that you should save for later.

5. Finish setting up the admin pannel

Now switch back to the txAdmin panel and proceed by logging in with you FiveM keymaster credentials and follow the admin panel installation guide. If you just want to get it running always choose the recommended option. The server will then build a recipe for the right configuration you choose during the process. After clicking a few times next you will end up at a point where you need the freshly generated key that you copied before again.

After running the recipe and saving the server config file you are finally able to press “save and run server”! The site then redirects you to the main admin control panel of your new FiveM server.

Connecting to the server

Now head over to FiveM and install the client. After launching it press F8 and type in:

Bash
connect [YOUR IP ADDRESS]:30120

Congratulations you created your very own FiveM server! Should you be interested in more server guides check out our full guide to ragecoop servers allowing you to play the GTA offline mode together with friends or at older classics such as setting up your own minecraft server.

Leave a Reply