Garry's Mod

Garry's Mod

146 ratings
Making a Garry's Mod Server
By Dalta
This Guide will show you step-by-step on how to make your very own Garry's Mod server! It will explain how to get your server files, changing the gamemode, and how to port forward it easily to play online! Make sure to take your time and not rush through it as that could result in mistakes. Any and all questions I would be happy to answer!
   
Award
Favorite
Favorited
Unfavorite
Introduction
I will walk you through with making your own server either on a LAN with your family or online with your friends. This may seem like a very long and hard process, but if you take your time and and understand the guide then it will prove a lot easier! So without further ado, let's get started!
Getting in SteamCMD
Now the first and most important thing to do is to make a new folder in your C: drive.











If you were wondering, this will be your whole server folder. Go ahead and name it whatever you like. It does not matter what it is called, but I recommend keeping it short for later purposes.
----------
I hope your weren't thinking you wouldn't have to download any kind of software because you do. You will need SteamCMD to retrieve your server files for your server.

You will want to go to the SteamCMD page. For your efficiency, here is the webpage for the program: https://developer.valvesoftware.com/wiki/SteamCMD

You will need to download the version that fits your computer type. For example, mine is windows so I will download the windows version.






---------
How go ahead and open SteamCMD within its folder. Once opened it will start updating. This is normal. Once you see "Steam>" then you may start typing your commands into the console.

The first command that you will want to type is "login anonymous". You will always need to do this to type most commands in.





There has been instances where loging in anonymously doesn't work. In this case, you will want to repeat the process and see if it works. If not, then log in with your username. For example, I would type "login DaltaChaos".
--------
Now you are in the console and can now start retrieving your server files!
Retrieving your Server Files
Now that were in the system, we can start downloading our server! Just a little heads up, this is the longest process in the whole guide so be prepared!
--------
Now let's point out where we want our server files downloaded. The best place for them is in our folder we created earlier. To do this, type in this command:
force_install_dir C:\(name of your folder)



Make sure you replace "(name of your folder)" with your own folder name. Now we will get the server files. For this we will type this command:
app_update 4020


Now the files will start downloading for the server. NOTICE: This process is known to take up to an hour as far as I now. You may just leave it running and do something while it finishes.
--------
Once this process is finally over, you will need to validate it. To do this type in this command:
app_update 4020 validate



What this process does is that it makes sure that all your files are up-to-date. This isn't as long as the first process but it will take around five minutes.
--------
After that is finished you are done getting your server files! Go ahead and close out of SteamCMD and go to your folder and notice your new server.
Editing your Server Settings
Now we will edit the settings on your server so that it will run properly.
--------
First go into your server folder. Now make a new text document. It needs to be called "start.bat". Make sure it's exactly like that.






Now right-click on that file and click "edit". You may use either Notepad or Notepad++ as it does not matter what you use. Once opened, select this code and paste it in the file.

@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 cstrike +map de_dust +maxplayers 16
echo (%time%) WARNING: srcds closed or crashed, restarting.
goto srcds

Make sure you don't add any extra letters or numbers in as it may disrupt the code. Now find the part where its says "-game cstrike". You will want to change that to "-game garrysmod".

Right after that it says "+map de_dust". You may change the map to whatever you will like. For example, it can be "+map gm_construct".

The max players can stay as it is unless you want to change it. If so, just change the number to what you want.






--------
Now you can exit that file. Make sure you save! Now we need to name your server and give it a password. So go to your cfg folder in your server (name of your folder/garrysmod/cfg) and open server.cfg in a notepad.

Next type down: hostname "your server". You may use any name you wish instead of your server.

On the next line, type down: rcon_password "your password". You may use any password you want for this as well. This is the admin password.

On the next line is the player password. This is optional, as it's used for people wanting a private server. For this, type down: sv_password "your password". Again, you may change the password to what you like.

The last line is where the gamemode will be listed. For this, you want to type down:
gamemode "your gamemode". Make sure you change the "your gamemode" to an actual gamemode or it will be thought to be Sandbox.











Now you may exit that file. Saving of course.
--------
After all of that, go ahead and launch your server. When opened you will see a menu.




















Now change the setting to what you set them as in the other files. For instance, "Game" will be Garry's Mod. "Server Name" will be the exact name of what you typed down. "Map" will be the map you chose in the start.bat file. "Max Players" can be changed to whatever you like even on that menu. Leave the port alone or it will not work properly. And finally "RCON Password" will be what you chose in the server.cfg file.

Once you've done that click "Start Server" and wait for it to load.
--------
Now when you go to your Garry's Mod multiplayer, you may notice it only appears in the "Local Network" tab. If so, then you need to port forward!
Changing Gamemodes
If your bored of Sandbox and want to change to maybe TTT or prop hunt then here's is how to do it!
--------
First of all you must have the gamemode in your gamemodes folder within your server folder (name of your folder/garrysmod/gamemodes). We will use TTT as the example since it comes with Garry's Mod and doesn't require any downloads.
--------
Head to the server.cfg and open it. If it isn't already, make the gamemode "terrortown". It should look like this: gamemode "terrortown".









Now you can save and exit and in the same folder. Open "autoexec.cfg" in a notepad (it should be at the top). Now just add a line listing: gamemode "terrortown".








--------
And now your server will run Trouble in Terrorist Town instead of Sandbox.
Port Forwarding
If all you wanted to do was play with friends or family at your house then you are done! But if you are playing with a friend out of your wifi reach then you need to port forward. Everyone believes port forwarding is a real pain but it isn't at all. Just don't panic and stick to the goal!
--------
First, hit the Windows key and the "R" key at the same time.










Type in "cmd" in the Run window. Then type in the console "ipconfig". Once you push enter a lot of information will pop up.

















You are only looking for the "Default Gateway" and the "IPv4 Address". Instead of trying to remember them, make a few new text documents on the desktop and name them the codes.















Now copy your "Default Gateway" and paste it in your web browser and hit enter. It will take you to your web provider. I use CenturyLink. Now explore your web provider until you find the port forwarding section. When you locate it, you will need to put in the required setting for Garry's Mod. Keep in mind you will make three separate connections.








You will need to fill in the settings as shown in the picture. If you don't understand then I will go through them one-by-one.

The IP and Protocol will be the same for all three. The IP will be your "IPv4 Address" and the Protocol will be "TCP/UDP". Now we need to enter the ports.

Here are the ports for the first one:

Starting Port: 3478
Ending Port: 3478

This is the ports for the second one:

Starting Port: 4379
Ending Port: 4380

And lastly the ports for the third one:

Starting Port: 27000
Ending Port: 27050
--------
And when you've made all three connections you are finally done! You can test if you've done it right by looking at the "Internet" tab in Garry's Mod multiplayer and search your server name and it's there. If you don't see it make sure you refresh the page before going to see what you did wrong.
Summary
If you've done all the steps right and it works properly, then give yourself a pat on the back. Because I know this process is really really hard. You should've seen me doing it for the first time. It was sad to be honest. But now I know exactly what I'm doing when making a server. So here is a huge CONGRATULATIONS!!! I'm proud of you! :)
--------
However, if you didn't get it to work then feel free to ask me any questions. I would be happy to help anyone thats needs it. That's what I'm here for! :D
-------
Good Luck on your server!
190 Comments
John Feb 2, 2020 @ 11:51am 
aw
Dalta  [author] Feb 2, 2020 @ 11:49am 
To all future viewers of this thread, it was created many years ago. Therefore, some steps in the server setup procedure may have changed or not work at all. Please seek out a yt tutorial video that is more updated (and probably easier to follow and complete). Thank you!
John Jan 21, 2020 @ 12:43pm 
i dont see a cfg folder in my new folder
KingOfAnons Jun 20, 2018 @ 8:25am 
I can only see my Server in the Old Browser and in the Server list on Steam
Water Jan 18, 2018 @ 2:00pm 
its still featured here xd on the displays
Presumptuous Spacemans Oct 1, 2017 @ 7:50pm 
how do i add addons?
Lou Aug 16, 2017 @ 1:04am 
Ok, stuck in a part, Where do I put the port fowarding ? I cant find the "reuired setting"
Dalta  [author] Jul 23, 2017 @ 1:23pm 
@Maxpowerammo, thanks for doing my job for me. XD
Maxpowerammo Apr 19, 2017 @ 7:52pm 
@GreenConditions
Open your txt file. Click on file -> save as -> type .bat at the end here.
Dalta  [author] Feb 26, 2017 @ 4:52pm 
@Feminist_Vegan, If you can't see the map then you either don't have the map file in the maps folder or the map your trying to use just doesn't work.