Header

Deploy GMOD Server on Physgun

Overview

This guide covers deploying a Garry's Mod (GMOD) server using DeployHQ to Physgun hosting. Ensure you have an active Physgun hosting account and DeployHQ account before proceeding.

Prerequisites

  • Active Physgun hosting account
  • DeployHQ account
  • GMOD server files ready for deployment
  • SFTP/SSH access credentials from Physgun

Step 1: Project Setup in DeployHQ

  1. Log into DeployHQ
  2. Click "New Project"
  3. Enter project details:
    • Name: GMOD-Server
    • Repository type: Select your repository (GitHub/BitBucket/etc.)
    • Connect your repository

Step 2: Configure Server Connection

  1. Go to "Servers" in your project
  2. Click "Add Server"
  3. Enter Physgun server details:
    • Name: Physgun-GMOD
    • Protocol: SFTP
    • Hostname: (Your Physgun server hostname)
    • Port: 22 (default)
    • Username: (Your Physgun SFTP username)
    • Authentication: Password/SSH Key
    • Deploy Path: /home/gmod/server

Step 3: Configure Deployment Settings

  1. Go to "Configuration" → "Deployment Config"
  2. Set up deployment rules:
# Exclude unnecessary files
exclude:
  - .git/
  - .gitignore
  - README.md
  - docs/

# Include essential GMOD files
include:
  - addons/
  - gamemodes/
  - lua/
  - maps/
  - cfg/

Step 4: Configure Build Commands

Add the following build commands if needed:

# Compress custom addons
zip -r custom_addons.zip addons/*

# Set file permissions
chmod -R 755 lua/
chmod -R 755 gamemodes/

Step 5: Configure Automatic Deployments

  1. Go to "Automatic Deployments"
  2. Enable automatic deployments for your branch:
    • Branch: main (or your preferred branch)
    • Environment: Production
    • Server: Physgun-GMOD

Step 6: Post-Deployment Scripts

Add these post-deployment commands:

# Restart GMOD server
./srcds_run -game garrysmod +maxplayers 32 +map gm_construct

# Clear cache
rm -rf garrysmod/cache/*

Step 7: Configure Notifications

  1. Go to "Notifications"
  2. Set up Discord/Slack notifications for:
    • Deployment starts
    • Successful deployments
    • Failed deployments

Important Files to Monitor

/garrysmod/cfg/server.cfg
/garrysmod/data/
/garrysmod/addons/
/garrysmod/lua/

Deployment Verification

After deployment:

  1. Check server logs for errors
  2. Verify server startup
  3. Test server connection
  4. Confirm addon functionality

Rollback Procedure

If deployment fails:

  1. Go to "Deployments"
  2. Find the last successful deployment
  3. Click "Rollback"
  4. Confirm rollback action

Best Practices

  1. Always test changes locally before deployment
  2. Use staging environment for testing
  3. Keep backups of critical files
  4. Monitor server resources during deployment
  5. Document custom add-on configurations

Troubleshooting

Common issues and solutions:

  • Permission errors: Check SFTP user permissions
  • Failed connections: Verify Physgun firewall settings
  • Missing files: Check repository structure
  • Server crashes: Review logs in /garrysmod/logs/

Security Considerations

  1. Use SSH keys instead of passwords when possible
  2. Restrict file permissions appropriately
  3. Keep sensitive configs in environment variables
  4. Regular security updates for addons

Support

For deployment issues:

Additional Resources

Tree

Proudly powered by Katapult. Running on 100% renewable energy.