idlethreat

stupid is durable

How To Set Up Your Own Left 4 Dead Server in Linux

without comments

While I adore the zombie horror game Left 4 Dead, the online co-op play seems to be hit-and-miss at the moment. Depending on which server you auto-connect to, you end up with something laggy, or completely inappropriate to your level of play.

So, since I happen to have my own dedicated system I decided to give a try at running my own dedicated server instead. Since I couldn't locate one place that had all of this information, I decided to write up my own document to show you how to install and setup your very own Left 4 Dead Dedicated Server.

Setup

My server setup is pretty anemic at this time. However, this is all for testing at the moment until I get better hardware in place:

* 512 MB ram
* Dual P3 500 Mhz CPU's
* Lots of disk space for the game files

From what I see, I'd recommend a fast dual processor CPU with a minimum of 2GB memory to run the server. You can also run multiple instances of the server, so you can serve lots of groups all at once.

Installing Steam on Linux

The first thing you need to do to have a L4D Dedicated server is to download Steam for Linux. the installer is located over at http://storefront.steampowered.com/download/hldsupdatetool.bin. Use wget on the Linux system to download this file.

I will assume that we will be creating a /opt/steam directory for everything. If you don't have one, go ahead and make it now and download the hldsupdatetool.bin application to there.

Once downloaded, chmod +x the file to make it executable, and then run it. You will have to agree to the license. Once you agree, it will create a readme file as well as an executable named steam. We will be using that in the next step.

Running Steam in Linux

Now, the next step will be to create a new directory where all of our Left 4 Dead files to live in. Create a /opt/steam/l4d directory on your system and then run the following:


root@london:/opt/steam# ./steam
Checking bootstrapper version ...
Getting version 34 of Steam HLDS Update Tool
Downloading. . . . . . . . . . .
Steam Linux Client updated, please retry the command

Once the update is complete, we will be installing the L4D game by using the following command:


./steam -command update -game left4dead -dir /opt/steam/l4d
root@london:/opt/steam# ./steam -command update -game left4dead -dir /opt/steam/l4d
Checking bootstrapper version ...
Updating Installation
Checking/Installing 'Left 4 Dead binaries' version 6
Checking/Installing 'Left 4 Dead base' version 7
Checking/Installing 'left4dead linux dedicated server' version 3
...

It will take about 5-10 minutes (depending on a lot of variables here) for all the files to download and get installed into the /opt/steam/l4d/l4d directory. Once you get that installed, it's time for the next step, configuring it.

Configuring L4D Dedicated Server

there's a bunch of configuration files in the /opt/steam/l4d/l4d/left4dead/cfg directory, so I will give you highlights on how I configured my own server.

infected.cfg

Since I wanted just a pure co-op game without any users playing infected, I set this file like so:

director_no_human_zombies 1

singleplayer.cfg

Unsure if this means anything, but I ended up configuring the singleplayer.cfg to limit to 4 players (that's the 'maxplayers' bit).


wait
wait
exec infected_off.cfg
sv_lan 1
setmaster enable
maxplayers 4
progress_enable
num_ai_survivors 3
director_solo_mode 0
director_min_start_players 1

sv_pausable 0

twoplayers.cfg

Same here, but I configured the minimum number of starting players at 1 (that's the 'director_min_start_players' bit)

wait
wait
exec infected_off.cfg
sv_lan 1
setmaster enable
maxplayers 4
progress_enable
num_ai_survivors 2
director_solo_mode 0
director_min_start_players 1

sv_pausable 0

server.cfg

A lot of these items I got from here. You may check out the variables and tweak them to your liking.

hostname "*My server banner here*"
rcon_password "*I put in a server password here*"
sv_lan 0
mp_disable_autokick 1
sv_cheats 0
sv_clearhinthistory 0
sv_consistency 1
sv_pausable 0
sv_search_key ""

sv_allow_lobby_connect_only 0

Running From Command Line

Finally, after all the configuration has been completed, I run the following from the command line to kick off the server:

cd /opt/steam/l4d/l4d
./srcds_run -console -game left4dead -maxplayers 4 -autoupdate +map l4d_hospital01_apartment +ip *my server's public IP address* -port 27015 -nohltv +sv_lan 0

give it a few minutes to start up and keep an eye on the console for any error messages. Since this configuration worked “out of the box” for me, I'm unsure at what sort of errors that you might get. Use Google if you run across something.

Connecting to Your Dedicated Server

After start up is complete, bring up your Left 4 Dead client, open a console. Now, enter the following:

connect *your dedicated server IP address here*

Hit enter and you should connect to your new Linux Left 4 Dead Dedicated Server.

Other Links

Here's some other places you may be interested in checking out for information on running your own L4D server:

I hope you enjoy and have a lot of fun with it. On Steam, my user name is idlethreat. Stop by and say hi sometime.

Cheers,

tom

Written by admin

January 3rd, 2009 at 11:22 pm

Posted in Muddling About

Leave a Reply