Setting up FiveReborn Server on Debian slash Ubuntu - jorjic/fivem-docs GitHub Wiki

Getting Started

In order to spare others the pain, I will outline the steps to run a FiveReborn server on Debian. These instructions will probably mirror well to Ubuntu, but don't hold me to it. Many commands used will require superuser privileges. In these cases, I will be using sudo. If you have superuser privilege 24/7 and don't use sudo, then don't use sudo. Or go back to Windows or something.

Installing Mono

[http://www.mono-project.com/docs/getting-started/install/linux/](Official Mono Install Instructions)

I highly advise that you read the instructions from the link above and follow them, instead of these instructions. There is a decent chance that by the time you read this, the instructions I have taken from their website will be outdated. Follow the instructions posted here if you like to live on the edge. Or if you're in a country that censors material deemed harmful to the political landscape. In that case: 欢迎!

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

sudo apt-get update

In my case I am running Debian 8.0+. The next instructions only apply if you are running Ubuntu 13.10+ or Debian 8.0+ (Inclusive). Also, note that these next commands apply to wheezy. Don't worry about this, as the repositories are compatible across distributions.

echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list

These next commands apply only to Debian 8.0+. NOT UBUNTU!

echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list

These next commands apply only to Ubuntu 12.10 and 12.04!

echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list

Now, let's get to installing the mono repositories. These instructions apply regardless of your version/distribution.

sudo apt-get -y install mono-devel

sudo apt-get -y install mono-complete

Hopefully everything has gone smoothly up to this point. If not, search the output on Google and StackOverflow. Now that we have Mono installed, we can set up the server.

Unpacking the Server

Let's grab the server software from FiveReborn's website. Hopefully Rockstar hasn't dismantled the project with their legal team yet, because then you'll have wasted a lot of time!

wget http://updater.fivereborn.com/client/cfx-server.7z

At this point, we need to extract the files from the 7zip. If you already have p7zip-full, dtrx, or a similar 7zip manager installed, you can skip the next step.

sudo apt-get -y install p7zip-full

Unzip the cfx-server.7z folder we downloaded. Did you know bash lets you auto-complete filenames by pressing tab? Try it!

7z x cfx-server.7z

Navigate into our newly unpacked cfx-server directory.

cd cfx-server

Edit citmp-server.yml and configure the server. You'll probably want to change your remote console password. Or maybe you're one of those people that like to live on the edge. I'm going to list nano as the next command, but feel free to use what you are comfortable with. I personally like vim, but nano seems to be more beginner-friendly. Depending on your familiarity, you may want to read a quick tutorial on using nano.

nano citmp-server.yml

After changing the settings, we need to enable execution for the server script. This will modify the permissions on the file, so that we may run it as a shell script.

chmod u+x run.sh

All Set!

We can now run our server! Run the command below to start the server.

./run.sh

Troubleshooting

My server crashes during start-up!

Check your Mono version and verify that it is at least version 4.6.

mono --version
Mono JIT compiler version 4.6.2

Nobody can connect!

If you wish to open up your server to non-local players (read: over the internet), you will need to apply a NAT exception in your router. More commonly known as port forwarding. I won't be covering instructions in this tutorial, because the steps are generally different for each router. Google instructions or find a knowledgable friend and give them this important information:

  • The local address of your server. Typically starts with 192.168 or 10. This can be found with the following commands:

      Windows: ipconfig
    
      Debian/Ubuntu: sudo ifconfig
    
  • Port: 30120 TCP and 30120 UDP. Sometimes you can choose protocol "Both", and just create one entry.

Use an online port-checking tool to verify that the configuration was successful. If an online website verifies that the port is reachable, verify that no firewalls are blocking the server from accessing the internet.