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
- Log into DeployHQ
- Click "New Project"
- Enter project details:
- Name:
GMOD-Server
- Repository type: Select your repository (GitHub/BitBucket/etc.)
- Connect your repository
- Name:
Step 2: Configure Server Connection
- Go to "Servers" in your project
- Click "Add Server"
- 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
- Name:
Step 3: Configure Deployment Settings
- Go to "Configuration" → "Deployment Config"
- 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
- Go to "Automatic Deployments"
- Enable automatic deployments for your branch:
- Branch:
main
(or your preferred branch) - Environment:
Production
- Server:
Physgun-GMOD
- Branch:
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
- Go to "Notifications"
- 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:
- Check server logs for errors
- Verify server startup
- Test server connection
- Confirm addon functionality
Rollback Procedure
If deployment fails:
- Go to "Deployments"
- Find the last successful deployment
- Click "Rollback"
- Confirm rollback action
Best Practices
- Always test changes locally before deployment
- Use staging environment for testing
- Keep backups of critical files
- Monitor server resources during deployment
- 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
- Use SSH keys instead of passwords when possible
- Restrict file permissions appropriately
- Keep sensitive configs in environment variables
- Regular security updates for addons
Support
For deployment issues:
- DeployHQ Support: support@deployhq.com
- Physgun Support: (Physgun support contact)