[FX-Server][Tutorial] How To Setup FX-Server On Linux - From Start To Finish

Hi, when i try to start my server i get this

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
Unhandled exception in Mono script environment: System.NullReferenceException: Object refe rence not set to an instance of an object
(null)GlobalError: Unhandled exception in Mono script environment: System.NullReferenceExc eption: Object reference not set to an instance of an object
(null)
Aborted

someone knows whats wrong?

How do I put a database on that server? mysql

Try running it in sudo…

If not then try download mono
sudo apt install mono-devel

Install phpmyadmin

nothing happening when i try to start the server

I cant do that

when i want to do sudo cert-sync /etc/ssl/certs/ca-certificates.crt my server says evertime command not found

how do you start the server on startup? Im using a vps and I would like for the server to start with linux, when i try to use systemd it just reboots the server, the server itself throws out an error.

How i can update server files without reinstall them ?

Hi,
Have you tried to use the screen function on linux VPS?
You would do
screen -R
This then creates an open screen session that you can exit and leave open at the same time.
Run your Fivem Server commands:
cd /home/FiveM/server-data
bash /home/FiveM/run.sh +exec server.cfg

Then do CRTL A+D this would then exit you out
Type screen -ls to list the open sessions you should have. You can then exit your VPS normally and FiveM will still be active.

Cheers
Aaron

You would need to create service for it to start with boot:

create your start up script for fivem in your fx-server-data folder like you would normally , then in /etc/systemd/system/ create a file and call it whatever you want

example:

fivem.service

Add the following adjusting for your directories:

# vi /etc/systemd/system/sample.service
[Unit]
Description=Fivem server startup script 
After=network.target

[Service]
Type=simple
ExecStart=/fivem/fx-server-data/fivem.sh
TimeoutStartSec=0

[Install]
WantedBy=default.target

References:


Hello, i’am having a problem when it comes to start the server, i am running Debian an it says i don’t have permission to start the server.

bash /home/fx-server/run.sh +exec server.cfg /home/fx-server/run.sh: line 8: /home/fx-server/alpine/opt/cfx-server/ld-musl-x86_64.so.1: Permission denied /home/fx-server/run.sh: line 8: exec: /home/fx-server/alpine/opt/cfx-server/ld-musl-x86_64.so.1: cannot execute: Permission denied
how can i solve this error?

I believe this was solved on your other post if recall correctly.

Hello bro you still have you server on leaseweb?

Would just like to say nice tutorial, personally I use TCAdmin but I’ll be honest I have struggled with setting up a FX server on my linux dedicated and followed this tutorial myself.

I have the same issue of a lot of people here. Linux server starts but no connection can be made. Ports are open, I can connect using telnet but neither fivem client neither browser can connect. Did someone figured out what is wrong? Same exact configuration works on windows server. I hosted several gameserver on linux and I never had an issue like this one. I tested on ubuntu 16, 18 centos 7. All fresh new install. Seems an issue with the binaries. Please someone with experience can help?

supa can u help me how to server in server list?

Tried this various times. Have the following problems.

git clone https://github.com/citizenfx/cfx-server-data.git fx-server-data
did not work, had to use wgen install git https://github.com/citizenfx/cfx-server-data.git fx-server-data

When connecting to server from client side i get handshake, downloading content and then stuck in fetching info. Any ideas?

I haven’t been participating in the community for a long time and this tutorial is very outdated. Some things might still work but a lot of it is likely different now that the project has evolved. I don’t even know if FX-Server is still a thing these days.

Best of luck everyone.

ld-musl-x86_64.so.1 does not start.
Invalid binary file