Skip to content

Deploying SourceBans++

Introduction

SourceBans++ is a comprehensive game server administration and ban management system designed for Source engine games like Counter-Strike, Team Fortress 2, Garry’s Mod, and other Valve games. As an enhanced fork of the original SourceBans, it provides communities with centralized control over player bans, server admins, and administrative actions across multiple game servers.

Built with PHP and MySQL, SourceBans++ integrates with the SourceMod admin plugin system, allowing real-time synchronization between your web panel and game servers. When an admin bans a player on one server, the ban automatically propagates to all connected servers.

Key highlights of SourceBans++:

  • Centralized Ban Management: Manage bans across all your game servers from a single web interface
  • Admin Management: Assign permissions and track admin activity across servers
  • SourceMod Integration: Seamless integration with SourceMod for in-game administration
  • Ban Appeals: Built-in system for players to submit ban appeals
  • Protest System: Allow players to contest bans through the web interface
  • Server Groups: Organize servers and admins into logical groups
  • Detailed Logging: Track all administrative actions with timestamps
  • Multi-Language Support: Available in numerous languages
  • Theme Support: Customizable appearance with theme support
  • API Access: RESTful API for integration with other systems
  • Active Development: Regular updates and community contributions

This guide walks through deploying SourceBans++ on Klutch.sh using Docker and connecting it to your game servers.

Why Deploy SourceBans++ on Klutch.sh

Deploying SourceBans++ on Klutch.sh provides several advantages for game server administrators:

Simplified Deployment: Klutch.sh automatically builds and deploys your SourceBans++ instance without complex server configuration.

Persistent Storage: Your ban database, configurations, and logs persist across deployments.

HTTPS by Default: Secure access to your admin panel with automatic SSL certificates.

GitHub Integration: Version control your configuration and automatically redeploy on updates.

Scalable Resources: Allocate resources based on your community size and server count.

Environment Variable Management: Securely store database credentials without exposing them in code.

Custom Domains: Use a professional domain for your community’s admin panel.

High Availability: Keep your ban system accessible 24/7 for all your game servers.

Prerequisites

Before deploying SourceBans++ on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • MySQL/MariaDB database (can be deployed on Klutch.sh or external)
  • SourceMod installed on your game servers
  • Basic familiarity with Docker and game server administration
  • (Optional) A custom domain for your SourceBans++ instance

Deploying SourceBans++ on Klutch.sh

    Create a GitHub Repository

    Create a new GitHub repository for your SourceBans++ deployment configuration.

    Create Your Dockerfile

    Create a Dockerfile in your repository root:

    FROM php:8.1-apache
    # Install required PHP extensions
    RUN apt-get update && apt-get install -y \
    libpng-dev \
    libjpeg-dev \
    libfreetype6-dev \
    libzip-dev \
    unzip \
    git \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install gd mysqli pdo pdo_mysql zip \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
    # Enable Apache mod_rewrite
    RUN a2enmod rewrite
    # Clone SourceBans++
    RUN git clone https://github.com/sbpp/sourcebans-pp.git /var/www/html/sourcebans
    # Set proper permissions
    RUN chown -R www-data:www-data /var/www/html/sourcebans \
    && chmod -R 755 /var/www/html/sourcebans
    # Configure Apache
    RUN echo '<Directory /var/www/html/sourcebans>\n\
    AllowOverride All\n\
    Require all granted\n\
    </Directory>' > /etc/apache2/conf-available/sourcebans.conf \
    && a2enconf sourcebans
    WORKDIR /var/www/html/sourcebans/web
    EXPOSE 80
    HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
    CMD curl -f http://localhost/install/ || curl -f http://localhost/ || exit 1

    Push Your Repository to GitHub

    Commit and push your Dockerfile to GitHub.

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project named “sourcebans” or similar.

    Create a New App

    Within your project, create a new app and connect your GitHub repository.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 80

    Set Environment Variables

    Configure the following environment variables:

    VariableValue
    DB_HOSTYour MySQL database host
    DB_PORT3306
    DB_NAMEsourcebans
    DB_USERYour database username
    DB_PASSYour database password

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /var/www/html/sourcebans/web/images5 GBUploaded images and avatars
    /var/www/html/sourcebans/web/themes1 GBCustom themes

    Deploy Your Application

    Click Deploy to build and start SourceBans++.

    Complete Web Installation

    Access your deployment at https://your-app-name.klutch.sh/install/ and complete the setup wizard with your database credentials.

Initial Configuration

Database Setup

Before running the installer, create your MySQL database:

CREATE DATABASE sourcebans CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'sourcebans'@'%' IDENTIFIED BY 'your_secure_password';
GRANT ALL PRIVILEGES ON sourcebans.* TO 'sourcebans'@'%';
FLUSH PRIVILEGES;

Connecting Game Servers

After installation, add your game servers:

  1. Navigate to Servers in the admin panel
  2. Click Add Server
  3. Enter server IP, port, and RCON password
  4. Configure server group membership

SourceMod Plugin Setup

Install the SourceBans++ plugin on your game servers:

  1. Download the SourceMod plugin from the SourceBans++ releases
  2. Extract to your server’s addons/sourcemod/ directory
  3. Configure sourcebans.cfg with your SourceBans++ URL
  4. Restart your game server

Admin Management

Adding Admins

  1. Go to Admins section
  2. Click Add Admin
  3. Enter Steam ID and select permissions
  4. Assign to appropriate server groups

Permission Flags

FlagPermission
zRoot access (all permissions)
aReserved slot
bGeneric admin
cKick players
dBan players
eUnban players

Troubleshooting

Database Connection Failed

  • Verify MySQL credentials are correct
  • Ensure database server allows remote connections
  • Check that the database exists and user has proper permissions

Servers Not Syncing

  • Verify RCON password is correct
  • Check firewall allows connections to game server
  • Ensure SourceMod plugin is properly configured

Bans Not Propagating

  • Confirm all servers are connected to SourceBans++
  • Check server group configurations
  • Review SourceMod plugin logs for errors

Additional Resources

Conclusion

Deploying SourceBans++ on Klutch.sh gives you a powerful, centralized ban management system for your gaming community. With automatic builds, persistent storage, and secure HTTPS access, you can focus on managing your community rather than server infrastructure. Whether you run a single game server or a network of servers across multiple games, SourceBans++ on Klutch.sh provides the foundation for effective player and admin management.