Skip to content

Deploying Stash

Introduction

Stash is a self-hosted web-based application for organizing and serving your adult media collection. It provides powerful tools for cataloging, tagging, and streaming video content while automatically fetching metadata from various sources.

Built with Go and featuring a modern React frontend, Stash offers features typically found in commercial media managers while remaining completely free and self-hosted. The application emphasizes privacy and gives you complete control over your content and data.

Key highlights of Stash:

  • Media Organization: Organize videos, images, and galleries
  • Automatic Metadata: Fetch information from multiple scrapers
  • Powerful Tagging: Tag performers, studios, and content
  • Streaming Support: Built-in video player with transcoding
  • Scene Detection: Automatic scene fingerprinting
  • Image Galleries: Support for image collections
  • Filter and Search: Advanced filtering capabilities
  • GraphQL API: Full API for automation and integration
  • Plugin System: Extend functionality with plugins
  • Theme Support: Customizable interface
  • DLNA Support: Stream to compatible devices
  • Open Source: AGPLv3 licensed

This guide walks through deploying Stash on Klutch.sh using Docker for private media management.

Why Deploy Stash on Klutch.sh

Deploying Stash on Klutch.sh provides several advantages:

Simplified Deployment: Klutch.sh handles the container deployment automatically.

Persistent Storage: Your media library, database, and configurations persist.

HTTPS by Default: Secure access to your library with automatic SSL.

GitHub Integration: Version control your configuration and deploy updates automatically.

Scalable Resources: Allocate resources based on library size and streaming needs.

Custom Domains: Access your library from a private URL.

Always Available: Access your collection from anywhere.

Privacy: Keep your media on infrastructure you control.

Prerequisites

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

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • Basic familiarity with Docker
  • Media files to organize (can be uploaded after deployment)
  • (Optional) A custom domain

Deploying Stash on Klutch.sh

    Create a GitHub Repository

    Create a new GitHub repository for your Stash deployment.

    Create Your Dockerfile

    Create a Dockerfile in your repository:

    FROM stashapp/stash:latest
    # Set environment variables
    ENV STASH_STASH=/data/
    ENV STASH_GENERATED=/generated/
    ENV STASH_METADATA=/metadata/
    ENV STASH_CACHE=/cache/
    ENV STASH_PORT=9999
    # Create data directories
    RUN mkdir -p /data /generated /metadata /cache /config
    EXPOSE 9999
    HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
    CMD wget --no-verbose --tries=1 --spider http://localhost:9999/ || exit 1

    Push Your Repository to GitHub

    Commit and push your Dockerfile.

    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 and connect your GitHub repository.

    Configure HTTP Traffic

    In the deployment settings:

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

    Set Environment Variables

    Configure the following environment variables:

    VariableValue
    STASH_STASH/data/
    STASH_GENERATED/generated/
    STASH_METADATA/metadata/
    STASH_CACHE/cache/

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /data500+ GBMedia files (adjust based on collection)
    /generated50 GBGenerated screenshots and previews
    /metadata5 GBDatabase and metadata
    /cache20 GBTranscoding cache
    /config1 GBConfiguration files

    Deploy Your Application

    Click Deploy to build and start Stash.

    Access Stash

    Once deployment completes, access Stash at https://your-app-name.klutch.sh.

Initial Configuration

First-Time Setup

On first access:

  1. Set up authentication (recommended)
  2. Configure media library paths
  3. Set generated content locations
  4. Configure scraper sources

Setting Up Authentication

  1. Navigate to Settings then Security
  2. Enable authentication
  3. Create username and password
  4. Configure session timeout

Library Configuration

Configure where Stash looks for media:

  1. Go to Settings then Library
  2. Add paths to your media directories
  3. Configure file naming preferences
  4. Set scan options

Organizing Content

Scanning Library

Trigger a library scan:

  1. Navigate to Tasks
  2. Click Scan
  3. Wait for scan to complete
  4. Review discovered content

Tagging Content

Organize with tags:

  1. View a scene or performer
  2. Add relevant tags
  3. Create custom tags as needed
  4. Use batch editing for multiple items

Performer Management

Track performers:

  1. Navigate to Performers
  2. Add performer details
  3. Link to scenes
  4. Fetch metadata from scrapers

Studio Organization

Organize by studio:

  1. Create studio entries
  2. Associate content with studios
  3. Track studio catalogs

Metadata Scrapers

Built-in Scrapers

Stash includes scrapers for various metadata sources:

  1. Go to Settings then Metadata Providers
  2. Enable desired scrapers
  3. Configure scraper settings
  4. Run automatic scraping

Scraping Content

Fetch metadata:

  1. Select scenes to scrape
  2. Choose metadata source
  3. Review suggested matches
  4. Apply metadata

Custom Scrapers

Install community scrapers:

  1. Download scraper definition
  2. Place in scrapers directory
  3. Restart Stash
  4. Configure new scraper

Streaming and Playback

Built-in Player

Stash includes a video player:

  • Stream directly in browser
  • Chapter support
  • Speed control
  • Subtitle support

Transcoding

Configure transcoding for compatibility:

  1. Go to Settings then Transcoding
  2. Set transcoding parameters
  3. Configure hardware acceleration if available
  4. Set cache limits

DLNA Server

Stream to compatible devices:

  1. Enable DLNA in settings
  2. Configure network interface
  3. Discover Stash from DLNA clients

Plugins and Themes

Installing Plugins

Extend functionality:

  1. Go to Settings then Plugins
  2. Browse available plugins
  3. Install desired plugins
  4. Configure plugin settings

Custom Themes

Change the interface appearance:

  1. Navigate to Settings then Interface
  2. Select theme
  3. Apply custom CSS if desired

Backup and Maintenance

Database Backup

Protect your organization work:

  1. Navigate to Settings then Tasks
  2. Click Backup Database
  3. Download backup file
  4. Store securely off-site

Cache Management

Manage disk usage:

  1. Go to Tasks
  2. Clear old cache entries
  3. Regenerate thumbnails if needed
  4. Monitor disk usage

Troubleshooting

Scan Not Finding Files

  • Verify path configuration
  • Check file permissions
  • Confirm supported file formats
  • Review scan logs

Metadata Not Matching

  • Try alternative scrapers
  • Manually search for content
  • Use fingerprint matching
  • Edit metadata directly

Streaming Issues

  • Check transcoding settings
  • Verify browser codec support
  • Monitor CPU usage
  • Adjust quality settings

Additional Resources

Conclusion

Deploying Stash on Klutch.sh gives you a powerful, private media organizer with automatic metadata, streaming capabilities, and extensive customization options. With persistent storage, secure HTTPS access, and always-on availability, you can access your organized collection from anywhere while maintaining complete control over your data.