Deploying Sharry
Introduction
Sharry is a self-hosted file sharing application that makes it easy to share files with others securely. Unlike cloud storage services, Sharry focuses specifically on the use case of sharing files through expiring links, with features like password protection, download limits, and resumable uploads for large files.
Built with Scala on the backend and Elm on the frontend, Sharry provides a clean, responsive interface for uploading and sharing files. The application supports multiple authentication methods, including OAuth2 for SSO integration, and can store files on the local filesystem or in compatible object storage.
Key highlights of Sharry:
- Resumable Uploads: Chunked uploads that can resume after interruptions
- Expiring Links: Set expiration times and download limits
- Password Protection: Add passwords to shared files
- Multiple Users: Support for accounts with quotas
- Share Aliases: Receive files from others via personalized URLs
- OAuth2/OIDC: SSO integration with identity providers
- Email Notifications: Notify recipients when files are shared
- File Previews: Preview images and documents in browser
- Storage Backends: Local filesystem or S3-compatible storage
- 100% Open Source: Licensed under GPL-3.0
This guide walks through deploying Sharry on Klutch.sh using Docker, configuring authentication, and setting up secure file sharing.
Why Deploy Sharry on Klutch.sh
Deploying Sharry on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh handles container orchestration without complex JVM setup.
Persistent Storage: Attach persistent volumes for file storage and database.
HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure file transfers.
Scalable Resources: Allocate memory and CPU based on file sizes and user load.
Custom Domains: Use your own domain for professional file sharing.
Prerequisites
Before deploying Sharry on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Sharry configuration
- Basic familiarity with Docker and containerization concepts
- (Optional) A PostgreSQL database for multi-instance deployments
Preparing Your Repository
Create a GitHub repository with your Sharry configuration.
Repository Structure
sharry-deploy/├── Dockerfile├── sharry.conf└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM eikek/sharry:latest
# Copy custom configurationCOPY sharry.conf /opt/sharry.conf
# Environment variablesENV SHARRY_BASE_URL=${SHARRY_BASE_URL}ENV SHARRY_BIND_ADDRESS=0.0.0.0ENV SHARRY_BIND_PORT=9090
# Expose the web interface portEXPOSE 9090
# Start Sharry with custom configCMD ["/opt/sharry.conf"]Creating the Configuration File
Create a sharry.conf file:
sharry.restserver { # Base URL of your Sharry instance base-url = ${?SHARRY_BASE_URL}
bind { address = "0.0.0.0" port = 9090 }
# Backend settings backend { # Authentication auth { # Fixed accounts (for simple setup) fixed { enabled = true user = "admin" password = ${?SHARRY_ADMIN_PASSWORD} order = 10 }
# OAuth2 (optional) oauth = [] }
# Database - H2 for single instance jdbc { url = "jdbc:h2:/data/sharry.db;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE" user = "sa" password = "" }
# File storage files { default-store = "database" stores = { database = { enabled = true type = "default-database" } filesystem = { enabled = true type = "file-system" directory = "/data/files" } } }
# Share settings share { max-size = "1.5 GB" max-validity = "365 days" }
# Signup settings signup { mode = "closed" invite-time = "7 days" } }}Environment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
SHARRY_BASE_URL | Yes | - | Public URL of your Sharry instance |
SHARRY_ADMIN_PASSWORD | Yes | - | Password for the admin account |
SHARRY_DB_URL | No | H2 | JDBC URL for database |
SHARRY_MAX_SIZE | No | 1.5GB | Maximum file size for uploads |
JAVA_OPTS | No | - | JVM options for memory tuning |
Deploying Sharry on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 9090
Push Your Repository to GitHub
Initialize and push your repository:
git initgit add Dockerfile sharry.conf .dockerignoregit commit -m "Initial Sharry deployment configuration"git remote add origin https://github.com/yourusername/sharry-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project with a descriptive name like “sharry” or “file-sharing”.
Create a New App
Within your project, create a new app. Connect your GitHub account and select your Sharry repository.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
SHARRY_BASE_URL | https://your-app-name.klutch.sh |
SHARRY_ADMIN_PASSWORD | Secure admin password |
JAVA_OPTS | -Xmx512m (adjust for your needs) |
Attach Persistent Volumes
Add the following volume:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/data | 50+ GB | Database and file storage |
Deploy Your Application
Click Deploy to start the build process.
Access Sharry
Once deployment completes, access your Sharry instance at https://your-app-name.klutch.sh.
Using Sharry
Uploading Files
- Log in to Sharry
- Click Upload
- Drag and drop files or click to browse
- Configure share settings:
- Expiration time
- Maximum downloads
- Password (optional)
- Click Submit
- Copy the share link
Receiving Files (Aliases)
- Go to Aliases in the menu
- Create a new alias with a custom name
- Share the alias URL with others
- Others can upload files to your account via the alias
Managing Shares
- Go to Shares to see all your shared files
- View download statistics
- Extend expiration if needed
- Delete shares
Account Management
Admins can manage users through the configuration file or enable signup modes:
- Closed: Only admins create accounts
- Open: Anyone can sign up
- Invite: Users need invitation links
Advanced Configuration
Email Notifications
Add SMTP configuration to sharry.conf:
backend { mail { enabled = true smtp { host = "smtp.example.com" port = 587 user = "user@example.com" password = "password" ssl-type = "starttls" } }}OAuth2 Authentication
Add OAuth2 providers in the configuration:
auth { oauth = [ { enabled = true id = "keycloak" name = "Keycloak" authorize-url = "https://keycloak.example.com/auth/realms/master/protocol/openid-connect/auth" token-url = "https://keycloak.example.com/auth/realms/master/protocol/openid-connect/token" user-url = "https://keycloak.example.com/auth/realms/master/protocol/openid-connect/userinfo" client-id = "sharry" client-secret = ${?OAUTH_CLIENT_SECRET} } ]}Troubleshooting
Upload Fails
Symptoms: Large file uploads fail or timeout.
Solutions:
- Check file size against configured maximum
- Verify sufficient disk space
- Increase JVM memory with
JAVA_OPTS - Check network timeout settings
Cannot Log In
Symptoms: Login fails with correct credentials.
Solutions:
- Verify password in configuration
- Check database connectivity
- Clear browser cookies
- Review server logs
Additional Resources
Conclusion
Deploying Sharry on Klutch.sh gives you a powerful, self-hosted file sharing solution with enterprise features like OAuth2 integration and resumable uploads. With expiring links, password protection, and receive aliases, Sharry provides everything needed for secure file exchange while keeping your data under your control.