Server Hosting Guide

Maybe this will help. We don’t need 10 different threads about people asking how to get a server.

[release]TOC
I - I want a server!
II - Dedicated Server install guide
III - Setting up sv_downloadurl
IV - Administration
V - Common problems
VI - Further info
[/release]

I want a server!

Great! Running a server contributes to the community, and gives you a server to your rules. You have some options:

[ul]
[li]Run it at home – If you have the hardware and the internet connection this is a good choice[/li][li]Buy a game server – Best option for new owners. Most hosts comes with web control panel, some even include a voice server.[/li][li]Buy a Dedicated Server/Collocate – Advanced option, buy a server and set it up yourself. If this is what you’re planning on doing you shouldn’t need this guide.[/li][/ul]

I’ll run it at home

Cool. There are a bunch of guides and tools for doing this, and if you’re planning to run a CSS or TF2 server the process is nearly the same.
[ul]
[li]Slayers Dedicated Server Installer - Bunch of batch scripts to install and run the server. Very Simple.[/li][li]Source Dedicated Server Guide – VERY in depth guide on server installation, administration, and theory. I know it’s written for a CSS server but a lot of it still applies.[/li][li]Dedicated Server Setup - Great buide on the gmod wiki about server setup[/li][li]http://portforward.com/ - Website for forwarding ports on your router, select your router then Half Life 2 Steam Server.[/li][li]SrcCon My tool for setting up servers (Not exactly done but none the less =])[/li][/ul]
Some things to keep in mind are that you NEED to forward ports when behind a router. Also you will need to download a lot of content to the server (My install takes up 5+ GB), and if you have a shit connection that’s not able to handle that, forget about running the server. Check out some theoretical numbers for this here.
Your IP address for the server is NOT 192.168.. or 10...*, use this site to find it.

I’ll buy a game server

Also a good option my friend! Buying a game server means better reliability, but at the cost of the loss of some customization. A good server host should have:
[ul]
[li]A Self-service method for installing addons (FTP, control panel, etc.)[/li][li]A server control panel (i.e. TCAdmin)[/li][li]Obvious and professional support location[/li][li]A good reputation[/li][/ul]
Our wiki has a nice list of server hosts (list here) but I personally recommend both GmodHosting.com and Xenon Servers.

I’ll buy dedicated server/collocate

Are you still reading this?

Dedicated server install guide

See post below

Setting up sv_downloadurl

A guide for this can be found on the wiki: http://wiki.garrysmod.com/?title=Dedicated_Server_Setup#sv_downloadurl

Administration

When administrating a server it’s important to keep in mind the users of the server. A server is only successful if your users are happy. Try not to be god and don’t let minges do what they want.

At one point or another you’ll need to pick administrators to assist in doing this job while you can’t. Don’t just give the positions to your friends, there’s no guarantee that they will do a good job. Find good users who have good manners, and know what they are doing, they will make good admins.

Common Problems and questions

Some common problems I’ve been seeing

Server uses different class tables/Invalid SteamID
Update your server. If you’re using Slayers tool run the scripts for each game you have.

How do I install addons?
Go to the orangebox\garrysmod folder, and install them like you would on your own gmod.

How do I install other games for my server?
See this section on the wiki: http://wiki.garrysmod.com/?title=Dedicated_Server_Setup#Extra_content

Further info

[ul]
[li]Server Administration (GmodWiki)[/li][li]Server Hosting (GmodWiki)[/li][li]Srcds.com Forums[/li][li]Server Hosting forum (But I think you’ve found it already :^))[/li][/ul]

Did I miss anything?


WIP

Let’s start with some quick FAQ:

Q: Why a dedicated server?
A: A dedicated gives you a bit more flexibility as far as server hosting goes. It’s the standard for professional hosting companies, and can take better advantage of resources than a listen server

Q: Sounds difficult, is it?
A: The first time around it is, but after awhile you will become use to it.

Q: Why not use the one included with steam?
A: That requires steam loading up GCFs, somewhat slower performance

Okay what do I need?
Have a look at the requirements on this guide too see if you meet them. Use http://speedtest.net/ to check your bandwidth

Meet them? Cool, you’ll need a few things:
[ul]
[li]HLDS Update Tool (Used to download and update the server)
[/li][li]Something else?
[/li][/ul]

Downloading
There are install tools such as Slayers Installer, but making the scripts yourself is usally the better choice, since you’ll know what everything does, and what to do if it breaks. So let’s start by finding a place install the server. If you have a hard drive other than your regular one, using that could give you better performance. For this tutorial I’ll be installing it into E:\srcds. Make sure that it’s an empty folder. Trust me, you don’t want anything else in it.

Let’s run the installer that you downloaded earlier, make sure to set the install path to that folder you chose (Again in my case E:\srcds), chose the right geographic location, and uncheck the readme (You don’t need that =]). Right, so go back to that folder and just run HLDS by double-clicking it, and let it update itself (Run it a few times, make sure that it updates completely).

Let’s make a script that will download and update the content for the server. Open up notepad and put this in:


hldsupdatetool.exe -command update -game garrysmod -dir "%CD%"

Let’s explain what that does. The -command update tells hlds to update the game, -game garrysmod tells hlds that it’s gmod, and -dir “%CD%” tell HLDS where the directory of the server is (%CD% is a system variable). Right so save that in the srcds folder (I’m going to refer to the base folder for our install as the srcds from now on) as update.bat.

Run the batch file. HLDS will now download the needed components for the dedicated server. Note that this can take from about 30 minutes to 3 hours, all depending on your internet connection. So we wait.

Oh and if it closes run the script again, it’ll pick up were it left off. Keep doing this until it doesn’t download anything anymore.

If HLDS closing becomes a problem, replace the update the srcipt with this, it’ll rerun HLDS when and if it closes. To get out of loop type Ctrl-C and then Y and enter.


:start
hldsupdatetool.exe -command update -game garrysmod -dir "%CD%"
goto start

You may also want to install content from other games, to do so add a line to update.bat for the games you would like to add.

Counter-Strike: Source


hldsupdatetool.exe -command update -game "Counter-Strike Source" -dir "%CD%"
xcopy /E /Y "%CD%\cstrike" "%CD%\orangebox\cstrike\" 

Note: The extra copy command is needed.

Day of Defeat: Source


hldsupdatetool.exe -command update -game "dods" -dir "%CD%" 

Half-Life 2: Deathmatch


hldsupdatetool.exe -command update -game "hl2mp" -dir "%CD%" 

Team Fortress 2


hldsupdatetool.exe -command update -game "tf" -dir "%CD%" 

SiN Episodes: Emergence


hldsupdatetool.exe -command update -game "sin" -dir "%CD%" 

The Ship


hldsupdatetool.exe -command update -game "ship" -dir "%CD%" 

Episode 2/Portal
You’ll need to extract files from GCFs to use content for these games, see the wiki about this:

After you’ve added the games you like to the update.bat file, run it again. It will take a very long time if you added a lot of games, so go do something else while you wait.

Running your server for the first time

To make sure that your server is installed correctly, we’re going to run it and confirm that it works. We’re going to create another batch file, this time called run_gmod.bat . Like you did for update.bat, open up notepad and paste this in it:


"%CD%\orangebox\srcds.exe" -console -game garrysmod -maxplayers 5 +hostname "compwhizii guide" -port 27015 +map gm_construct

And save it as run_gmod.bat. Now double click on the newly created batch file, this will run the server. You should see two command prompts open, like this:

http://imgkk.com/i/s3M0uJ.png

The prompt on the top left is for the batch file, while the one on the bottom left is the server console. Confirm that the server is connected but opening up the steam server browser and go to the LAN tab. You should see this:

http://imgkk.com/i/r-F8a4.png

Your server is now running. Let’s close it and continue setting up the server. Go to the server console and exit and hit enter.

http://imgkk.com/i/ECD6wX.png

Let’s start by creating a server configuration file, open up notepad and paste this in:



// Name of the server
hostname "Compwhizii Guide"
// RCON password, make sure this is secure
rcon_password "password"
// If you would like a passworded server set that here, 
// otherwise leave it blank
sv_password ""
// Leave this at zero for a internet server
sv_lan 0
// God mode for players
sbox_godmode 1
// Player vs Player damage
sbox_plpldamage 1
// Noclip enable
sbox_noclip 1

// Sandbox maxes
 sbox_maxprops 100
 sbox_maxragdolls 5
 sbox_maxvehicles 5
 sbox_maxeffects 15
 sbox_maxballoons 25
 sbox_maxnpcs 5
 sbox_maxdynamite 10
 sbox_maxlamps 10
 sbox_maxlights 10
 sbox_maxwheels 50
 sbox_maxthrusters 50
 sbox_maxhoverballs 50
 sbox_maxbuttons 50
 sbox_maxemitters 25
 sbox_maxspawners 10
 sbox_maxturrets 5


WIP

-placeholder-

-placeholder and bump-

-placeholder- also good

-placeholder and bump- maybe I can sell this placeholder one day…

Edit one year later: The value of this placeholder has greatly appreciated, so it is now for sale. BIN: $100.

-Holderbump and place- I this guide is o.k

my server problem is so unique that no one can solve it :v:

[editline]04:03PM[/editline]

Holder of the place

Fuck I don’t need that many placeholders.

You have not set sv_minrate… you should set it to atleat 20k to avoid noitceable lag.

I am having some trouble while downloading it stops around 2% usually, ill leave it for a few hours but it ill just stay there, sometimes it stops a t different times. Any ideas why this is happening?

Always stops at 2%? What happens when you rerun it, it just sticks there again? I don’t know what to tell you, there might be something wrong with your connection.

bump for knowledge

Bump

er, is he going to finish it? I mean it says WIP, but its been 2 weeks since he’s posted and 3 since he’s updated the OP…

I’m really busy with other projects right now, but I’ll try to find time.

oke problem!!!

i did that serverupdate tool thingy already like 3 times

and its still not working! i mean. its not updated

Different class table

how fix?

D:\HLServer\HldsUpdateTool.exe -command update -game garrysmod -dir D:\HLServer

Sometimes it doesn’t like capital letters, try it like this;



D:\HLServer\HldsUpdateTool.exe -command update -game garrysmod -dir d:\HLServer\

If that doesn’t work, install it like this and copy the files out;



D:\HLServer\HldsUpdateTool.exe -command update -game garrysmod -dir .

I have a problem maybe someone here can help like an admin/mod http://www.facepunch.com/showthread.php?t=820372 it is a GetHSteamUser thing, noone is helping me yet.

can anyone help me with this?

EDIT
nevermind i figured it out