Garry's Mod or GMOD is a modification for the first-person shooter Half-life 2. It is a physics sandbox game that allows the player to manipulate objects and experiment with physics, with the realism provided by the Source engine.
The dedicated server component can be run as a Windows Service using FireDaemon Pro. FireDaemon Pro allows you to start the dedicated server automatically at boot prior to login, start multiple instances of the dedicated server and restart your dedicated server should it crash. This HOWTO will show you how to set it up. You can also use FireDaemon Fusion to manage FireDaemon and other Windows services via your web browser.
Garry's Mod Dedicated Server Setup Under FireDaemon ProFirst download and extract SteamCMD.
Now go to the directory where you installed SteamCMD and create a shortcut to "SteamCMD.exe". Next edit the properties of the shortcut and in the target box, at the end of it (with a space before the following), put:
+login anonymous +force_install_dir "C:\GMOD" +app_update 4020 validate +quitThe target box should now look like:
C:\SteamCMD\steamcmd.exe +login anonymous +force_install_dir "C:\GMOD" +app_update 4020 validate +quit
Download the Garry's Mod files now by clicking the shortcut you created and letting it run; it might take a few hours to update everything. You should also run the shortcut every week or so to grab the latest server updates (stop your server first though). GMOD uses one configuration file to store its settings. You can find it in "C:\gmod\garrysmod\cfg\server.cfg". You can also find a sample file at the bottom of this page. Adjust the settings in this file to suit your preferences.
Next start the FireDaemon GUI from the desktop shortcut. Click on the "Create a new service definition" button in the toolbar (or type Ctrl+N) and enter the information into the fields as you see below. Adjust paths to suit your installation. Pay special attention to the Parameters list.
Executable: The path to your srcds.exe file. For the purposes of this HOWTO, the path is C:\gmod\srcds.exe.
Working Directory: The directory containing your srcds.exe file. For the purposes of this HOWTO, the path is C:\gmod.
The most important field on the tab is the Parameters. The Parameters define the initial setup of your server.
Here's the full parameter list you should have:
-console -game garrysmod -secure +map gm_construct -autoupdate +log on +maxplayers 32 -port 27015 +ip 220.127.116.11 +exec server.cfg
- "-console" enables text base server display. The server can only be automatically restarted in text based mode.
- "-game" loads the mod.
- "-secure" enables VAC protection of your server (valve anti cheat). You can remove this command if you do not want to use VAC.
- "+map" loads a specified map on server startup. You can change "gm_construct" to whatever map you want. This command should never be removed.
- "-autoupdate" Enables auto update of the server, valve has not implemented this in Windows so you will have to manually update GMOD yourself. It's simply here for the sake of legacy support if valve ever decides to add it.
- "+log on" Displays the output of information on the screen. You can turn optionally it off (+log off), but keeping it on makes it easier to debug any errors you might encounter.
- "+maxplayers 32" This controls the maximum of amount of players you want your server to run. You can only control the max players on server startup. This command should never be removed.
- "-port 27015" This is the default server port for GMOD. You can change it to anywhere from 27015 to 27020. Changing it is generally used when you host multiple servers (as each server has to use its own port when using the same IP). This command should never be removed.
- "+ip" should be the IP of your computer (not 127.0.0.1, go here to get your IP). This command should never be removed.
- "+exec server.cfg" This simply executes your server.cfg file on server startup. If you run multiple servers from the same installation, you can specify other config files (eg. server2.cfg)
Now click on the Settings tab. If you DON'T want to see your dedicated server running, uncheck the Interact with Desktop check box. You can optionally run GMOD as the user you installed it as. In the Logon Account field type your username (e.g. Administrator) and then enter the user's password twice in the Password and Confirm fields. You can change the Process Priority to allocate more CPU time to the dedicated server or specify which cores the dedicated server will run on.
Now click on the Lifecycle tab. Uncheck Graceful Shutdown as GMOD doesn't respond to it.
Now click on the Install button to install and start GMOD! If you are running Windows Vista or later your server will start on Session 0. You will need to switch desktops to see your server running. Further information about hosting Garry's Mod as a dedicated server on Linux and OS-X can be found here.
Example server.cfg file
The attachment at the bottom of this page contains a sample server.cfg file. Modify this file to suit your preferences. Be sure to rename the file or adjust your parameters accordingly.