Promotiraj s'rv'r
105 lines 5.8 KiB Markdown Source Rendered Raw Permalink History
---
title: "server.cfg for CS 1.6: A Complete, Commented Example"
excerpt: "A full, line-by-line server.cfg for CS 1.6 covering identity, rates, gameplay, logging and downloads — with an explanation of when it actually executes."
category: "installation"
tags: "server.cfg, config"
image: ""
read_time: "8 min read"
---
<p><code>server.cfg</code> is where a CS 1.6 server's personality lives: its name, its rules, its network rates, its logging. The engine executes it automatically at startup and again on every map change, which is both convenient and a trap — anything you want applied once (like <code>maxplayers</code>) does not belong here. This is a complete, commented file you can adapt, with an explanation of what each block does and why.</p>

<h2>When server.cfg runs</h2>
<p>The engine auto-executes <code>cstrike/server.cfg</code> after it loads a map. So it runs at boot and at every map change. That means:</p>
<ul>
<li>Gameplay and rate cvars belong here — they should re-apply each map.</li>
<li><code>maxplayers</code> does <strong>not</strong> — it is a launch-time value; set it with <a href="/tutorials/hlds-command-line-parameters"><code>+maxplayers</code> on the command line</a>.</li>
<li>If a setting "resets every map change", it is because your <code>server.cfg</code> re-applies an old value over your live edit. Change the file, not just the live cvar.</li>
</ul>

<h2>The file</h2>
<p>Create <code>/home/steam/hlds/cstrike/server.cfg</code>:</p>
<pre>// ---- Identity ----
hostname "My CS 1.6 Server | example.com"
sv_contact "[email protected]"

// ---- Passwords / access ----
rcon_password "use-a-long-random-string-here"
sv_password ""                 // set to make the server private
sv_rcon_banpenalty 15          // minutes banned after too many bad rcon tries
sv_rcon_maxfailures 5          // wrong rcon attempts before a temp ban

// ---- Master list / network mode ----
sv_lan 0                       // 0 = appear on the internet list. MANDATORY for public.
sv_region 255                  // 255 = world; or a numeric region code

// ---- Network rates ----
sv_maxrate 25000
sv_minrate 15000
sv_maxupdaterate 101
sv_minupdaterate 30
sv_maxcmdrate 101
sv_mincmdrate 30
sv_timeout 60

// ---- Gameplay ----
mp_timelimit 30                // minutes per map
mp_maxrounds 0                 // 0 = use timelimit instead of round count
mp_freezetime 3
mp_roundtime 3
mp_startmoney 800
mp_buytime 0.25                // minutes (0.25 = 15 seconds)
mp_c4timer 35
mp_friendlyfire 0
mp_autoteambalance 1
mp_limitteams 2
mp_autokick 0                  // 0 = do not auto-kick idlers/TKers
mp_flashlight 1
mp_footsteps 1
mp_tkpunish 0

// ---- Voice ----
sv_voiceenable 1
sv_alltalk 0                   // 0 = teams cannot hear each other

// ---- Downloads (custom maps/sounds) ----
sv_allowdownload 1
sv_allowupload 1
sv_downloadurl ""              // fast HTTP redirect; leave empty to use slow UDP download

// ---- Logging ----
log on
mp_logmessages 1
mp_logdetail 3                 // log damage + kills (needed by stats plugins)
sv_log_onefile 0
sv_logbans 1
sv_logecho 1

// ---- Execute the map cycle ----
mapcyclefile "mapcycle.txt"</pre>

<h2>The blocks that matter most</h2>
<h3>sv_lan 0</h3>
<p>The single most important line. With <code>sv_lan 1</code> the server never heartbeats the master list and rejects Steam clients with a LAN error. Public servers must have <code>sv_lan 0</code>.</p>
<h3>Rates</h3>
<p>The rate block controls how much bandwidth and how many updates the server allows per client. <code>sv_maxupdaterate 101</code> and <code>sv_maxcmdrate 101</code> are the modern defaults for a good connection; the min values stop a client from starving itself into rubber-banding. Do not set the max absurdly high — it does not add smoothness beyond the engine's real tick rate, it just wastes bandwidth.</p>
<h3>Logging detail</h3>
<p><code>mp_logdetail 3</code> is required if you run a stats plugin — stats parse damage and kill log lines, and at lower detail those lines are not written. If your stats plugin "records nothing", check this first.</p>
<h3>sv_downloadurl</h3>
<p>Leave it empty and clients pull custom maps over the slow in-game UDP channel; point it at an HTTP server hosting your <code>cstrike/</code> files and downloads are far faster. It is worth setting the moment you run custom maps.</p>

<h2>Common errors</h2>
<ul>
<li><strong>Settings do not apply</strong> — the file is named <code>server.cfg.txt</code> (Windows hides the extension), or it is not in <code>cstrike/</code>. It must be <code>cstrike/server.cfg</code> exactly.</li>
<li><strong><code>maxplayers</code> in cfg does nothing</strong> — it is a launch-time parameter. Use <code>+maxplayers</code> on the command line.</li>
<li><strong>Server shows as LAN / not listed</strong> — <code>sv_lan</code> is 1. Set it to 0.</li>
<li><strong>Stats plugin records nothing</strong> — <code>mp_logdetail</code> is too low or <code>log</code> is off. Set <code>log on</code> and <code>mp_logdetail 3</code>.</li>
<li><strong>A value "keeps resetting" each map</strong> — <code>server.cfg</code> re-executes on map change and overwrites your live edit. Change it in the file.</li>
<li><strong>rcon_password in a shared file leaked</strong> — anyone who reads the file has RCON. Keep the file readable only by the <code>steam</code> user.</li>
</ul>

<h2>Verification</h2>
<p>Start the server and, in the console, echo a few values back to confirm the file executed:</p>
<pre>sv_lan
mp_timelimit
sv_maxupdaterate</pre>
<p>Each should return the value you set. Force a map change and re-check — the values should persist because the file re-executes. Once the config is stable, wire the whole thing into a <a href="/tutorials/hlds-systemd-service">systemd service</a> and open the <a href="/tutorials/cs16-server-firewall-ports">right firewall ports</a>, and the server is ready for players.</p>