Garry's Mod

Garry's Mod

144 ratings
Making a gmod server for dummies Windows (OSX Version in description)
By 0rdinal
THIS GUIDE IS NO LONGER SUPPORTED, I WILL NOT BE PROVIDING SUPPORT TO ANYONE WHO ADDS ME ABOUT IT

In this guide you will learn how to:
  • Download the gmod server content
  • Port forward the server so people can join
  • Install addons without having to manually install them.
  • Update and configure your server.

OSX Version 1.0


   
Award
Favorite
Favorited
Unfavorite
Downloading server content.
SteamCMD
This part of the tutorial is actually copied off https://developer.valvesoftware.com/wiki/SteamCMD
First, you need a program called SteamCMD. The Steam Console Client or SteamCMD is a command-line version of the Steam client. Its primary use is to install and update various dedicated servers available on Steam using a command-line interface. It works with games that use the SteamPipe content system. All games have been migrated from the deprecated HLDSUpdateTool to SteamCMD. Download SteamCMD at https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip or, just go here https://developer.valvesoftware.com/wiki/SteamCMD#Downloading_SteamCMD

Next, you create a folder called:
C:\SteamCMD

Unzip the contents of the downloaded folder into this file:


Now press Win + R and type cmd, a command prompt panel will open, type this:
cd C:\steamcmd
then type:
steamcmd
Things will start to download, once they finish type:
login anonymous
then type:
force_install_dir .\my_garrysmod_server\
Now you have to download the garrysmod server files:
app_update 4020
then:
app_update 4020 validate
now type:
quit
start.bat
Congratulations, you have downloaded the server content, now for some difficult stuff.
Goto C:\my_garrysmod_server and create a new notepad called start
Paste this code into the notepad:
@echo off cls echo Protecting srcds from crashes... echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter. title srcds.com Watchdog :srcds echo (%time%) srcds started. start /wait srcds.exe -console -game garrysmod +map gm_flatgrass +maxplayers 16 +gamemode sandbox echo (%time%) WARNING: srcds closed or crashed, restarting. goto srcds

THIS IS VERY IMPORTANT, CLICK SAVE AS, AND CALL IT start.bat


Port Forwarding
All internet hubs are different, this is on my virgin media super hub
Press Win + R and type cmd. In cmd type
ipconfig
You need 2 things, your IPv4 Address, and your default gateway, make a note of them
I have hidden the final didgit but it will be there

Type your default gateway into your web browser and login (most hubs will still have their default logins, you can find a list HERE[www.urtech.ca].
If your hub is not on this list, Your login might be on the back of the router

As I said, all hubs are different, but try and find the 'port forwarding' tab

Now, name this port garrysmod and set all ports to 27015, set the protocoal to TCP&UDP and set the IP Address to your IPv4 address, make sure it is enabled and click apply/save





Start up your server with run.bat and people can start joining your, addon-less, vanilla server. Time for some MINT, or CHOCOLATE... whatever floats your boat... I mean sundae.

To connect to your server, go onto Garrys Mod, click on multiplayer, and click on local network, If your friend wants to join, either invite them or they will have to find it by searching through the lists of servers in the server browser
Addons
This bit is quite hard, but once done is so much easier than actually manually installing all the addons.

First, create a collection of all the addons you want on your server.
Do this by subscribing to the things you want in your collection, then click HERE and create a collection with all those things you want in them.

Once published, look at the URL at the top e.g: http://steamproxy.com/sharedfiles/filedetails/?id=67067**** copy the bit in bold ( I have taken away the final 4 letters.) If you did this on the steam client, then go online to: http://steamproxy.com/id/YOURNAME/myworkshopfiles/?section=collections and click on your collection. Keep this number safe as you will need it later.

Now, go to http://steamproxy.com/dev/apikey and login, set steamidfinder.com as the API domain name. You should get a key. Keeps that safe like the other number as It will be needed later:

Now, earlier, we created a start.bat file, right click and open it with notepad, on line 8, add this

+host_workshop_collection 67067**** -authkey 441FE478FC8768****************** (Obviously with your own code

@echo off cls echo Protecting srcds from crashes... echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter. title srcds.com Watchdog :srcds echo (%time%) srcds started. start /wait srcds.exe -console -game garrysmod +map gm_flatgrass +maxplayers 16 +host_workshop_collection 67067**** -authkey 441FE478FC8768****************** echo (%time%) WARNING: srcds closed or crashed, restarting. goto srcds

It should look something like this.





Now everything in that collection will be put on your server. Just restart the server. and It will install

You now have a working server, join my steam group and friend me on steam if you have any questions?
Configure your server(optional)
Once you have done all that, you will want a server name, rcon password etc. It is the most simple part of this guide.

Click HERE[csite.io] set your settings as you want.
Make sure sv_password is empty (unless you want a private server)

Once it generates the code, just copy ans paste it into:

C:\my-garrysmod-server\garrysmod\cfg\server.txt

Restart your server
Update your server
Updating is very simple. Open up SteamCMD and type:

login anonymous

then:

force_install_dir C:\my_garrysmod_server

then:

app_update 4020

then type:

app_update 4020 validate

You will need to update your server everytime gmod updates, otherwise, people will not be able to join.
Source code
launch.bat (Compiled as an exe)
@ECHO OFF :str cls echo ========================= echo GenTec Software Installer echo ========================= echo File: steamcmd.exe (Garrysmod) echo Author: Valve, Facepunch echo Wifi: Internet must be enabled echo Details: Will install Garrys Mod server files echo ========================= set/p pass=Begin with installation? (Y/N): if %pass%==y goto run if %pass%==Y goto run if %pass%==n goto end if %pass%==N goto end cls echo Invalid choice, please re-enter. pause goto str :run Start install.exe goto end :end
install.bat (Compiled as an exe)
@ECHO OFF cd /D C:\ md SteamCMD powershell -command "$clnt = new-object System.Net.WebClient; $clnt.DownloadFile(/"https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip", \"C:\SteamCMD\")>nul powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('C:\SteamCMD\steamcmd.zip', 'C:\SteamCMD'); }">nul cd C:\SteamCMD\ echo login anonymous>garrysmod.txt echo force_install_dir .\my_garrysmod_server\>>garrysmod.txt echo app_update 4020>>garrysmod.txt echo app_update 4020 validate>>garrysmod.txt echo quit>>garrysmod.txt msg * SteamCMD is now installing Garrys Mod, another popup will appear once it is finished. C:\SteamCMD\SteamCMD.exe +runscript garrysmod.txt msg * Installation has finished! start launchbat.exe
Last part is so long it wont fit in the guide, so here is a pastebin of it
https://pastebin.com/uDEMrsTW
Changelog
15th April 2019
  • Reached 11000 unique visitors
  • Archived guide. (Too many people adding me, it was so long ago that I have mostly forgotten how to do it anymore, sorry.)


29th September 2018
  • Reached 10000 unique visitors

24th June 2018
  • Reached 9000 unique visitors
  • Removed server auto installer (I can't host it anymore, im too poor.)

30th June 2017
  • Finished server auto-installer.

19th January 2017
  • Reached 8000 unique visitors.

16th January 2017
  • Continuing server support.
  • Adding an auto server creator.

7th May 2016


6th May 2016
  • Fixed SteamCMD link
  • Started creating pre-made server files.
  • Added Configure Server(optional) section.
  • Added Update Server section.
  • Added Warning note on pre-made server section.
  • reached 6000 Unique visitors.
  • Created OSX Version 1.0 Guide

5th May 2016
  • reached 5000 unique visitors.
  • spell checked


25th April 2016
  • Guide created
117 Comments
0rdinal  [author] 15 Apr, 2019 @ 9:58am 
Archived guide. (Too many people adding me, it was so long ago that I have mostly forgotten how to do it anymore, sorry.) I will not be responding to any more help requests. It's been three years and too many people add me about it.

If anyone wants to contribute and become a contributor, I am open to that.

RIP gmod
Krun 5 Feb, 2019 @ 3:44am 
And how to manually install addons? Some addons might need configuration , so it's better to have them in-files for updating (Such as reducing weapon damage , updating certain jobs for DarkRP)....
Bea (she/her) 12 Jan, 2019 @ 6:55am 
nvm is because i didnt do app_update 4020
Bea (she/her) 12 Jan, 2019 @ 6:51am 
it dont work it says Error! App '4020' state is 0x402 after update job. pls tell me new game startcode
0rdinal  [author] 29 Sep, 2018 @ 1:39pm 
np :). Although this was a late reply
new guy in town 29 Sep, 2018 @ 8:13am 
I redid the process and it worked, not sure where the problem was but thanks for the help and quick replies.
0rdinal  [author] 29 Sep, 2018 @ 6:48am 
Open cmd and type: ipconfig, you are looking for this:

IPv4 Address. . . . . . . . . . . : 192.168.....
new guy in town 29 Sep, 2018 @ 6:19am 
Thats what i had it all set to unfortunately. I can only assume its the IP im putting in but i dont know what else i would be putting there.
0rdinal  [author] 29 Sep, 2018 @ 6:11am 
Log in to the web interface, click Advanced Settings > Port Forwarding. Click Add new port forwarding rule +. Make sure it is Enabled and the IP address the the ip of where you are hosting the server, set the port start and end to 27015 and the protocol to TCP/UDP (Or any)
new guy in town 29 Sep, 2018 @ 6:08am 
I have a linksys WRT 32x