# How to Set a Password on Your Left 4 Dead Server (/docs/left-4-dead/set-a-password)



import { Step, Steps } from 'fumadocs-ui/components/steps';

Setting a server password restricts access to only players who know the password. This is useful for private campaign runs with friends, community events, or competitive practice sessions.

Setting Your Server Password [#setting-your-server-password]

<div className="fd-steps">
  <div className="fd-step">
    Open the XGamingServer panel [#1-open-the-xgamingserver-panel]

    Log in to the [XGamingServer panel](https://panel.xgamingserver.com) and stop your Left 4 Dead server.
  </div>

  <div className="fd-step">
    Open server.cfg [#2-open-servercfg]

    In the sidebar, go to `Files` and navigate to `left4dead` > `cfg`. Open `server.cfg`.
  </div>

  <div className="fd-step">
    Set the password [#3-set-the-password]

    Add or update the `sv_password` line:

    ```
    sv_password "YourServerPassword"
    ```

    Make sure the password is enclosed in double quotes.
  </div>

  <div className="fd-step">
    Save and restart [#4-save-and-restart]

    Click **Save** and start your server.

    Players will now be prompted to enter the password when connecting through the server browser or via [direct connect](/docs/left-4-dead/connect-to-your-server).
  </div>
</div>

How Password Protection Works [#how-password-protection-works]

* **Server browser** — Your server still appears in the Steam server browser, but with a **lock icon** indicating it requires a password.
* **Console connect** — Players can include the password in their connect command: `connect 198.137.23.46:27015; password YourServerPassword`
* **Steam invites** — Friends who receive a Steam game invite will still need to enter the password when joining.

Removing the Password [#removing-the-password]

<div className="fd-steps">
  <div className="fd-step">
    Stop your server [#1-stop-your-server]

    Stop your server from the XGamingServer panel.
  </div>

  <div className="fd-step">
    Clear the password [#2-clear-the-password]

    Open `server.cfg` and either remove the `sv_password` line entirely, or set it to empty:

    ```
    sv_password ""
    ```
  </div>

  <div className="fd-step">
    Save and restart [#3-save-and-restart]

    Click **Save** and start your server.

    Your server will now be open to anyone.
  </div>
</div>

Setting a Password via RCON [#setting-a-password-via-rcon]

If you have [RCON access](/docs/left-4-dead/rcon), you can set or remove the password while the server is running:

To set a password:

```
rcon sv_password "NewPassword"
```

To remove the password:

```
rcon sv_password ""
```

> 📝 **Note:** Password changes made via RCON are temporary and revert on server restart or map change. For permanent changes, update `server.cfg`.

Server Password vs. RCON Password [#server-password-vs-rcon-password]

Left 4 Dead has two separate passwords:

| Password                                                      | Purpose                                         | Config Command             |
| ------------------------------------------------------------- | ----------------------------------------------- | -------------------------- |
| **Server Password** (`sv_password`)                           | Controls who can **join** the server            | `sv_password "password"`   |
| **[RCON Password](/docs/left-4-dead/rcon)** (`rcon_password`) | Controls who can **manage** the server remotely | `rcon_password "password"` |

These are completely independent. Setting a server password doesn't affect RCON access, and vice versa. Always use different passwords for each.

> 💡 **Tip:** For private sessions with friends, set the password before your play session and share it over Discord or a private message. Remove it afterward if you want to keep the server open during off-hours.

If you get stuck at any time, you can join our [Discord](https://discord.xgamingserver.com/).
