# How to Host a Black Mesa Server (Dedicated Server Setup)

Set up a Black Mesa dedicated server: SteamCMD app 346680, srcds_run -game bms, server.cfg, ports 27015 and 27005, and joining from the console.

Updated 2026-10-07. https://gamezservers.com/guides/how-to-host-a-black-mesa-server

To host a Black Mesa server, download the free Black Mesa Dedicated Server with SteamCMD (`login anonymous`, then `app_update 346680 validate`), and start it with `srcds_run -game bms +map dm_crossfire +maxplayers 32` on Linux or `srcds.exe -console -game bms` on Windows. Put your settings in `bms/cfg/server.cfg`, forward UDP and TCP port 27015, and have players join through the developer console with `connect your.ip:27015`. Players still need their own copy of Black Mesa; the server itself costs nothing to download.

## What you need before you start

| Item | Detail |
| --- | --- |
| Dedicated server app | Black Mesa Dedicated Server, Steam app ID **346680**, free with an anonymous SteamCMD login |
| Game folder | `bms` (that is the value for `-game`) |
| Disk space | Large. The download includes the full game content, and the textures alone are several GB |
| RAM | 2 GB for small deathmatch, 4 GB for 32 players or a co-op campaign |
| Ports | 27015 UDP/TCP (game and RCON), 27005 UDP (client), 27020 UDP (SourceTV) |
| Players | Each needs Black Mesa on Steam (app 362890) |

Black Mesa is Crowbar Collective's Source engine remake of Half-Life, so anyone who has run a Counter-Strike: Source or Half-Life 2: Deathmatch server will find it familiar. The base game's multiplayer is deathmatch and team deathmatch on remade maps like Crossfire, Bounce, Gasworks, Stalkyard and Undertow. Campaign co-op needs plugins, which we cover in [how to play Black Mesa co-op on a dedicated server](https://gamezservers.com/guides/how-to-play-black-mesa-co-op-on-a-dedicated-server).

## Step 1: Install SteamCMD

**Windows:** download SteamCMD from [Valve's developer wiki](https://developer.valvesoftware.com/wiki/SteamCMD), unzip `steamcmd.exe` into a folder like `C:\steamcmd`, and run it once so it updates itself.

**Linux (Debian or Ubuntu):** the server is a 32 bit program, so add the i386 architecture and the libraries it needs first:

```bash
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install lib32gcc-s1 lib32stdc++6 libncurses5:i386 wget unzip
mkdir ~/steamcmd && cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz
```

Run it as a normal user, never as root.

## Step 2: Download the Black Mesa Dedicated Server

Inside SteamCMD:

```
force_install_dir "../Black Mesa Dedicated Server"
login anonymous
app_update 346680 validate
quit
```

Set `force_install_dir` before `login`, or SteamCMD may complain and drop the files in its default library. When it finishes you get a folder with `srcds_run` (Linux) or `srcds.exe` (Windows) next to a `bms` folder. Run the same `app_update 346680 validate` line again after every Black Mesa patch, because clients on a newer build cannot join an old server.

## Step 3: Write server.cfg

Create `bms/cfg/server.cfg`. A sensible deathmatch starting point:

```
hostname "Friday Night Crossfire"
sv_password ""            // fill in to make the server private
rcon_password "change-me-long-and-random"
sv_lan 0                  // 0 = list on the internet
mp_timelimit 15           // minutes per map
mp_fraglimit 50
mp_teamplay 0             // 1 = team deathmatch
mp_friendlyfire 0
mp_forcerespawn 1
sv_alltalk 1
sv_allowdownload 1
sv_allowupload 1
mapcyclefile "mapcycle.txt"
```

Two things trip people up here. First, `-game bms` can never go in server.cfg, because it tells the engine which folder the config lives in. Second, server.cfg runs on every map load, so a changed value will not apply until the next map or until you type `exec server.cfg` in the console.

For a rotation, list one map per line in `bms/cfg/mapcycle.txt` (no `.bsp` on the end). If you are not sure which deathmatch maps your build ships, type `maps dm_` in the server console and it prints every installed map starting with `dm_`.

![Black Mesa deathmatch arena from the Half-Life remake](https://gamezservers.com/games/black-mesa/shot-1.webp)

## Step 4: Start the server

**Linux:**

```bash
cd "Black Mesa Dedicated Server"
./srcds_run -console -game bms -ip 0.0.0.0 -port 27015 +clientport 27005 +tv_port 27020 +maxplayers 32 +map dm_crossfire +servercfgfile server.cfg
```

**Windows (Command Prompt in the server folder):**

```
srcds.exe -console -game bms -port 27015 +maxplayers 32 +map dm_crossfire
```

Launch options with a minus sign (`-port`, `-console`) are engine switches, while those with a plus sign (`+map`, `+maxplayers`) run as console commands once the engine is up. If the console prints `Connection to Steam servers successful` and then loads the map without errors, the server is running. Add `-strictportbind` if you run several Source servers on one machine, so a second copy fails instead of silently moving to 27016.

## Step 5: Open the ports

| Port | Protocol | Needed for |
| --- | --- | --- |
| 27015 | UDP | Players and server browser queries |
| 27015 | TCP | Remote RCON |
| 27005 | UDP | Client port |
| 27020 | UDP | SourceTV, only if you use it |

Allow these in Windows Defender Firewall (or `ufw allow 27015` on Linux) and forward them on your router to the PC's local IP. Our [port forwarding guide](https://gamezservers.com/guides/how-to-port-forward-a-game-server) walks through the router side. If your internet provider uses CGNAT, port forwarding will not work at all and you need a server with its own public address.

## Step 6: Join the server

Black Mesa ships with the developer console turned off. Each player turns it on once:

1. Launch Black Mesa and open **Options**.
2. Go to **Keyboard**, then **Advanced**.
3. Tick **Enable developer console** and press **OK**.
4. Press the tilde key (`~`), type `connect 203.0.113.10:27015` with your real address, and press Enter.
5. If you set `sv_password`, type `password yourpassword` before connecting, or enter it when asked.

People on the same network as the server should connect with its local address (like `192.168.1.50:27015`), since many home routers do not loop traffic back to your own public IP. If the server does not show up in the in-game list or players time out, work through [Black Mesa server not showing or cannot connect](https://gamezservers.com/guides/black-mesa-server-not-showing-or-cannot-connect).

## Running it day to day

These console commands cover most admin work, typed straight into the server window or prefixed with `rcon` from a player's console after `rcon_password`:

| Command | What it does |
| --- | --- |
| `changelevel dm_bounce` | Switch map now |
| `status` | List players with their user IDs |
| `kickid 12` | Kick user ID 12 |
| `banid 0 12 kick` | Permanent ban and kick, then `writeid` to save it |
| `exec server.cfg` | Reapply the config |
| `quit` | Stop the server cleanly |

For admin menus, votes and plugins, add Metamod:Source and SourceMod into `bms/addons/`. The folder layout is the same as on other Source games, with `bms` in place of `tf` or `cstrike`.

## Skip the setup

All of the above is a fair amount of work for a Saturday deathmatch: a big download, 32 bit libraries on Linux, firewall rules and a PC that has to stay on. A [Black Mesa server from GamezServers](https://gamezservers.com/games/black-mesa) comes up with its own address and no port forwarding. Default Map, Max Players and Auto Update are settings in the control panel, `server.cfg` and the `bms` folder are in the file manager and over SFTP, and the live console takes `changelevel`, `kick` and the rest. Plans start at 2 GB and you can split the bill with up to 10 friends.

![Black Mesa research facility from the Half-Life remake](https://gamezservers.com/games/black-mesa/shot-3.webp)

## FAQ

### What is the Black Mesa dedicated server app ID?

It is 346680. Download it in SteamCMD with `login anonymous` and `app_update 346680 validate`. You do not need to own the game on the account that downloads the server.

### What is the -game value for Black Mesa?

`-game bms`. The game files, `cfg` folder, maps and addons all live inside the `bms` folder of the server install.

### How many players can a Black Mesa server have?

Deathmatch servers commonly run up to 32 players, set with `+maxplayers 32` on the start line. For co-op, smaller groups of 4 to 8 tend to work best.

### Can I host a Black Mesa server from my game PC?

Yes, the dedicated server runs alongside the game on the same PC as long as you have the RAM. You connect to it with `connect 127.0.0.1:27015` or your LAN address, and friends use your public address after you forward port 27015.

### Do I need a Steam login token for Black Mesa?

It is optional. Without one the server logs in to Steam anonymously and still lists. If you want a fixed server identity, create a token for app ID 362890 on [Steam's game server account page](https://steamcommunity.com/dev/managegameservers) and add `+sv_setsteamaccount YOURTOKEN` to the start line (not server.cfg, which runs too late). Either way, keep `sv_lan 0` so it registers with Steam's server list.
