Install Black Mesa on Debian or Ubuntu

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Create a Linode account to try this guide with a $100 credit.
This credit will be applied to any valid services used during your first 60 days.

This guide will show you how to set up your own Black Mesa server on a Linode running Debian or Ubuntu.

Before You Begin

  1. You will need a Steam account and a copy of Black Mesa.

  2. Complete our guide: Install SteamCMD for a Steam Game Server. This will get SteamCMD installed and running on your Linode and this guide will pick up where the SteamCMD page leaves off.

Note
This guide is written for a non-root user. Commands that require elevated privileges are prefixed with sudo. If you’re not familiar with the sudo command, you can check our Users and Groups guide.

Prerequisites for Black Mesa

From the SteamCMD guide, one additional step is needed specifically for Black Mesa.

  1. Add two firewall rules to slightly extend the port range available to the game. This command assumes that you have only the iptables rules in place from the SteamCMD guide.

    sudo iptables -R INPUT 5 -p udp -m udp --sport 26900:27030 --dport 1025:65355 -j ACCEPT
    sudo iptables -I INPUT 7 -p udp -m udp --dport 26900:27030 -j ACCEPT
    

Install Black Mesa, Dedicated Server

  1. Execute SteamCMD:

    cd ~/Steam && ./steamcmd.sh
    
  2. Login as anonymous:

    login anonymous
    
  3. Download the server:

    app_update 346680 validate
    
  4. Exit from SteamCMD:

    quit
    

Run Black Mesa, Dedicated Server

  1. Go into the Black Mesa Dedicated Server folder:

    cd "steamapps/common/Black Mesa Dedicated Server"
    
  2. Run the Server:

    ./srcds_run -game bms +hostname "My Linode" +map gasworks +maxplayers 24
    
Note

The game parameter specifies the game’s files directory; don’t change it. This is the only parameter you can’t write in server.cfg because it specifies the game folder, where the server.cfg file itself is.

The hostname parameter specifies your server’s name in the browser list. By default it’s specified in server.cfg, so the +hostname parameter is overridden by it.

The map parameter specifies the map with which the server needs to start. You must write the name of the map file without the prefix.

The maxplayers parameter specifies the maximum number of players allowed to play on the server.

You can read the entire list of parameters on the Valve Wiki.

Note

To keep the server running, execute it using Screen:

screen ./srcds_run -game bms +map gasworks +maxplayers 24

Configure a Black Mesa Dedicated Server

Note
At the time of writing this guide, Black Mesa has yet to share with customers any official documentation regarding configurations.

Server.cfg

The server.cfg file contains the settings of your server. It is not needed because you can start the server every time by specifying desired values using parameters.

File: /home/steam/Steam/steamapps/common/Black Mesa Dedicated Server/bms/cfg/server.cfg
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// Black Mesa server.cfg file
hostname "Black Mesa: Deathmatch" --> Your server's name.
mp_timelimit 900                  --> Round time limit.
mp_warmup_time 30                 --> Time before the match starts.
// sv_lan 0                       --> LAN Mode. (0 = disabled|1 = enabled).
// rcon_password                  --> The RCON password to login as admin to send commands to your server while you're in-game.
// mp_flashlight 1                --> Flashlight allowed. (0 = disabled|1 = enabled).
// mp_forcerespawn 0              --> Forced respawn, without the player prompt. (0 = disabled|1 = enabled).
// mp_friendlyfire 0              --> When enabled, a player can shoot another one of his own team. (0 = disabled|1 = enabled).
// mp_fraglimit 45                --> The number of kills needed to end the match.
// sv_logecho 1                   --> Prints logs in the console (0 = disabled|1 = enabled).
// sv_logfile 1                   --> Saves the logs to a file (0 = disabled|1 = enabled).
Caution
The settings in server.cfg will override the ones that you specify (using parameters) when you start the server.

Config_deathmatch.cfg

The config_deathmatch.cfg file contains the settings of the gamemode. You can edit almost everything in this file. It’s located at: /home/steam/Steam/steamapps/common/Black Mesa Dedicated Server/bms/cfg/config_deathmatch.cfg

Maps

Currently, there are 10 official maps in Black Mesa Dedicated Server:

  • dm_bounce
  • dm_chopper
  • dm_crossfire
  • dm_gasworks
  • dm_lambdabunker
  • dm_power
  • dm_stack
  • dm_stalkyard
  • dm_subtransit
  • dm_undertow

Three additional official maps are available in the Steam Workshop:

Custom Maps

  • Custom maps in BSP format need to be put in the same folder as the official ones: /home/steam/Steam/steamapps/common/Black Mesa Dedicated Server/bms/maps/.

  • Custom maps in VPK format need to be put in the addons folder: /home/steam/Steam/steamapps/common/Black Mesa Dedicated Server/bms/addons/

  • Custom maps downloaded from the workshop need to be put in the workshop folder: /home/steam/Steam/steamapps/common/Black Mesa Dedicated Server/bms/addons/workshop

The add-ons to be loaded need to be specified in the addonlist.txt file. In the following example, maps that were downloaded from workshop to the list are added to dm_boom and dm_shipping:

File: /home/steam/Steam/steamapps/common/Black Mesa Dedicated Server/bms/addonlist.txt
"AddonList"
  {
   "workshop\432070352.vpk"     "1"
   "workshop\432074065.vpk"     "1"
  }
Note
You can find more maps in the Steam Workshop.

Maps Rotation

When a match ends, the server starts a new one with the next map in the rotation list. The map rotation list is in mapcycle.txt:

File: /home/steam/Steam/steamapps/common/Black Mesa Dedicated Server/bms/cfg/mapcycle.txt
dm_bounce
dm_gasworks
dm_lambdabunker
dm_stalkyard
dm_subtransit
dm_undertow
dm_custom

To put a custom map in the rotation, simply write its name; for example: if you have the map dm_custom.bsp, you need to write dm_custom inside mapcycle.txt.

Connect to Your Server

  1. Open Black Mesa, and click on the PLAY ONLINE option:

    Black Mesa Main Menu.

  2. Find your server in the server list:

    Black Mesa Server Browser.

  3. Double click on it to connect:

    Black Mesa In-Game.

Extra

Autostart with screen script

This script automatically starts a Black Mesa Dedicated Server into a Screen session.

  1. Go into the Black Mesa Dedicated Server folder:

    cd "/home/steam/Steam/steamapps/common/Black Mesa Dedicated Server/"
    
  2. Create the file to contain the script:

    File: /home/steam/Steam/steamapps/common/Black Mesa Dedicated Server/run.sh
    1
    2
    3
    4
    
    #!/bin/sh
    cd "$HOME/Steam/steamapps/common/Black Mesa Dedicated Server"
    screen -S "BMDS" -d -m
    screen -r "BMDS" -X stuff "./srcds_run -game bms +map gasworks +maxplayers 24\n"
  3. Run the script:

    ./run.sh
    
Note

The game parameter specifies the game’s files directory, don’t change it. This is the only parameter you can’t write in server.cfg because it specifies the game folder, where the server.cfg file itself is.
The hostname parameter specifies your server’s name in the browser list. By default it’s specified in server.cfg, so the +hostname parameter is overridden by it.
The map parameter specifies with which map the server needs to start. You must write the name of the map file without the prefix.
The maxplayers parameter specifies the maximum number of players allowed to play on the server.

You can read the entire list of parameters on the Valve Wiki.

MetaMod

MetaMod is an add-on for servers using Source Engine that works as a “base” for other plug-ins like SourceMod.

  1. Go into the bms folder:

    cd "/home/steam/Steam/steamapps/common/Black Mesa Dedicated Server/bms/"
    
  2. Download MetaMod:

    wget http://www.metamodsource.net/mmsdrop/1.10/mmsource-1.10.7-git951-linux.tar.gz
    
    Note
    This URL constantly changes as MetaMod is updated. Please check the downloads page for the current URL.
  3. Extract the downloaded archive:

    tar -zxvf mmsource-1.10.7-git951-linux.tar.gz
    
  4. Cleanup:

    rm mmsource-1.10.7-git951-linux.tar.gz
    
  5. Run the server and enter the command meta list in the console:

    meta list
    No plugins loaded.
    

If you get the same output, it means that MetaMod is working.

SourceMod

It is recommended that you install the SourceMod add-on. It provides useful functions, such as votemap, random map cycle, bans, reserved slots, admin system, and player commands; you can customize it as you want.

  1. Go into the bms folder:

    cd "/home/steam/Steam/steamapps/common/Black Mesa Dedicated Server/bms/"
    
  2. Download SourceMod:

    wget https://www.sourcemod.net/smdrop/1.8/sourcemod-1.8.0-git5829-linux.tar.gz
    
    Note
    This URL constantly changes as SourceMod is updated. Please check the downloads page for the current URL.
  3. Extract the downloaded archive:

    tar -zxvf sourcemod-1.8.0-git5829-linux.tar.gz
    
  4. Cleanup:

    rm sourcemod-1.8.0-git5829-linux.tar.gz
    
  5. Run the server and enter the command meta list in the console:

    meta list
    Listing 2 plugins:
     [01] SourceMod (1.8.0.5829) by AlliedModders LLC
     [02] SDK Tools (1.8.0.5829) by AlliedModders LLC
    

If you get similar output, it means that MetaMod and SourceMod are working.

Now, SourceMod will be automatically loaded by MetaMod when starting the Black Mesa Dedicated Server.

Note
Read the MetaMod Official Wiki and the SourceMod Official Wiki for info about configurations, plug-ins, files, etc.

Enjoy!

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

This page was originally published on


Your Feedback Is Important

Let us know if this guide made it easy to get the answer you needed.


Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.