How To Install A Counter-Strike Source Server On Ubuntu
In this tutorial we will be covering the process of installing and running a CS:S Game server.
Prerequisites
Getting Started
- Update the packages: sudo apt-get update -y && sudo apt-get upgrade -y .
- Install these additional libraries: sudo apt-get install lib32gcc1 libc6-i386 .
- Add a new user for running the game server: sudo adduser steam (For security purposes).
- Login to the new user that we created: su steam .
Downloading SteamCMD
SteamCMD is a free tool created by Valve and used to download Game Server files easily.
- As you are logged as the steam user, make sure youâre in /home/steam .
- Create a directory for SteamCMD: mkdir SteamCMD .
- Navigate to the newly created directory and download the SteamCMD archive: cd steamCMD && wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz .
- Extract the archive:tar -xvzf steamcmd_linux.tar.gz .
Running SteamCMD
Now we get to the exciting bit, downloading the actual files that make the game server operate.
- Run SteamCMD: ./steamcmd.sh .
- Login to Steam servers anonymously: login anonymous .
- Set the install directory: force_install_dir ./css/ .
- Download the game files: app_update 232330 validate (This may take a while).
- Quit the SteamCMD console: quit .
Running the CS:S server
- Navigate to the CS:S Installation Directory: cd css
- Execute this command to run the server: ./srcds_run -console -game cstrike -maxplayers 20 — port 27015 +map de_dust2 .
Conclusion
Your CS:S server should be up and running! To connect to it use the IP on your Vultr instance.
For an advanced configuration guide refer to the CS:S section on the SteamCMD Wiki. Enjoy!
This concludes our tutorial. Thank you for reading.
Want to contribute?
You could earn up to $600 by adding new articles.
How to make css server
This guide will show you, how to setup a Dedicated Server with SteamCMD.
INFO: Please make sure, to have opened your Ports!
TCP/UDP: 27015-27050
I also created a tool, that automates the installation process. You can find this tool here:
https://steamcommunity.com/groups/ServerTool
1
Run the file, then you need to type the following to create a folder, where the server files will be deployed. Here it will be called «css_ds»
It might take some while, depending on your internet connection.
After the download has finished you can close SteamCMD by typing
Info: «-secure» means that your server is VAC secured, otherwise use «-insecure» to disable VAC.
Maxplayers logically means how many players can join the server.
You can also change the port with «-port 27015»
Map defines with which map the server starts.
It is time to conifgurate your server. For this purpose I created a pre made cfg, which can be downloaded over this link:
https://pastebin.com/e3f89ijz
Backup Link:
http://hastebin.com/peraqekepe.mel
Now you only need to put it into:
Remember, that it needs to have this name: «server.cfg»
Note:
Please keep in mind that you need to open your ports so that other players can connect or you simply use a VPN-Tool like Hamachi.
At first you will need «Metamod Source» you can get it from here. [www.metamodsource.net]
You have to unzip the files in the following folder:
By now there should be an «addons» folder.
Now you need Sourcemod, you can get this here. [www.sourcemod.net]
You can also get the Plugins from there later.
Also extract that in this folder:
For the following you will need your SteamID, you can find yours out here:
http://steamidfinder.com
To configurate an admin, go to:
If you have configurate it, write in the chat «!admin» or in the console «sm_admin» to open the menu.
I can not see my server / No one can connect to my server
Please make sure, that you have opened all the required ports in your router. If the everything is set correctly, but the problem still occurs, please contact your internet provider.
Or look for your router model here:
https://portforward.com/router.htm
Is there another way instead of opening the ports?
Yes, you can also host your server through a VPN network like «Hamachi». Of course only the people in the VPN network will be able to join the server then.
If forwarding your ports doesn´t work, please contact your ISP, i won´t be able to help you.
How can i change my server port?
Just edit the bat file with «-port 27015»
The SteamCMD download failed! What should I do now?
Mostly you just need to retry the download, then the problem should be fixed.
How do I update my server?
Just open the SteamCMD and login again, then retry the Step «Downloading the files» it will be checked which files need to be updated.
To automate these steps to setup/upgrade a server, i created a tool, the group can be founde here:
http://steamcommunity.com/groups/ServerTool
The tool itself is hosted on Github, which can be found here:
https://github.com/Zeromix9/ServerTool
I hope, that will help you in the future!
How to make css server
Для начала нужно разобраться с вашим интернетом. Так вот, 1 Mb (мегаБИТА) вполне достаточно, проблема в исходящем канале! (Сразу поясню: входящей называется скорость соединения, с которой ваш компьютер может получать данные из сети Интернет, а исходящей называется скорость соединения, с которой ваш компьютер может передавать данные в сеть). Итак, для каждого игрока на созданном вами сервере css нужно иметь минимум 50 Kb. Заходите на сайт 2ip.ru . Сразу запишите ваш ip адрес (он написан сверху большими цифрами), выберите тест скорости соединения, введите код подтверждения и нажмите на кнопку «тестировать». Если входящая ниже 1000Кб/с (КилоБИТ в секунду), а исходящая ниже 500Кб/с, даже не беритесь за создание cs-сервера.
Итак, представим себе как вы подключены к Интернету когда у вас внешний сетевой адрес:
Ваш компьютер — провайдер — Интернет
А вот такой расклад не подойдет:
Ваш компьютер — локальная сеть — провайдер — Интернет
Просто позвоните провайдеру, и спросите у вас внешний IP или нет. Хочу сделать замечание: динамичность адреса не имеет отношения к работоспособности. Другими словами, даже если каждый раз при подключении к Интернету у вас новый адрес, ваш сервер все равно будет виден для counter strike под этим IP, но при условии что он внешний.
Конфигурация компьютера должна быть приемлемой. То есть для windows XP или Linux — 512Mb (мегаБАЙТ) оперативной памяти на 20 человек или Windows Vista/7/8/ — 1Gb соответственно. Желательно также запастись 2х или более ядерным процессором, для того чтобы можно было комфортно играть подключившимся, пока вы делаете за компьютером другие дела. Не рекомендуется играть в counter strike на том же компьютере, где запущен сервер (2х ядерный процессор частично решает эту проблему). Что бы проверить систему на производительность, запустите counter strike и поставьте все графические настройки на максимум — если компьютер не тормозит, то он полностью подойдет для ваших нужд.
Предположим все что нужно у вас есть. Перейдем к созданию.
Сначала необходимо скачать hldsupdatetool
Скачать его можно тут —-> Скачать
Разархивируем http://www.wrp.pp.ua/Plagins/9_hldsupdatetool.rar
Когда вы запустите файл из архива, то вам предложат выбрать куда установить hldsupdatetool, это можно сделать куда угодно, важно, что эта папка в дальнейшем и станет папкой Сервера, я приведу пример с диском С:
Выбираем Europe и жмём Next. Далее откроется еще одно окошко и в нем нажимаем Next и Finish
Идем в папку куда был установлен hldsupdatetool (в данном примере C:\Server). Запускаем файл HldsUpdateTool.exe, в следствии чего откроются два окошка и HldsUpdateTool.exe начнет
обновлять себя, так как у вас не последня версия, скрин можно увидеть ниже:
Обновление займет не более чем 1 минуту! После чего окно само закроется.
После обновления HldsUpdateTool идем в папку с сервером (в данном примере C:\Server). Теперь нам необходимо скачать сервер, для этого мы создаем файл Update.bat
На рабочем столе жмем правую кнопку мыши Создать\Текстовый документ
В него вставляем вот этот код:
start /wait hldsupdatetool.exe
start /wait hldsupdatetool.exe -command update -game «Counter-Strike Source» -dir .
exit
Жмем Файл\Сохранить как
В Имя файла пишем Update.bat. Жмем Сохранить. Готово.
Update.bat кидаем в папку с сервером (в данном примере C:\Server)! Теперь можно его запустить, после чего откроются два окошкa и начнется скачивание сервера, скрин можно посмотреть ниже:
Сервер весит 1 — 1.2 GB (ОСТОРОЖНО ТРАФФИК), соответственно скорость скачки зависит от скорости твоего интернета и как следствие чем выше скорость Интеренета, тем быстрее все скачается. После окончания окошко закроется само.
После того как скачка закочится, нам необходимо будет создать файл Start.bat, он нужен для запуска сервера. Нам вновь надо создать Текстовый документ, в котором необходимо прописать:
@echo off
cls
echo Protecting srcds from crashes.
echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter.
title srcds.com
:srcds
:loop
echo (%date% %time%) srcds started.
start /wait srcds.exe -console -game cstrike -tickrate 66 -port 27015 +fps_max 600 +maxplayers 12 +map de_dust2
goto srcds
echo (%date% %time%) WARNING: srcds closed or crashed, restarting.
goto loop
Файл настроен вот так: при запуски сразу же карта de_dust2 , TickeRate 66(если ставить выше, то могут быть проблемы на сервере, например жутко подниматься пинг), порт сервера 27015 , FPS сервера 600 и 12 слотов на сервер. (12 игроков)
Набор основных команд, которые можно написать в строчке, которая подчеркнута красным цветом.
1. -autoupdate Сервер проверяет обновления при запуске.
2. -insecure Запускает сервер без использования технологии защиты от читеров (Valve Anti-Cheat).
3. -nobots Отключить ботов.
4. -verify_all Производит проверку на то, что каждый файл сервера последней версии.
5. +ip Задает IP сервера, когда в системе несколько сетевых карт.
6. +sv_lan Если установлено в 1, то сервер может принять только пользователей локальной сети (LAN).
7. +maxplayers Задает максимальное количество игровых слотов.
8. +map Задает карту для запуска.
9. +hostname «Имя Сервера» Задает имя сервера.
10. -tickrate Задает tickrate сервера (подробнее в Source Multiplayer Networking).
11. -port Порт для подключения клиента к серверу.
12. +fps_max FPS сервера
13. +tv_port Порт для подключения SourceTV.
После чего жмем Файл\Сохранить как\Start.bat И кидаем этот фаил в папку с сервером (в данном примере C:\Server)
Вот собственно и всё! Ваш личный CSS сервер готов! Ну безусловно вам придётся покопаться с настройками, и с добавлением музыки\карт, но это уже детали!)