Getting Started

Installation

Download and install gmsv_mongo on your Garry's Mod server

Installation

This guide covers how to download and install gmsv_mongo on your Garry's Mod server.

Prerequisites

Before installing gmsv_mongo, ensure you have:

  • A Garry's Mod dedicated server
  • MongoDB server (local or remote, version 4.0+)
  • Basic knowledge of Lua scripting

Download

From GitHub Releases

  1. Visit the GitHub releases page
  2. Download the appropriate binary for your platform:
    • Linux: gmsv_mongo_linux.dll or gmsv_mongo_linux64.dll
    • Windows: gmsv_mongo_win32.dll or gmsv_mongo_win64.dll

Building from Source

If you prefer to build from source:

# Clone the repository
git clone https://github.com/feeeedox/gmsv_mongo.git
cd gmsv_mongo

# Build for your platform
cargo build --release

# The binary will be in target/release/

Installation Steps

Step 1: Locate Your Server Directory

Find your Garry's Mod server installation:

  • Linux: Usually /home/steam/gmodserver/garrysmod/
  • Windows: Usually C:\gmodserver\garrysmod\

Step 2: Create the Modules Directory

Create the lua/bin directory if it doesn't exist:

mkdir -p garrysmod/lua/bin

Step 3: Copy the Binary

Copy the downloaded binary to the lua/bin directory:

# Linux
cp gmsv_mongo_linux64.dll garrysmod/lua/bin/

# Windows
copy gmsv_mongo_win64.dll garrysmod\lua\bin\

The binary name must start with gmsv_ and match your platform architecture.

Step 4: Verify Installation

Start your server and check the console output:

Loading gmsv_mongo v2.x.x...
MongoDB module loaded successfully!

Or verify in Lua:

require("mongo")
print("MongoDB Version:", MongoDB.Version())

Troubleshooting

Module Not Found

If you see "Module not found" errors:

  1. Verify the binary is in garrysmod/lua/bin/
  2. Check the binary name matches your platform
  3. Ensure file permissions are correct (Linux)

Connection Errors

If connection fails:

  1. Verify MongoDB is running: mongosh --eval "db.serverStatus()"
  2. Check firewall allows port 27017
  3. Verify connection string format

Library Dependencies (Linux)

On Linux, you may need additional libraries:

# Debian/Ubuntu
sudo apt-get install libssl-dev

# CentOS/RHEL
sudo yum install openssl-devel

Next Steps