Deploying SCM Manager
Introduction
SCM Manager is a self-hosted source code management platform that provides a unified interface for managing Git, Mercurial, and Subversion repositories. It offers a modern web interface with powerful features for code collaboration, access control, and repository management without the complexity of larger platforms.
Built with Java and React, SCM Manager delivers enterprise-grade features in a lightweight package. The plugin architecture allows extending functionality while keeping the core installation minimal. Whether you need simple repository hosting or advanced features like pull requests and code review, SCM Manager scales to meet your needs.
Key highlights of SCM Manager:
- Multi-SCM Support: Native support for Git, Mercurial, and Subversion in a single platform
- Plugin Architecture: Extend functionality with 50+ available plugins
- Pull Request Workflow: Built-in pull request and code review capabilities
- Fine-Grained Permissions: Repository, branch, and path-level access control
- LDAP/Active Directory: Enterprise authentication integration
- Repository Mirroring: Mirror external repositories automatically
- Webhook Support: Trigger external services on repository events
- Branch Protection: Prevent direct pushes and require reviews
- Code Search: Full-text search across repository contents
- API Access: REST API for automation and integration
- Audit Logging: Track all repository and user actions
- Anonymous Access: Optionally allow public repository access
This guide walks through deploying SCM Manager on Klutch.sh using Docker, configuring persistent storage for your repositories, and setting up the platform for team collaboration.
Why Deploy SCM Manager on Klutch.sh
Deploying SCM Manager on Klutch.sh provides several advantages for development teams:
Simplified Deployment: Klutch.sh automatically builds your SCM Manager configuration without complex server setup. Push to GitHub for automatic deployment.
Persistent Storage: Attach persistent volumes for your repositories and configuration. Your code and settings survive container restarts.
HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure access to your repositories and encrypted git operations.
GitHub Integration: Store your deployment configuration in version control. Changes trigger automatic redeployments.
Scalable Resources: Allocate CPU and memory based on repository count and team size.
Environment Variable Management: Securely configure authentication and settings through Klutch.sh’s environment system.
Custom Domains: Assign a professional domain for your source code management platform.
Prerequisites
Before deploying SCM Manager on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your SCM Manager configuration
- Basic familiarity with Docker and containerization concepts
- (Optional) LDAP/Active Directory credentials for enterprise authentication
- (Optional) A custom domain for your SCM Manager instance
Deploying SCM Manager on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 8080
- Username:
scmadmin - Password:
scmadmin
Create Your Repository
Create a new GitHub repository for your SCM Manager deployment. Add a Dockerfile:
FROM scmmanager/scm-manager:2
ENV SCM_WEBAPP_CONTEXTPATH=/
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:8080/api/v2 || exit 1Push to GitHub
Commit and push your Dockerfile to your GitHub repository.
Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “scm-manager” or “source-control”.
Create a New App
Within your project, create a new app. Connect your GitHub account and select your repository.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
JAVA_OPTS | -Xmx512m -Xms256m (adjust based on needs) |
SCM_WEBAPP_CONTEXTPATH | / |
Attach Persistent Volumes
Add the following volumes for data persistence:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/var/lib/scm | 50+ GB | Repositories and application data |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will build the container, attach volumes, and provision HTTPS.
Access SCM Manager
Once deployment completes, access your SCM Manager instance at the provided URL. The default credentials are:
Change the default password immediately after first login.
Initial Configuration
First Login Setup
After logging in with default credentials:
- Navigate to Administration > Settings
- Update the base URL to match your Klutch.sh domain
- Change the admin password
- Configure email settings for notifications
Installing Plugins
Extend SCM Manager with plugins:
- Go to Administration > Plugins
- Browse the available plugins catalog
- Install desired plugins (pull requests, code review, etc.)
- Restart may be required for some plugins
Recommended Plugins
- Review Plugin: Pull request and code review workflow
- SSH Plugin: SSH access to repositories
- LDAP Plugin: Enterprise directory integration
- Webhook Plugin: Trigger external services
- Editor Plugin: In-browser file editing
- CI Status Plugin: Display CI/CD status
Repository Management
Creating Repositories
Create new repositories through the web interface:
- Click Repositories in the navigation
- Click Create Repository
- Select repository type (Git, Mercurial, or Subversion)
- Enter name and optional description
- Configure initial settings
Importing Existing Repositories
Import repositories from external sources:
- Use the repository import feature
- Provide the source URL
- Configure authentication if required
- SCM Manager clones and hosts the repository
Repository Settings
Configure each repository individually:
- Permissions: Set user and group access levels
- Branch Protection: Protect important branches
- Webhooks: Configure event notifications
- Mirroring: Set up automatic synchronization
User and Access Management
Creating Users
Add team members to your SCM Manager:
- Navigate to Administration > Users
- Click Create User
- Fill in user details and credentials
- Assign to groups as needed
Group Management
Organize users into groups:
- Go to Administration > Groups
- Create groups for teams or roles
- Add users to groups
- Apply permissions at group level
Permission Model
SCM Manager supports granular permissions:
| Level | Scope |
|---|---|
| Global | Apply to all repositories |
| Repository | Apply to specific repository |
| Branch | Protect specific branches |
| Path | Control access to paths within repository |
LDAP Integration
Connect to enterprise directories:
- Install the LDAP plugin
- Configure connection settings
- Map LDAP groups to SCM Manager groups
- Enable LDAP authentication
Pull Request Workflow
Enabling Pull Requests
With the Review plugin installed:
- Create a branch for your changes
- Push commits to the branch
- Open a pull request from the web interface
- Request reviews from team members
Code Review Process
- Comments: Add inline comments on changed files
- Approvals: Approve or request changes
- Merge Requirements: Configure required approvals before merge
- CI Integration: Display build status on pull requests
Best Practices
Security Configuration
- Change Default Credentials: Update admin password immediately
- Enable HTTPS: Always use Klutch.sh’s automatic SSL
- Regular Updates: Keep SCM Manager and plugins updated
- Access Reviews: Periodically review user permissions
Performance Optimization
- Memory Allocation: Adjust JAVA_OPTS based on repository count
- Volume Storage: Ensure adequate storage for repository growth
- Plugin Selection: Install only needed plugins
Backup Strategy
- Regular Backups: Back up the
/var/lib/scmvolume - Export Configuration: Export settings before major changes
- Test Restores: Periodically verify backup integrity
Troubleshooting
Repository Access Issues
- Verify user permissions on the repository
- Check group memberships
- Review authentication settings
- Examine access logs
Performance Problems
- Increase Java heap size in JAVA_OPTS
- Check volume I/O performance
- Review plugin resource usage
- Monitor memory consumption
Plugin Conflicts
- Disable recently installed plugins
- Check plugin compatibility
- Review plugin logs for errors
Additional Resources
- SCM Manager Official Website
- SCM Manager Documentation
- SCM Manager Plugin Directory
- SCM Manager GitHub Repository
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying SCM Manager on Klutch.sh provides a powerful, self-hosted source code management platform for your team. With support for multiple SCM systems, flexible permissions, and extensible plugin architecture, SCM Manager offers enterprise features in a lightweight package. Combined with Klutch.sh’s automatic HTTPS and persistent storage, you get a reliable, secure platform for managing your source code.