Skip to content

Deploying Samvera Hyrax

Introduction

Samvera Hyrax is an open-source digital repository framework used by libraries, archives, and museums worldwide to manage, preserve, and provide access to digital collections. Built on Ruby on Rails with Fedora and Solr, Hyrax provides a complete solution for institutional repository needs.

The Samvera community develops Hyrax collaboratively, incorporating best practices from digital preservation, library science, and software engineering. Institutions use Hyrax for everything from thesis and dissertation repositories to research data management and special collections access.

Key highlights of Samvera Hyrax:

  • Digital Asset Management: Organize and manage digital collections
  • Preservation Ready: Built-in support for digital preservation standards
  • Flexible Metadata: Configurable metadata schemas and profiles
  • Access Control: Embargo, lease, and granular permissions
  • Multi-Tenancy: Host multiple repositories on one installation
  • Workflow Engine: Configurable mediated deposit workflows
  • Batch Ingest: Import large collections efficiently
  • IIIF Support: International Image Interoperability Framework
  • DOI Integration: Assign persistent identifiers
  • Search and Discovery: Solr-powered faceted search
  • Community Driven: Active development community

This guide walks through deploying Samvera Hyrax on Klutch.sh using Docker, configuring the repository, and managing digital collections.

Why Deploy Hyrax on Klutch.sh

Deploying Hyrax on Klutch.sh provides several advantages for digital repositories:

Simplified Deployment: Klutch.sh builds your Hyrax configuration without complex setup.

Persistent Storage: Attach volumes for Fedora repository, Solr index, and uploaded files.

HTTPS by Default: Secure access with automatic SSL certificates.

Scalable Resources: Allocate CPU and memory for indexing and access workloads.

GitHub Integration: Version control your customizations.

Always-On Access: 24/7 availability for researchers and the public.

Prerequisites

Before deploying Hyrax on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository
  • Basic familiarity with Docker and Ruby on Rails
  • PostgreSQL database
  • Redis for background jobs
  • (Optional) A custom domain for your repository

Deploying Hyrax on Klutch.sh

    Create Your Repository

    Create a new GitHub repository for your Hyrax deployment. Add a Dockerfile:

    FROM ruby:3.1
    RUN apt-get update && apt-get install -y \
    nodejs \
    npm \
    imagemagick \
    ffmpeg \
    libreoffice \
    && rm -rf /var/lib/apt/lists/*
    RUN npm install -g yarn
    WORKDIR /app
    COPY Gemfile Gemfile.lock ./
    RUN bundle install
    COPY . .
    RUN bundle exec rails assets:precompile
    ENV RAILS_ENV=production
    ENV RAILS_SERVE_STATIC_FILES=true
    ENV RAILS_LOG_TO_STDOUT=true
    EXPOSE 3000
    HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
    CMD curl -f http://localhost:3000/ || exit 1
    CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]

    Generate Hyrax Application

    Create your Hyrax application locally:

    Terminal window
    rails new my_repository -m https://raw.githubusercontent.com/samvera/hyrax/main/template.rb

    Push to GitHub

    Commit and push your Hyrax application to GitHub.

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project.

    Create a New App

    Within your project, create a new app. Connect your GitHub repository.

    Configure HTTP Traffic

    In the deployment settings:

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

    Set Environment Variables

    Configure essential settings:

    VariableValue
    RAILS_ENVproduction
    SECRET_KEY_BASEGenerate with rails secret
    DATABASE_URLPostgreSQL connection string
    REDIS_URLRedis connection string
    FEDORA_URLFedora repository URL
    SOLR_URLSolr server URL

    Attach Persistent Volumes

    Add volumes for data:

    Mount PathRecommended SizePurpose
    /app/storage500+ GBUploaded files
    /app/derivatives100 GBGenerated derivatives

    Deploy Your Application

    Click Deploy to start the build process.

    Initialize Database

    Run migrations after deployment:

    Terminal window
    bundle exec rails db:migrate

Service Dependencies

Fedora Repository

Hyrax requires Fedora for object storage:

  • Deploy Fedora 6 as a separate service
  • Configure FEDORA_URL environment variable
  • Ensure persistent storage for repository data

Solr

Configure Solr for search:

  • Deploy Solr with Hyrax config
  • Configure SOLR_URL environment variable
  • Maintain index persistence

Redis

Enable background processing:

  • Deploy Redis server
  • Configure REDIS_URL
  • Run Sidekiq workers

Initial Configuration

Creating Admin User

Set up administrator access:

# Rails console
User.create!(
email: 'admin@example.com',
password: 'secure_password',
admin: true
)

Repository Configuration

Configure repository settings:

  1. Access admin dashboard
  2. Configure appearance
  3. Set up content types
  4. Configure features

Work Types

Built-in Types

Hyrax includes default work types:

  • GenericWork: General-purpose content
  • Image: Image files with IIIF support
  • Document: Text documents and PDFs

Custom Work Types

Create specialized types:

Terminal window
rails generate hyrax:work ResearchDataset

Configure metadata and behaviors in the generated files.

Metadata Configuration

Core Metadata

Default fields include:

  • Title, creator, contributor
  • Date, description, keyword
  • Rights, license
  • Subject, language

Custom Metadata

Add fields to work types:

class ResearchDataset < ActiveFedora::Base
property :methodology, predicate: ::RDF::Vocab::DC.methodology
property :funding_source, predicate: ::RDF::Vocab::DC.contributor
end

Deposit Workflows

Self-Deposit

Enable direct deposit:

  1. Configure work types
  2. Set permissions
  3. Users deposit directly
  4. Items published immediately

Mediated Deposit

Implement review workflow:

  1. Configure workflow in admin
  2. Assign reviewers
  3. Depositors submit for review
  4. Reviewers approve or reject

Access Control

Visibility Options

Control content access:

VisibilityDescription
PublicAvailable to everyone
InstitutionAuthenticated users only
PrivateOwner and designated users

Embargo and Lease

Time-based access control:

  • Embargo: Private until date, then public
  • Lease: Public until date, then private

Collections

Creating Collections

Organize works into collections:

  1. Navigate to Collections
  2. Create new collection
  3. Add metadata
  4. Add works to collection

Collection Types

Configure collection behaviors:

  • Exhibit collections
  • Administrative sets
  • User-created collections

Batch Operations

Batch Import

Import multiple items:

  1. Prepare CSV metadata
  2. Upload files
  3. Run batch ingest
  4. Monitor progress

Batch Export

Export collections:

  • Export metadata as CSV
  • Download original files
  • Include derivatives

IIIF Integration

Image Viewing

Configure IIIF for images:

  • Enable UniversalViewer
  • Configure image server
  • Support zoom and pan

Manifests

Generate IIIF manifests:

  • Collection manifests
  • Work manifests
  • Annotation support

Customization

Theming

Customize appearance:

config/initializers/hyrax.rb
config.banner_image = 'custom_banner.jpg'
config.institution_name = 'Your Institution'

Branding

Add institutional branding:

  • Logo placement
  • Color schemes
  • Footer content

Preservation

File Characterization

Automatic file analysis:

  • FITS integration
  • Format identification
  • Technical metadata

Fixity Checking

Verify file integrity:

  • Scheduled checks
  • Report generation
  • Alert on changes

Troubleshooting

Solr Issues

  • Verify Solr connection
  • Check collection exists
  • Review index configuration
  • Reindex if needed

Fedora Problems

  • Check Fedora availability
  • Verify credentials
  • Review transaction logs
  • Monitor storage

Background Jobs

  • Check Sidekiq status
  • Review job queue
  • Monitor Redis connection
  • Check worker logs

Additional Resources

Conclusion

Deploying Samvera Hyrax on Klutch.sh provides a professional digital repository platform for your institution. With comprehensive features for digital asset management, preservation, and access, Hyrax meets the needs of libraries, archives, and research institutions. Combined with Klutch.sh’s reliable hosting and scalable storage, you can build and maintain collections that serve researchers and the public for the long term.