Skip to content

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
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM rhodecode/rhodecode-community:latest
# Set environment variables
ENV RC_APP_HOST=0.0.0.0
ENV RC_APP_PORT=5000
ENV RC_DB_URL=${RC_DB_URL}
ENV RC_APP_SECRET=${RC_APP_SECRET}
# Create necessary directories
RUN mkdir -p /home/rhodecode/repos \
&& mkdir -p /home/rhodecode/.rccontrol
# Expose the web interface port
EXPOSE 5000
# The base image includes the default entrypoint

Environment Variables Reference

VariableRequiredDescription
RC_DB_URLYesDatabase URL (e.g., postgresql://user:pass@host/rhodecode)
RC_APP_SECRETYesApplication secret key
RC_APP_HOSTNoBind address (default: 0.0.0.0)
RC_APP_PORTNoApplication port (default: 5000)

Deploying RhodeCode on Klutch.sh

    Generate Application Secret

    Create a secure application secret:

    Terminal window
    openssl rand -hex 32

    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 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:

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

    Set Environment Variables

    Add the following environment variables:

    VariableValue
    RC_DB_URLpostgresql://user:pass@host/rhodecode
    RC_APP_SECRETYour generated secret

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /home/rhodecode/repos50+ GBGit and Mercurial repositories
    /home/rhodecode/.rccontrol5 GBConfiguration 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

  1. Navigate to your RhodeCode URL
  2. Complete the setup wizard
  3. Create your administrator account

Creating Repositories

  1. Click + New Repository
  2. Choose repository type (Git or Mercurial)
  3. Configure repository settings
  4. Initialize or push existing code

Setting Up Repository Groups

  1. Go to Admin > Repository Groups
  2. Create groups for organizing repositories
  3. Set group-level permissions

Configuring Permissions

  1. Navigate to Admin > Permissions
  2. Set default permissions for new users
  3. 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.