Deploying RhodeCode
Introduction
RhodeCode is an enterprise source code management platform that supports both Git and Mercurial repositories. It provides a unified interface for repository hosting, code review, and team collaboration with enterprise-grade security and access control.
Key highlights of RhodeCode:
- Multi-VCS Support: Host both Git and Mercurial repositories
- Code Review: Built-in pull request and code review workflow
- Repository Management: Create, fork, and manage repositories
- Access Control: Fine-grained permissions with LDAP/AD integration
- Code Search: Full-text search across all repositories
- Gist Support: Share code snippets and notes
- SSH and HTTP Access: Multiple protocols for repository access
- Integrations: CI/CD webhooks and third-party integrations
- Repository Groups: Organize repositories hierarchically
- Audit Logging: Track all repository activities
- Open Source: Community edition available under AGPL
This guide walks through deploying RhodeCode Community Edition on Klutch.sh using Docker.
Why Deploy RhodeCode on Klutch.sh
Deploying RhodeCode on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh automatically builds and deploys RhodeCode without complex configuration.
Persistent Storage: Attach persistent volumes for repositories and configuration that survive container restarts.
HTTPS by Default: Klutch.sh provides automatic SSL for secure code access.
Environment Variable Management: Securely store database credentials through Klutch.sh.
Custom Domains: Assign a custom domain for your code hosting platform.
Prerequisites
Before deploying RhodeCode on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your RhodeCode configuration
- An external database (PostgreSQL recommended)
- Basic familiarity with Docker
Preparing Your Repository
Create a GitHub repository containing your Dockerfile for RhodeCode deployment.
Repository Structure
rhodecode-deploy/├── Dockerfile└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM rhodecode/rhodecode-community:latest
# Set environment variablesENV RC_APP_HOST=0.0.0.0ENV RC_APP_PORT=5000ENV RC_DB_URL=${RC_DB_URL}ENV RC_APP_SECRET=${RC_APP_SECRET}
# Create necessary directoriesRUN mkdir -p /home/rhodecode/repos \ && mkdir -p /home/rhodecode/.rccontrol
# Expose the web interface portEXPOSE 5000
# The base image includes the default entrypointEnvironment Variables Reference
| Variable | Required | Description |
|---|---|---|
RC_DB_URL | Yes | Database URL (e.g., postgresql://user:pass@host/rhodecode) |
RC_APP_SECRET | Yes | Application secret key |
RC_APP_HOST | No | Bind address (default: 0.0.0.0) |
RC_APP_PORT | No | Application port (default: 5000) |
Deploying RhodeCode on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 5000
Generate Application Secret
Create a secure application secret:
openssl rand -hex 32Push 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 with a descriptive name like “rhodecode”.
Create a New App
Within your project, create a new app. Connect your GitHub account and select the repository containing your RhodeCode Dockerfile.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
RC_DB_URL | postgresql://user:pass@host/rhodecode |
RC_APP_SECRET | Your generated secret |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/home/rhodecode/repos | 50+ GB | Git and Mercurial repositories |
/home/rhodecode/.rccontrol | 5 GB | Configuration and cache |
Deploy Your Application
Click Deploy to start the build process.
Access RhodeCode
Once deployment completes, access RhodeCode at your app URL.
Initial Configuration
First-Time Setup
- Navigate to your RhodeCode URL
- Complete the setup wizard
- Create your administrator account
Creating Repositories
- Click + New Repository
- Choose repository type (Git or Mercurial)
- Configure repository settings
- Initialize or push existing code
Setting Up Repository Groups
- Go to Admin > Repository Groups
- Create groups for organizing repositories
- Set group-level permissions
Configuring Permissions
- Navigate to Admin > Permissions
- Set default permissions for new users
- Configure repository and group permissions
Additional Resources
Conclusion
Deploying RhodeCode on Klutch.sh gives you an enterprise-grade source code management platform with support for both Git and Mercurial. With built-in code review, fine-grained permissions, and persistent storage, RhodeCode on Klutch.sh provides everything you need for professional code hosting.