Your server here Bid in the weekly auction Promote server
56 lines 5.4 KiB Markdown Source Rendered Raw Permalink History
---
title: "How to Set Up HLTV on Linux for CS 1.6"
excerpt: "Set up Valve's HLTV spectator proxy on Linux to relay and record whole matches, with the right delay, rate, and port settings."
category: "installation"
tags: "hltv, linux"
image: ""
read_time: "8 min read"
---
<p>HLTV is Valve's spectator proxy &mdash; the <code>hltv</code> binary that ships alongside the dedicated server tools. It connects to your game server as a special spectator client, buffers the match with a configurable delay, relays it to viewers on its own proxy port, and records the whole thing to a demo. On Linux it runs as a separate process from HLDS, so you set it up much like a second server. This guide covers a headless Linux install.</p>
<h2>1. Locate the hltv binary</h2>
<p>HLTV is bundled with the HLDS install you already have. If you followed the <a href="/tutorials/install-cs16-dedicated-server-linux-steamcmd">SteamCMD dedicated-server guide</a>, the binary sits in the root of the install next to <code>hlds_run</code>:</p>
<pre>cd ~/hlds
ls -l hltv hltv_run</pre>
<p><code>hltv</code> is the engine binary; <code>hltv_run</code> is the wrapper that restarts it if it crashes, mirroring how <code>hlds_run</code> wraps <code>hlds_linux</code>. If they are missing, re-run the SteamCMD <code>app_update 90</code> &mdash; HLTV is part of app 90, not a separate download.</p>
<h2>2. Understand the two ports</h2>
<p>HLTV uses two endpoints. It <em>connects out</em> to your game server on its normal port (27015), and it <em>listens</em> on its own proxy port &mdash; default UDP <code>27020</code> &mdash; where spectators connect to watch. Those spectators never touch the game server directly; they only ever see the delayed HLTV feed. Keep 27020 open in your firewall if you want external viewers.</p>
<h2>3. Launch HLTV and reach its console</h2>
<p>Start it with the wrapper. Because it is interactive, run it inside <code>screen</code> or <code>tmux</code> so you can detach:</p>
<pre>screen -S hltv
./hltv_run</pre>
<p>You are dropped into the HLTV console, a stripped-down server console. Everything below is typed here. Detach the screen with <code>Ctrl-A</code> then <code>D</code> and it keeps running.</p>
<h2>4. Connect to your server</h2>
<p>From the HLTV console, name the proxy and connect to the running game server:</p>
<pre>name "CSB TV"
connect 127.0.0.1:27015</pre>
<p>If the game server is on the same box use <code>127.0.0.1</code>; otherwise use its LAN or public address. Once connected, HLTV occupies one spectator slot on the game server and begins relaying. Type <code>status</code> to confirm it is receiving.</p>
<h2>5. Set delay, rate and slots</h2>
<p>The three cvars that matter are the broadcast delay, the bandwidth cap, and the viewer limit:</p>
<pre>delay 30
maxrate 10000
maxclients 32</pre>
<p><code>delay</code> is the number of seconds HLTV holds the feed before showing it &mdash; 30 to 90 is normal, and it is what stops spectators ghosting live positions to players. <code>maxrate</code> caps per-viewer bandwidth. <code>maxclients</code> is how many spectators the proxy accepts.</p>
<h2>6. Persist settings in hltv.cfg</h2>
<p>HLTV executes <code>hltv.cfg</code> from the install root at startup, exactly like <code>server.cfg</code> for the game server:</p>
<pre>// hltv.cfg
name "CSB TV"
delay 30
maxrate 10000
maxclients 32
serverport 27020
rcon_password "changeme"</pre>
<p>Reload it live with <code>exec hltv.cfg</code>, then connect by hand as in step 4.</p>
<h2>7. Record a demo</h2>
<p>Because HLTV sees every player, its demo is the closest thing CS 1.6 has to a whole-match server recording:</p>
<pre>record match_2026_07_15
stop</pre>
<p>The <code>.dem</code> lands in the HLTV directory and plays back in a normal client with <code>viewdemo</code>. To automate this per map, the <a href="/plugins/csb-hltv-autorecord">CSB HLTV Autorecord</a> plugin starts and names a recording at the start of every map so you never forget to hit <code>record</code>.</p>
<h2>Troubleshooting</h2>
<ul>
<li><strong>"Couldn't get info from server" / connect times out</strong> &mdash; the game server has <code>sv_lan 1</code>, a password, or is unreachable. HLTV connects like any client and obeys the same rules; set <code>sv_lan 0</code> or give HLTV the password with <code>password xxx</code> before <code>connect</code>.</li>
<li><strong>Server rejects HLTV: no free slots</strong> &mdash; HLTV needs a spectator slot on the game server. Raise <code>maxplayers</code> there, or set <code>sv_proxies 1</code> so the server allows a proxy to attach.</li>
<li><strong>Viewers cannot connect to 27020</strong> &mdash; the proxy port is firewalled. Open UDP 27020, and confirm <code>serverport</code> in <code>hltv.cfg</code> matches what you told viewers.</li>
<li><strong>Spectators can call live positions</strong> &mdash; <code>delay</code> is 0 or too low. Raise it to 30 or more so the feed lags real time.</li>
</ul>
<h2>Verification</h2>
<p>With HLTV connected, run <code>status</code> in its console and confirm it lists the game server and a growing set of players. From a client, open the console and <code>connect &lt;hltv-ip&gt;:27020</code> &mdash; you should join as a spectator and see play lagged by your <code>delay</code>. Record a short demo, <code>stop</code>, and confirm the <code>.dem</code> exists in the HLTV folder and opens with <code>viewdemo</code>. Once that round-trip works, detach the <code>screen</code> and HLTV keeps relaying and recording unattended.</p>