How To Install Garry's Mod Server on CentOS 7
In this tutorial, I will explain how to setup a Garry's Mod server. This tutorial was written for CentOS 7.
Let's make sure that the system is fully updated. Create a new user for this server, and be sure to use a strong password.
yum upgrade -y
Open the required firewall ports with
firewall-cmd --zone=public --add-port=27015/tcp --permanent
firewall-cmd --zone=public --add-port=27015/udp --permanent
Install the required system libraries to run SteamCMD.
yum install glibc.i686 libstdc++.i686 -y
Now, switch to the user that was just created.
Download SteamCMD by using wget.
tar xf steamcmd_linux.tar.gz
Install the game server files with SteamCMD.
./steamcmd.sh +login anonymous +force_install_dir ./gmod +app_update 4020 validate +quit
When it says
Success! App '4020' fully installed., simply type
quit and press
The game server is now installed.
##Customizing the server
To change the name of your server, edit the
Paste the following into
server.cfg and change
RconPassword to anything you would like.
##Updating your server
We will create a script so that you can update your server with a single command. First, create the file
Paste in the following:
To update your server, you just need to run the following command:
./steamcmd.sh +runscript update_gmod.txt
##Running your server
Navigate to the
gmod folder and run your server.
screen -dmS gmod ./srcds_run -game garrysmod -console -port 27015 +maxplayers 18 -tickrate 66 +map gm_flatgrass
At this point, your server is now running in the background. You may shut it down at anytime with the following command.
screen -S gmod -X quit
Enjoy your new Garry's Mod server!