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
- Select HTTP as the traffic type
- Set the internal port to 9999
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 variablesENV STASH_STASH=/data/ENV STASH_GENERATED=/generated/ENV STASH_METADATA=/metadata/ENV STASH_CACHE=/cache/ENV STASH_PORT=9999
# Create data directoriesRUN 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 1Push 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:
Set Environment Variables
Configure the following environment variables:
| Variable | Value |
|---|---|
STASH_STASH | /data/ |
STASH_GENERATED | /generated/ |
STASH_METADATA | /metadata/ |
STASH_CACHE | /cache/ |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/data | 500+ GB | Media files (adjust based on collection) |
/generated | 50 GB | Generated screenshots and previews |
/metadata | 5 GB | Database and metadata |
/cache | 20 GB | Transcoding cache |
/config | 1 GB | Configuration 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:
- Set up authentication (recommended)
- Configure media library paths
- Set generated content locations
- Configure scraper sources
Setting Up Authentication
- Navigate to Settings then Security
- Enable authentication
- Create username and password
- Configure session timeout
Library Configuration
Configure where Stash looks for media:
- Go to Settings then Library
- Add paths to your media directories
- Configure file naming preferences
- Set scan options
Organizing Content
Scanning Library
Trigger a library scan:
- Navigate to Tasks
- Click Scan
- Wait for scan to complete
- Review discovered content
Tagging Content
Organize with tags:
- View a scene or performer
- Add relevant tags
- Create custom tags as needed
- Use batch editing for multiple items
Performer Management
Track performers:
- Navigate to Performers
- Add performer details
- Link to scenes
- Fetch metadata from scrapers
Studio Organization
Organize by studio:
- Create studio entries
- Associate content with studios
- Track studio catalogs
Metadata Scrapers
Built-in Scrapers
Stash includes scrapers for various metadata sources:
- Go to Settings then Metadata Providers
- Enable desired scrapers
- Configure scraper settings
- Run automatic scraping
Scraping Content
Fetch metadata:
- Select scenes to scrape
- Choose metadata source
- Review suggested matches
- Apply metadata
Custom Scrapers
Install community scrapers:
- Download scraper definition
- Place in scrapers directory
- Restart Stash
- 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:
- Go to Settings then Transcoding
- Set transcoding parameters
- Configure hardware acceleration if available
- Set cache limits
DLNA Server
Stream to compatible devices:
- Enable DLNA in settings
- Configure network interface
- Discover Stash from DLNA clients
Plugins and Themes
Installing Plugins
Extend functionality:
- Go to Settings then Plugins
- Browse available plugins
- Install desired plugins
- Configure plugin settings
Custom Themes
Change the interface appearance:
- Navigate to Settings then Interface
- Select theme
- Apply custom CSS if desired
Backup and Maintenance
Database Backup
Protect your organization work:
- Navigate to Settings then Tasks
- Click Backup Database
- Download backup file
- Store securely off-site
Cache Management
Manage disk usage:
- Go to Tasks
- Clear old cache entries
- Regenerate thumbnails if needed
- 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
- Stash Official Site
- Stash Documentation
- Stash GitHub Repository
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
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.