Garry's Mod

Garry's Mod

Not enough ratings
Garry´s Mod Dedicated Server (SteamCMD) [English/Englisch] [Windows]
By Zeromix and 1 collaborators
This guide will show you how to set up a server with the SteamCMD.

The following ports must be open:
1200 UDP 27000 - 27015 TCP 27000 - 27015 UDP

Looking for the german version?
http://steamcommunity.com/sharedfiles/filedetails/?id=719731406

I also created a tool, that automates the installation process. You can find this tool here:
https://steamcommunity.com/groups/ServerTool
   
Award
Favorite
Favorited
Unfavorite
SteamCMD Download
First of all you need the SteamCMD. You can download it here:
https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip
SteamCMD Login
Now you need to execute this file.
After a few seconds you can login:



login anonymous

By now you should be logged.
Server Files Download
Now you need to enter the following in the console:
force_install_dir ./gmod_ds/
This will create a folder with the name "gmod_ds" and it will put in the files in this folder.

Now you can start the download with:
app_update 4020 validate

If the download was sucessful, you have to type
exit
in the console to close the SteamCMD.
Run the Server
The best option is to create a .bat file in your "gmod" folder (e.g. start.bat):
You need to create this .bat in this folder:
C:\Steam-Server\gmod_ds

Edit the .bat file with following code:
start srcds.exe -console -game cstrike -secure +maxplayers 22 +map gm_flatgrass
You can also change the port with "-port 27015"
With this, you just created your Server!
Server Configuration
Your server.cfg can be found here:
SteamCMD\gmod_ds\garrysmod\cfg
The following code can be used in every game mode:
// Server Name hostname "Your Servername" // Server Name // Rcon Passwort rcon_password "Rcon Passwort" // Used to kick people etc. // Server Passwort sv_password "Server Password" //Password to connect, can also be leaved empty. //Loading Screen; //sv_loadingurl "http://yourdomain.com/" //FastDL ; //sv_allowupload "1" //"0" to denied, to upload player custom sprays etc. //sv_allowdownload "0" //"0" denied the direct download from the server //sv_downloadurl "http://yourdomain.com/" net_maxfilesize "32" //Allow servers to download large files without hassle. //Misc log on // enable or disable server logging. on is on / off is off

These settings can also be found here:
https://pastebin.com/vtdYsHLG
Backup Link:
https://hastebin.com/ifosonukab.cpp
Using Addons [Steam Workshop]
First of all you have to create a collection with all the files from the Steam Workshop you want on your server.
After that you have to generate a special key for your server.
This is possible here:
http://steamcommunity.com/dev/apikey

Now you open the BAT file again in order to edit it.
You have to enter your key lite this:
-authkey KEY-ID

You may have noticed that the link to your collection looks like this:
...filedetails/?id=248079564
You need to enter this ID also in your BAT file:
+host_workshop_collection 248079564
This would be for example this server collection:
https://steamcommunity.com/sharedfiles/filedetails/?id=248079564

Please note:
The Steam Workshop downloads are limited to 20 KB/s, but you do not need a fast download, since all files will be provided!

Also: The Server Collection has to be public.
Beeing ranked in the server list
Since the update of the 11th may of 2020, will Servers, that doesn´t use a Game Server Login Token (GSLT) will receive a massive ranking penalty in the server browser.

You can create a token here:
https://steamcommunity.com/dev/managegameservers

The App ID would be "4000" in that case.

You have to add thise code in your batch file:
+sv_setsteamaccount <your token here>

So it´s basicly:
+sv_setsteamaccount DASSDADSADSDDAAS

Important: 2 Servers can´t share the same GSLT!

Source:
https://steamcommunity.com/games/garrysmod/announcements/detail/1716372156967158715
Changing the Gamemode
Now i will show you, how you can change the Gamemode. (In my e.g. i will use the TTT-Mode.)

You have to edit the .bat file:
+gamemode terrortown

You can also change the map, if you have another map of course.

Here you can find a kind of a TTT-Config:
http://ttt.badking.net/config-and-commands/convars

That´s it!
Have fun!
Installing ULX Mod [Admin Plugin]
To install ULX, you need to add the following Addons to your server collection:
https://steamcommunity.com/sharedfiles/filedetails/?id=557962238
https://steamcommunity.com/sharedfiles/filedetails/?id=557962280

Then you just start the server and connect to it.
After you´ve connected, you need to type the following in the server console:
ulx adduser <YOURUSERNAME> superadmin

In my case this would be the following:
ulx adduser Zeromix superadmin

And it´s done, you´re Admin!
You can find the official ULX page here for reference:
https://ulyssesmod.net/

If you need to edit some config files, you can find them in your
/gmodds/garrysmod/data
folder.
Frequently Asked Questions
I can not see my server / No one can connect to my server
Please make sure, that you have opened all the required ports in your router. If the everything is set correctly, but the problem still occurs, please contact your internet provider.
Or look for your router model here:
https://portforward.com/router.htm

Is there another way instead of opening the ports?
Yes, you can also host your server through a VPN network like "Hamachi". Of course only the people in the VPN network will be able to join the server then.
If forwarding your ports doesn´t work, please contact your ISP, i won´t be able to help you.

How can i change my server port?
Just edit the bat file with "-port 27015"

The SteamCMD download failed! What should I do now?
Mostly you just need to retry the download, then the problem should be fixed.

How do I update my server?
Just open the SteamCMD and login again, then retry the Step "Downloading the files" it will be checked which files need to be updated.
Server Creation Tool
To automate these steps to setup/upgrade a server, i created a tool, the group can be founde here:
http://steamcommunity.com/groups/ServerTool

The tool itself is hosted on Github, which can be found here:
https://github.com/Zeromix9/ServerTool

I hope, that will help you in the future!

If you like, you are also welcome to leave a small donation.
https://paypal.me/Zeromix
15 Comments
Zeromix  [author] Sep 16, 2022 @ 8:56am 
@shootergpope What´s so confusing for you?
Crackly Sep 15, 2022 @ 11:41am 
confusing
Noe Aug 19, 2017 @ 2:23pm 
Das war eine antwort for Epik.
Ich weis nicht genau worüber du redest....
Sorry xD
Zeromix  [author] Aug 19, 2017 @ 1:01pm 
@NOE - Ich gehe davon aus, dass Dateierweiterungen eingeblendet werden.
Noe Aug 19, 2017 @ 12:44pm 
New > Text Document > Rename:[Filename].txt to [Filename].bat
Zeromix  [author] May 9, 2017 @ 1:27pm 
You need to create the server folder with the command, it will be downloaded in your named folder. And about the batch: Just create an txt and change the file extension.
Epik Berm May 9, 2017 @ 1:19pm 
Also i can't find the server folder
Epik Berm May 9, 2017 @ 1:19pm 
uh.. how do i make a .bat file?
dankmemebunny Nov 29, 2016 @ 9:41am 
Thank you
Zeromix  [author] Nov 29, 2016 @ 12:36am 
For a dedicated server u need to forward ports, yes.