Introduction
In this tutorial, we will see how to install GMod on your VPS under Linux. We will use the LinuxGSM software to create and launch our server. This tutorial is functional on Debian, Ubuntu and CentOS.
Installation of LinuxGSM
To install LinuxGSM on your VPS, follow this tutorial by clicking here. Once the dependencies are installed, we can install our GMod VPS.
Install Garry's Mod on a VPS
- Log in as root on your VPS server.
- Create a user for your GMod server, with the command:
adduser gmodserver
- Once the user is created, connect to this user with the command:
su - gmodserver
- Download and run the LinuxGSM installation script:
wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh gmodserver
- Start the installation of the GMOD Server:
./gmodserver install
Your Garry's Mod VPS is now installed !
List of GMod server commands
List of all the commands available
To display a list of all available commands, enter: ./gmodserver
Main actions of a Garry's Mod Server
-
Start the server:
./gmodserver start
-
Stop the server:
./gmodserver stop
-
Restart:
./gmodserver restart
-
See the console logs:
./gmodserver console
-
To leave the console, press CTRL + B
-
To stop the server, press CTRL + C
Update your server
To update your server: ./gmodserver update
The update command checks if a GMod update is available and applies it if necessary. The server will only restart if necessary.
You can also force the update: ./gmodserver force-update
Finally, you can run a file integrity check of the game with : ./gmodserver validate
Debugging
You can get all important and useful details about the server such as passwords, ports, configuration files with the command: ./gmodserver details
Debug
Use the debug mode to help you if you encounter problems.
This mode allows you to see the output of the GMod server directly on your terminal, allowing you to diagnose any problems you may encounter, use the command: ./gmodserver debug
Logs
Garry's Mod server logs are available in: /home/gmodserver/logs
Server backup
You can create a full backup of your GMod server with the command: ./gmodserver backup
Monitor
To monitor your GMod server and restart it automatically, you can use cronjobs to set up monitoring with: ./gmodserver monitor
Go further
For more information on configuring your GMod server with LinuxGSM, see the Configuration Files page.
For detailed documentation, see the official documentation.