CENTOS — Setup FiveM Game Server

Server Requirements

  • CentOS 7 x64
  • RAM: 2GB or more – 2GB ram for non ESX | 4GB or more for ESX
  • HDD/SSD: 20GB or more
nano /root/SetupFiveMServer.sh
/bin/echo -e "\e[1;31m Updating OS \e[0m"
yum update -y
/bin/echo -e "\e[1;31m Installing Apache2 .. Nano .. wget .. screen \e[0m"
yum install httpd nano wget screen -y
systemctl enable httpd.service
systemctl restart httpd.service
/bin/echo -e "\e[1;31mInstalling PHP v7\e[0m"
yum install -y php
/bin/echo -e "\e[1;31mInstalling SQL Server\e[0m"
yum install mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
/bin/echo -e "\e[1;31m Setps for setup.....\e[0m"
/bin/echo -e "\e[1;31m1. Press ENTER\e[0m"
/bin/echo -e "\e[1;31m2. Press Y and make a new password\e[0m"
/bin/echo -e "\e[1;31m3. Remove anonymous users? ( Y )\e[0m"
/bin/echo -e "\e[1;31m4. Disallow root login remotely? ( N )\e[0m"
/bin/echo -e "\e[1;31m5. Remove test database and access to it? ( Y )\e[0m"
/bin/echo -e "\e[1;31m6. Reload privilege tables now? ( Y )\e[0m"
/bin/echo -e "\e[1;31m Enabling epel-release \e[0m"
yum install epel-release -y
/bin/echo -e "\e[1;31mInstalling phpmyadmin\e[0m"
yum install phpmyadmin -y
/bin/echo -e "\e[1;31mReplacing phpmyadmin config file\e[0m"
rm -f /etc/httpd/conf.d/phpMyAdmin.conf
sleep 5
wget https://sesipod.info/DATA_FILES/scripts/FiveM-Setup/phpMyAdmin.conf -P /etc/httpd/conf.d/
/bin/echo -e "\e[1;31mRestarting phpMyAdmin\e[0m"
systemctl restart httpd.service
/bin/echo -e "\e[1;31mOpening FireWall Ports\e[0m"
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload 
systemctl restart firewalld
/bin/echo -e "\e[1;31mMaking Folder for FiveM server\e[0m"
mkdir /home/FiveM
/bin/echo -e "\e[1;31mDownloading the artifacts needed for FiveM\e[0m"
sleep 5
wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/679-996150c95a1d251a5c0c7841ab2f0276878334f7/fx.tar.xz 
sleep 2
mv fx.tar.xz /home/FiveM/
cd /home/FiveM 
tar xf fx.tar.xz
rm -f fx.tar.xz
/bin/echo -e "\e[1;31mOpening FireWall Ports for FiveM - Port: 30120\e[0m"
firewall-cmd --zone=public --add-port=30120/tcp --permanent
firewall-cmd --zone=public --add-port=30120/udp --permanent
firewall-cmd --reload 
systemctl restart firewalld
/bin/echo -e "\e[1;31m Getting Start file.\e[0m"
sleep 5
wget https://sesipod.info/DATA_FILES/scripts/FiveM-Setup/start.sh
mv start.sh /home/FiveM
chmod +x start.sh
mkdir /home/FiveM/server-data
/bin/echo -e "\e[1;31mServer is now ready!\e[0m"
/bin/echo -e "\e[1;31m..............\e[0m"
/bin/echo -e "\e[1;31mYou can now connect using FileZilla and move to folder /home/FiveM/server-data to get started.\e[0m"
/bin/echo -e "\e[1;31mYou can run your server using ( ./home/FiveM/start.sh )\e[0m"
chmod +x /root/SetupFiveMServer.sh

The server will have ports 80 and 30120 open for you by default.

You can connect to phpmyadmin at http://serverip/phpmyadmin

You can connect to your game using : serverip:30120

Was this helpful?

0 / 0