/noobs&nerds/blog/10-21-2023/

Sven Co-op Dedicated Servers on Linux

A guide for Debian based Distros

Created: 10/21/2023
Updated: 4/5/2024
Tags: Sven Co-op, Debian, Ubuntu

HEY!
Looking to make quick server so you and your friends can play?
Use this guide instead!

This guide contains some pretty technical bits.

Please read all the steps before attempting this guide. This is here to both act as a guide and help teach about some basic info. If you have questions or need help, join the
Official Sven Co-op Discord Server.

And last but not least

This guide was made with my experience as a Sven Co-op Server Host and help from the Sven Co-op Discord Server.

Special thanks to:
Sparks, Adambean, H², SV BOY, and Tunac.

They all helped me figure this stuff out in the past on the discord server mentioned above.


Prerequisites

This guide requires the following:

- A Virtual Private Server with a Debian 12 or Ubuntu 22.04 based Distro.
DO NOT HOST A DEDICATED SERVER ON YOUR LOCAL NETWORK!
There are DDoSers lurking in the Sven Co-op community.

- A basic understanding of ssh and command line interfaces.


Changing sources.list

Debian based Distros need to change their sources.list file. Ubuntu Based Distros should skip to the next step


sudo nano /etc/apt/sources.list                
            

GNU nano is a CLI Text Editor. It comes with most Linux distros.
You can open a blank document with

sudo nano

Paste the following lines of text into the document


deb http://deb.debian.org/debian bookworm main non-free-firmware 
deb http://deb.debian.org/debian bookworm-updates main non-free-firmware 
deb http://deb.debian.org/debian-security bookworm-security main non-free-firmware

Next press ctrl+x, then press y, and then press enter


Setup SteamCMD

Install dependancies and SteamCMD

sudo apt install software-properties-common
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install lib32gcc-s1 steamcmd

SteamCMD should now be installed.

Make a directory for the server


sudo mkdir /svends
sudo chmod 775 /svends
sudo chown yourusername /svends

You can name the directory something else if you want to.

Download and install SCDS with SteamCMD


steamcmd +login anonymous +force_install_dir "/svends" +app_update 276060 validate +exit
    

It will download the server files for a bit, if you get an error at this point try the command again.

Make sure everything installed to the correct directory


cd /svends
ls

If you see files and more directories then it installed to the correct folder

Testing the server

For Intel CPUs use this command


./svends_run -console -port 27015 +maxplayers 4 +log on +map "hl_c01_a1"

If you are using a AMD CPU use this instead


./svends_run -console -binary ./svends_i686 -port 27015 +maxplayers 4 +log on +map "hl_c01_a1"

If you don't get any errors and the server starts then this guide is starting to age and the next Sven Co-op update came out, move on to the next step. If you get a fatal error because of libssl.so.1.1 then make sure to follow the rest of this step.

Install lib32z1


sudo apt install lib32z1

Download libssl1.1 (DO NOT INSTALL THE DEB FILE)
https://packages.debian.org/bullseye/i386/libssl1.1/download

With a archive manager, find and extract libcrypto.so.1.1 and libssl.so.1.1

Place the files in /hlserver or whatever you named your server directory

The issue with libssl.1.1 should now be fixed. If you are still getting errors you should get in contact with people on the Sven Co-op Discord Server. Ask for help in #server-operators.

Managing your server


cd /svends/svencoop
sudo nano banned.cfg

Press enter, then ctrl+x, then y, then enter

You just made a file called banned.cfg, place the steam ids of unwanted troublemakers in this file. You can seperate ids by pressing enter. The ids should look like STEAM_0:0:00000000

Open server.cfg


sudo nano server.cfg

Change the hostname

Under log "on" add this text


sv_downloadurl "http://fastdl.boderman.net/"

sv_cheats 3

This does two things, it added a fastdl server so your map downloads won't be so slow AND enabled cheats for the server owner. If you trust your admins you can use sv_cheats 2 instead, it allows admins to use cheats too.

Add a password if you don't want random players using your server

Press ctrl+x, then press y, and then press enter

Open admins.txt


sudo nano admins.txt

Add your steam id how the file says. If you already have someone you plan on adding as admin, add their steam id too

Press ctrl+x, then press y, and then press enter

You should now be able to use cheats and kick commands. You and your admin can use these to better manage the servers and maybe give confuse players for laughs (pls no abuse) SV BOY's Cheats Guide

Open motd.txt


sudo nano motd.txt

What you put into this files is the message that people will see when they join your server. It's a good idea to put server info, group info, and contact information here.

Customize the file until you are happy with it

Press ctrl+x, then press y, and then press enter

Unless you have cutom maps you want to add already, the server is now setup.

Custom Content

This part requires you to find and download maps you want on your server at http://scmapdb.wikidot.com/

Extract everything you downloaded from scmapdb then place it in all in /svends/svencoop_addon

Now figure out which bsp files are the first maps to the content you want to host

That part is important and we cannot help you on this step. Different maps have different names and a "map" usually consists of multiple maps. To clear up confusion you can call all the maps combined a map pack. What you download from scmapdb is a map pack unless it only has one bsp file in which case thats is just a map.

Open mapcycle.txt


cd /svends/svencoop
sudo nano mapcycle.txt

Add the bsp file names you got earlier but remove the .bsp file at the end.

Press ctrl+x, then press y, and then press enter

Open mapvote.txt

sudo nano mapvote.txt

Repeat what you did for mapcycle.txt but at the start each map place "addvotemap"

You should now be able to vote on the maps you added and the server will cycle through these maps automatically.

Keep the server running

While you could get away with keeping the server running in a terminal window, it's prone to issues. Our prefered method of keeping servers running is GNU Screen.


sudo apt install screen

If you don't want to use Screen, you can use this guide to make a service instead.

Start screen


screen

If you have a screen already running then you should name this one so you can return to it easily.


screen -S svends

Make sure you are in the correct directory


cd /svends

Start the server


./svends_run -console -port 27015 +maxplayers 8 +log on +map "hl_c01_a1"

If you are using a AMD CPU use this instead


./svends_run -console -binary ./svends_i686 -port 27015 +maxplayers 8 +log on +map "hl_c01_a1"

Now when you close the terminal the server will stay up. To return to your screen use "screen -r svends"

Admin Tasks

If a player reports something that took place in chat logs then you can verify that this happened with the logs directory which can be found at /hlserver/svencoop/logs.

You can kick players from the server with


kicksteamid "STEAM_0:0:00000000"

Replace example id with player's steam id, keep the quotes.

You can ban players by placing player's steam ids into the banned.cfg file we made earlier. For it to go into effect the server needs to change maps.

Notes

Keep the OS up to date


sudo apt update
sudo apt upgrade

Keep the server up to date


steamcmd +login anonymous +force_install_dir "/svends" +app_update 276060 validate +exit

For the general purpose guide made by the SC Team please use this guide, it has more important documentation that we do not mention on this guide

Message to the Sven Co-op Team: Please explain what the server dependencies are and how to find them on your guides. Also please don't tell people to use libssl.1.1 without mentioning to not install the .deb file it comes in. Installing it like that breaks system updates