# How to Set a Password on Your Half-Life Server (/docs/half-life-1/server-password)



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

<Tabs items={['Via Startup (Recommended)', 'Via server.cfg']}>
  <Tab value="Via Startup (Recommended)">
    <Steps>
      <Step>
        Open Startup [#open-startup]

        In the [XGamingServer Panel](https://panel.xgamingserver.com), click **Startup** in the sidebar.
      </Step>

      <Step>
        Set the Password field [#set-the-password-field]

        Find the **Password** field and enter your password.
      </Step>

      <Step>
        Restart [#restart]

        Restart from **Console** to apply.
      </Step>
    </Steps>
  </Tab>

  <Tab value="Via server.cfg">
    <Steps>
      <Step>
        Stop the server [#stop-the-server]
      </Step>

      <Step>
        Open server.cfg [#open-servercfg]

        In **Files**, open `valve/server.cfg`.
      </Step>

      <Step>
        Set sv_password [#set-sv_password]

        ```
        sv_password "YourPassword"
        ```

        For a public server, leave it empty:

        ```
        sv_password ""
        ```
      </Step>

      <Step>
        Save and start [#save-and-start]
      </Step>
    </Steps>
  </Tab>
</Tabs>

How Players Connect [#how-players-connect]

```
connect 123.45.67.89:27015; password "YourPassword"
```

Or via a clickable Steam link:

```
steam://connect/123.45.67.89:27015/YourPassword
```

Related Guides [#related-guides]

* [Server Configuration](/docs/half-life-1/server-config)
* [Connect to Your Server](/docs/half-life-1/join-server)
