# How to Make Your Valheim Server Private (/docs/valheim/private-setup)



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

A private server doesn't appear in the public **Community** browser. Players can only join via direct IP or join code.

<Steps>
  <Step>
    Open Startup [#open-startup]

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

    {/* Screenshot needed: Startup tab with Public variable */}
  </Step>

  <Step>
    Set Public to 0 [#set-public-to-0]

    Find the **Public** variable (maps to `-public`) and set it to `0`.

    | Value | Behavior                                          |
    | ----- | ------------------------------------------------- |
    | `1`   | Server appears in the Community browser (default) |
    | `0`   | Server is hidden — direct IP / join code only     |
  </Step>

  <Step>
    Restart the server [#restart-the-server]

    Go to **Console** and restart.
  </Step>
</Steps>

How Players Join a Private Server [#how-players-join-a-private-server]

Players need either:

* **Direct IP** — give them your server IP and port (e.g., `123.45.67.89:2456`). They use **Join IP** in the game.
* **Join code** — if `-crossplay` is enabled, share the 6-character join code from server logs

See [Connect to Your Server](/docs/valheim/join-server) for the player's perspective.

Combine with a Password [#combine-with-a-password]

For maximum privacy, combine `-public 0` with a [server password](/docs/valheim/server-password). Even players with the IP need the password to connect.

Related Guides [#related-guides]

* [Server Launch Parameters](/docs/valheim/server-launch-parameters)
* [Connect to Your Server](/docs/valheim/join-server)
* [Set a Password](/docs/valheim/server-password)
