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
- Visit the GitHub releases page
- Download the appropriate binary for your platform:
- Linux:
gmsv_mongo_linux.dllorgmsv_mongo_linux64.dll - Windows:
gmsv_mongo_win32.dllorgmsv_mongo_win64.dll
- Linux:
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:
- Verify the binary is in
garrysmod/lua/bin/ - Check the binary name matches your platform
- Ensure file permissions are correct (Linux)
Connection Errors
If connection fails:
- Verify MongoDB is running:
mongosh --eval "db.serverStatus()" - Check firewall allows port 27017
- 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
- Configuration - Set up connection options
- First Steps - Write your first MongoDB code