Debian 9.3

Tested: 04-14-2018


Setup dependencies

sudo apt-get -y install xz-utils git nano curl
sudo apt-get -y install dirmngr --install-recommends
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 
apt-get update 
echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list 
echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list 
apt-get update
sudo apt-get -y install mono-devel
sudo apt-get -y install mono-complete 

Setup SQL with Phpmyadmin

apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
sudo apt-get update
sudo apt install mariadb-server

Apache2 & PHP

sudo apt-get install apache2 php php-cgi libapache2-mod-php php-common php-pear php-mbstring

phpmyadmin

sudo apt-get install phpmyadmin php-mbstring php-gettext

—-

Create server folders

cd /home/user/
mkdir FiveM && cd FiveM
mkdir server && mkdir server-data

Download required files

cd /home/user/FiveM/server

Download latest fx.tar.xz file.

wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/577-58409c3bbac347c02841cbd938b7185702d25194/fx.tar.xz
tar xf fx.tar.xz

-

cd /home/user/FiveM
git clone https://github.com/citizenfx/cfx-server-data.git /home/user/FiveM/server-data
nano server.cfg

Example config file here.


Start the server

cd /home/user/FiveM/server-data/

nano startserver.sh

bash /home/user/server/run.sh +exec server.cfg

chmod +x startserver.sh
./startserver.sh