# How to Set a Password on Your Holdfast: Nations At War Server (/docs/holdfast/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 essential for organized line battles, regiment practices, competitive events, or any situation where you want to control exactly who can join your Holdfast server.

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 Holdfast server.
  </div>

  <div className="fd-step">
    Open the config file [#2-open-the-config-file]

    In the sidebar, go to `Files` and open `serverconfig_default.cfg` in the server root.
  </div>

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

    Find the `server_password` setting and enter your desired password:

    ```
    server_password YourServerPassword
    ```
  </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 they try to join from the server browser or via [direct connect](/docs/holdfast/connect-to-your-server).
  </div>
</div>

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

* **Server browser** — Your server still appears in the Holdfast server browser with a **lock icon**, indicating a password is required. Players can see the server name, player count, map, and game mode, but can't join without the password.
* **Direct connect** — Players connecting via IP and port will also be prompted for the password.
* **Sharing the password** — Distribute your password through Discord, regiment forums, or private messages. Avoid putting the password in your [server name](/docs/holdfast/change-server-name) — that defeats the purpose.

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 `serverconfig_default.cfg` and clear the `server_password` field (leave it empty or remove the value):

    ```
    server_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>

When to Use a Password [#when-to-use-a-password]

Holdfast has several scenarios where passwords are commonly used:

| Scenario                | Recommendation                                                         |
| ----------------------- | ---------------------------------------------------------------------- |
| **Line battles**        | Set a password and share with participating regiments before the event |
| **Regiment training**   | Password-protect during drills, remove afterward                       |
| **Competitive matches** | Both teams share the password for the match duration                   |
| **Public play**         | No password — keep the server open for anyone                          |
| **Server maintenance**  | Temporarily set a password while making changes                        |

> 💡 **Tip:** For organized line battle events, set the password 15-30 minutes before the event starts. Share it with regiment leaders through your event coordination channel. Change the password after the event ends to prevent unauthorized access during your next session.

> 📝 **Note:** The server password controls who can join the game. Admin access is managed separately through [Steam64 IDs](/docs/holdfast/adding-admins) in the configuration file. Setting a server password doesn't affect admin privileges.

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