Garry's Mod
Garry's Mod

Creating Your Own Server (Basic Setup)

Create your own Garry's Mod server. Learn basic setup, download dedicated server files, configure settings, and launch your private game.

5.9. Creating Your Own Server (Basic Setup)

Hosting your own Garry's Mod server allows you to create a personalized gaming experience for yourself and your friends, free from the constraints of public servers. Whether you want a private space for building, a dedicated roleplaying environment, or a place to test your addons, setting up a basic server is achievable with a few key steps.

Setting up a Garry's Mod server involves downloading the dedicated server files, configuring essential settings, and launching the server executable. While advanced configurations can become complex, the basic setup is straightforward. You'll need to ensure your server files are correctly installed and that your network settings allow players to connect. This guide will walk you through the fundamental steps to get your own server up and running.

Prerequisites:

  • Steam Account: You need a Steam account to download the dedicated server files.
  • Garry's Mod Installation: While not strictly necessary for the server itself, having Garry's Mod installed helps in testing and understanding server configurations.
  • Sufficient Disk Space: Dedicated server files and any addons you plan to install will require space.

Steps to Set Up a Basic Server:

  1. Download the Garry's Mod Dedicated Server:
    • Open your Steam library.
    • Go to the "Tools" section.
    • Search for "Garry's Mod Dedicated Server."
    • Install it. This will download the necessary server files.
  2. Locate the Server Files: The dedicated server files are usually installed in a separate directory, often within `Steam/steamapps/common/GarrysModDedicatedServer`.
  3. Create a Server Configuration Folder: Inside the dedicated server directory, create a new folder named `garrysmod`. This folder will hold your server's configuration files, addons, and maps.
  4. Configure `server.cfg` (Basic Settings):
    • Inside the `garrysmod` folder you just created, create a new text file named `server.cfg`.
    • Open `server.cfg` with a text editor (like Notepad) and add basic commands. Here are some essential ones:
      hostname "My Awesome GMod Server"
      sv_lan 1 -- Set to 0 for internet play, 1 for LAN only
      rcon_password "your_rcon_password"
      password "your_server_password" -- Optional: set a password to join
      sv_cheats 0 -- Set to 1 for testing, but generally 0 for public servers
      sv_allowcslua 1 -- Allows client-side Lua scripts to run on the server
      
  5. Create a Start Script:
    • In the main dedicated server directory (where `srcds.exe` is located), create a new text file named `start.bat`.
    • Open `start.bat` and add the following command:
      srcds.exe -game garrysmod +map gm_construct +maxplayers 16 -port 27015
      • `-game garrysmod`: Specifies the game to run.
      • `+map gm_construct`: Sets the default map to load.
      • `+maxplayers 16`: Sets the maximum number of players.
      • `-port 27015`: Sets the server port (default is 27015).
  6. Launch the Server: Double-click the `start.bat` file. A console window will appear, showing the server starting up.
  7. Connecting to Your Server:
    • If `sv_lan 1` is set: Open Garry's Mod, go to "Find Games," then "LAN." Your server should appear.
    • If `sv_lan 0` is set: You'll need to configure port forwarding on your router to allow external players to connect. This process varies by router model. You'll also need to provide your public IP address to your friends.

Adding Addons and Maps:

To add addons or custom maps, place their respective files (e.g., `.gma` files for addons, `.bsp` files for maps) into the corresponding folders within your `garrysmod` directory (`garrysmod/addons/` and `garrysmod/maps/`).

Setting up a server is a rewarding process that gives you complete control over your Garry's Mod experience.