How to Make your Garry's Mod Server Private

If you would like to make a Garry's Mod server for yourself and a few friends, you may wish to restrict your GMOD server so that random players cannot join your server without your permission. This article covers two methods of doing so.

METHOD 1: SETTING A PASSWORD

Garry's Mod provides a built-in password function that prompts the user for a password when joining the server. Anybody who knows (or can guess) this password can join your server, so it's important to choose a strong password that is not easy to guess and only to give it to people that you trust.

  1. Login to your Control Panel.
  2. Click on the Files > Config Files tab on the left.
  3. Open the Garry's Mod Server Settings config file.
  4. Adjust the Server Password value to the password you wish to use.
  5. Click Save and restart your server.

Once your server has restarted, players will need to enter the password you chose above into their Garry's Mod clients in order to join your server.

METHOD 2: USING AN ALLOW LIST

Another way to protect your server from unwanted visitors is to use a list of SteamIDs to define who is allowed to join your server. Pay special attention to quotes, commas, and brackets as duplicating these or failing to insert one where necessary will result in this failing to work.

  1. Open your server's FTP.
  2. Navigate to the following directory: garrysmod/lua/autorun/server, then create a new file called allowedplayers.lua
  3. Paste the following code into the newly created file:
    local allowed = {
        ['YOURSTEAMIDHERE'] = true,
        ['ANOTHERSTEAMIDHERE'] = true
    }
    hook.Add('CheckPassword', 'AllowList', function (sid64)
        if not allowed[sid64] then return false, 'You are not allowed on this server!' end
    end)
  4. Replace the sample values (YOURSTEAMIDHERE, ANOTHERSTEAMIDHERE) in the file with the SteamID64s of you and anybody else that you wish to allow on your server. Each entry except for the last must end with a comma (,). You can use a site like steamid.io to find your SteamID64. You should end up with something that looks like this:
  5. Restart your server. Players who are not on the list can no longer join your server.
If you require any further assistance, please contact our support at: https://shockbyte.com/billing/submitticket.php

Mitchell Smith

Managing Director @ Shockbyte

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How to enable RCON on your Garry's Mod Server

RCON is an important protocol that allows you to execute commands without joining your server....

How to install DarkRP to your Garry's Mod server

DarkRP is a widely popular gamemode within the Garry's Mod community because of the crazy antics...

How to upload & use Garry's Mod Workshop Maps on your server

Using custom maps on your Garry's Mod server allows you to create a wonderful gaming experience....

How to change the name of your Garry's Mod server

All servers inside Garry's Mod and Steam's server list have a custom name to uniquely identify...

Installing ULX & ULIB Admin System to your Garry's Mod Server

ULX is a mod that offers an administration system to your server. This is used for the ban, kick...