Deploying FileRise
Introduction
FileRise is a modern, self-hosted file sharing and upload platform that provides a secure, privacy-focused alternative to commercial file sharing services. Built with simplicity and security in mind, FileRise allows you to quickly share files with customizable expiration times, password protection, and download limits without sacrificing your data privacy to third-party services.
FileRise stands out with its focus on essential file sharing features:
- Secure File Sharing: Share files with automatic encryption and secure transfer protocols
- Customizable Expiration: Set automatic file deletion after a specified time period
- Password Protection: Add password requirements to shared files for additional security
- Download Limits: Control how many times a file can be downloaded before expiring
- Clean Interface: Modern, intuitive UI that works seamlessly across all devices
- Direct Upload: Drag-and-drop file upload with progress tracking
- Link Generation: Create shareable links instantly for easy distribution
- Anonymous Sharing: Share files without requiring user accounts
- Self-Hosted: Full control over your data with no third-party dependencies
- Lightweight: Minimal resource requirements for efficient operation
- No Registration Required: Recipients can download files without creating accounts
- Mobile-Friendly: Responsive design works perfectly on phones and tablets
Whether you need to share files with clients, collaborate with team members, or send large files to friends and family, FileRise provides a secure, simple solution that respects privacy and gives you complete control over your shared content.
This comprehensive guide walks you through deploying FileRise on Klutch.sh using Docker, including detailed installation steps, persistent storage configuration, security best practices, and production-ready deployment strategies.
What You’ll Learn
- How to deploy FileRise with a Dockerfile on Klutch.sh
- Setting up persistent storage for uploaded files
- Configuring environment variables for security and customization
- Implementing password protection and expiration policies
- Best practices for production deployment and file management
Prerequisites
Before you begin, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your FileRise project
- Basic familiarity with Docker and file sharing concepts
- (Optional) Docker installed locally for testing
Understanding FileRise Architecture
FileRise consists of several key components:
- Go Backend: High-performance Go application handling file operations and API
- Web Interface: Modern JavaScript-based UI for file uploads and management
- Storage Layer: File system storage for uploaded files and metadata
- Link Management: Database for tracking shared links, expiration, and access controls
- Cleanup Service: Background process for removing expired files automatically
The application runs on a single HTTP port (default 8080), making it straightforward to deploy on Klutch.sh with automatic HTTPS.
Step 1: Prepare Your GitHub Repository
-
Create a new GitHub repository for your FileRise deployment.
-
Create a
Dockerfilein the root of your repository with the following content: - (Optional) Create a
.dockerignorefile: - Create a
README.mdfile with setup information: - Commit and push your changes to GitHub:
FROM golang:1.21-alpine AS builder
# Install build dependenciesRUN apk add --no-cache git make
# Set working directoryWORKDIR /app
# Clone FileRise repositoryRUN git clone https://github.com/filerise/filerise.git .
# Build the applicationRUN go mod downloadRUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o filerise .
# Final stageFROM alpine:latest
# Install runtime dependenciesRUN apk --no-cache add ca-certificates tzdata
# Create app userRUN addgroup -g 1000 filerise && \ adduser -D -u 1000 -G filerise filerise
# Set working directoryWORKDIR /app
# Copy binary from builderCOPY --from=builder /app/filerise .
# Create necessary directoriesRUN mkdir -p /app/data /app/uploads && \ chown -R filerise:filerise /app
# Switch to non-root userUSER filerise
# Expose HTTP portEXPOSE 8080
# Set default environment variablesENV PORT=8080ENV DATA_DIR=/app/dataENV UPLOAD_DIR=/app/uploads
# Health checkHEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1
# Run the applicationCMD ["./filerise"]Note: This Dockerfile uses a multi-stage build to create a minimal, secure image with the FileRise application.
.git.github*.mdREADME.md.env.env.localdocker-compose.ymlnode_modules.DS_Store# FileRise Deployment on Klutch.sh
This repository contains the Docker configuration for deploying FileRise on Klutch.sh.
## About FileRise
FileRise is a self-hosted file sharing platform with password protection, expiration times, and download limits.
## Features
- Secure file sharing with encryption- Customizable expiration times- Password protection for shared files- Download limit controls- Anonymous sharing (no registration required)- Clean, modern interface- Self-hosted privacy
## Initial Setup
1. Deploy on Klutch.sh2. Attach persistent volumes for uploads and data3. Configure environment variables4. Access the web interface5. Start sharing files securely
## Configuration
Set environment variables in Klutch.sh dashboard:- `MAX_FILE_SIZE`: Maximum upload size (default: 100MB)- `DEFAULT_EXPIRY`: Default file expiration time- `ENABLE_PASSWORDS`: Enable password protection- `CLEANUP_INTERVAL`: How often to remove expired files
## Documentation
- FileRise: https://github.com/filerise/filerise- Klutch.sh: https://docs.klutch.shgit add Dockerfile .dockerignore README.mdgit commit -m "Add FileRise Dockerfile for Klutch.sh deployment"git push origin mainStep 2: Create Your App on Klutch.sh
-
Log in to Klutch.sh and navigate to the dashboard.
-
Create a new project (if you don’t have one already) by clicking “New Project” and providing a project name like “File Sharing”.
-
Create a new app within your project by clicking “New App”.
-
Connect your GitHub repository by selecting it from the list of available repositories.
-
Configure the build settings:
- Klutch.sh will automatically detect the Dockerfile in your repository root
- The build will use this Dockerfile automatically
-
Set the internal port to
8080(FileRise’s default HTTP port). This is the port that traffic will be routed to within the container. -
Select HTTP traffic for the app’s traffic type.
Step 3: Configure Persistent Storage
FileRise requires persistent storage to retain uploaded files and metadata across deployments.
-
In your app settings, navigate to the “Volumes” section.
-
Add the first persistent volume for uploaded files:
- Mount Path:
/app/uploads - Size: Choose based on your file sharing needs (start with 20 GB, scale as needed)
- Mount Path:
-
Add a second persistent volume for application data and metadata:
- Mount Path:
/app/data - Size: 1 GB is typically sufficient for metadata and configuration
- Mount Path:
-
Save the volume configuration. This ensures all your uploaded files and metadata persist even when the container is restarted or redeployed.
The persistent volumes store:
/app/uploads: All user-uploaded files waiting to be shared or downloaded/app/data: Application metadata, link information, access logs, and configuration
For more details on managing persistent storage, see the Volumes Guide.
Step 4: Configure Environment Variables
FileRise can be customized using environment variables. Configure these in the Klutch.sh dashboard:
-
In your app settings, navigate to the “Environment Variables” section.
-
Add basic configuration variables:
- Add security and feature variables:
- Optional advanced configuration:
- Mark sensitive values as secrets in the Klutch.sh UI to prevent them from appearing in logs.
# Server configurationPORT=8080HOST=0.0.0.0
# Public URL (set to your actual app URL)PUBLIC_URL=https://example-app.klutch.sh
# File storage settingsDATA_DIR=/app/dataUPLOAD_DIR=/app/uploads
# Upload limitsMAX_FILE_SIZE=104857600MAX_FILES_PER_UPLOAD=10
# Default expiration (in hours)DEFAULT_EXPIRY_HOURS=24
# Timezone configurationTZ=America/New_York# Enable password protection for shared filesENABLE_PASSWORDS=true
# Require passwords for all uploadsREQUIRE_PASSWORD=false
# Maximum number of downloads before expirationDEFAULT_MAX_DOWNLOADS=0
# Cleanup expired files interval (in minutes)CLEANUP_INTERVAL=60
# Enable file scanning (requires ClamAV)ENABLE_VIRUS_SCAN=false
# Maximum link generation attemptsMAX_LINK_RETRIES=10
# Enable anonymous uploadsALLOW_ANONYMOUS=true# Custom expiration limits (in hours)MIN_EXPIRY_HOURS=1MAX_EXPIRY_HOURS=168
# Custom download limitsMIN_DOWNLOADS=1MAX_DOWNLOADS=100
# Enable rate limitingENABLE_RATE_LIMIT=trueRATE_LIMIT_REQUESTS=100RATE_LIMIT_WINDOW=60
# Enable loggingLOG_LEVEL=infoLOG_FORMAT=json
# Enable metricsENABLE_METRICS=trueMETRICS_PORT=9090Important Security Notes:
- Never commit secrets or passwords to your repository
- Always use Klutch.sh environment variables for configuration
- Enable password protection for sensitive file sharing
- Set appropriate expiration times to minimize data retention
- Regularly review and clean up old files
Step 5: Deploy Your Application
-
Review your configuration to ensure all settings are correct:
- Dockerfile is detected
- Internal port is set to
8080 - Persistent volumes are mounted to
/app/uploadsand/app/data - Environment variables are configured
- Traffic type is set to HTTP
-
Click “Deploy” to start the build and deployment process.
-
Monitor the build logs to ensure the deployment completes successfully. The build typically takes 3-5 minutes due to the Go compilation.
-
Wait for the deployment to complete. Once done, you’ll see your app URL (e.g.,
https://example-app.klutch.sh).
Step 6: Getting Started with FileRise
-
Access your FileRise instance by navigating to your app URL (e.g.,
https://example-app.klutch.sh). -
Upload your first file:
- Click the upload button or drag and drop a file
- Set optional password protection
- Configure expiration time
- Set maximum download limit
- Click “Upload”
-
Receive your shareable link:
- Copy the generated link
- Share it with recipients
- Track download statistics
-
Test the sharing functionality:
- Open the link in an incognito browser
- Enter password if required
- Download the file
- Verify expiration and download limits work
Sample Usage: Uploading and Sharing Files
Here’s how to use FileRise for common file sharing tasks:
Basic File Upload
Via Web Interface:
1. Navigate to your FileRise URL2. Click "Upload File" or drag & drop3. Select file from your computer4. Click "Generate Link"5. Copy and share the linkPassword-Protected Upload
Steps:
1. Upload your file2. Check "Protect with password"3. Enter a strong password4. Set expiration time5. Generate link6. Share link AND password separatelyTime-Limited Sharing
Configuration:
1. Upload file2. Set "Expires in": 24 hours3. Optional: Set max downloads to 14. Generate link5. File automatically deletes after expirationUsing the API
FileRise provides a REST API for programmatic file uploads:
Upload File via cURL:
# Upload a filecurl -X POST https://example-app.klutch.sh/api/upload \ -F "file=@/path/to/file.pdf" \ -F "expiry=24" \ -F "password=securepassword123" \ -F "maxDownloads=5"
# Response includes download link{ "success": true, "link": "https://example-app.klutch.sh/d/abc123xyz", "expiresAt": "2025-12-22T16:00:00Z", "maxDownloads": 5}Download File via cURL:
# Download without passwordcurl -O https://example-app.klutch.sh/d/abc123xyz
# Download with passwordcurl -O -H "X-Password: securepassword123" \ https://example-app.klutch.sh/d/abc123xyzJavaScript Integration
// FileRise Upload Clientclass FileRiseClient { constructor(baseUrl) { this.baseUrl = baseUrl; }
async uploadFile(file, options = {}) { const formData = new FormData(); formData.append('file', file);
if (options.password) { formData.append('password', options.password); }
if (options.expiry) { formData.append('expiry', options.expiry); }
if (options.maxDownloads) { formData.append('maxDownloads', options.maxDownloads); }
try { const response = await fetch(`${this.baseUrl}/api/upload`, { method: 'POST', body: formData });
if (!response.ok) { throw new Error(`Upload failed: ${response.statusText}`); }
return await response.json(); } catch (error) { console.error('Upload error:', error); throw error; } }
async getFileInfo(fileId) { try { const response = await fetch(`${this.baseUrl}/api/info/${fileId}`);
if (!response.ok) { throw new Error(`Failed to get file info: ${response.statusText}`); }
return await response.json(); } catch (error) { console.error('Get info error:', error); throw error; } }
async deleteFile(fileId, deleteToken) { try { const response = await fetch(`${this.baseUrl}/api/delete/${fileId}`, { method: 'DELETE', headers: { 'X-Delete-Token': deleteToken } });
if (!response.ok) { throw new Error(`Delete failed: ${response.statusText}`); }
return await response.json(); } catch (error) { console.error('Delete error:', error); throw error; } }}
// Usage exampleconst client = new FileRiseClient('https://example-app.klutch.sh');
// Upload file with optionsconst fileInput = document.querySelector('#file-input');fileInput.addEventListener('change', async (e) => { const file = e.target.files[0];
try { const result = await client.uploadFile(file, { password: 'mysecretpass', expiry: 48, // 48 hours maxDownloads: 10 });
console.log('Upload successful!'); console.log('Download link:', result.link); console.log('Expires at:', result.expiresAt);
// Display link to user document.querySelector('#share-link').textContent = result.link; } catch (error) { console.error('Upload failed:', error); }});Python Integration
import requestsfrom pathlib import Path
class FileRiseClient: def __init__(self, base_url): self.base_url = base_url
def upload_file(self, file_path, password=None, expiry=24, max_downloads=None): """ Upload a file to FileRise
Args: file_path: Path to the file to upload password: Optional password protection expiry: Expiration time in hours (default: 24) max_downloads: Maximum number of downloads (default: unlimited) """ url = f"{self.base_url}/api/upload"
files = { 'file': open(file_path, 'rb') }
data = { 'expiry': expiry }
if password: data['password'] = password
if max_downloads: data['maxDownloads'] = max_downloads
try: response = requests.post(url, files=files, data=data) response.raise_for_status() return response.json() except requests.exceptions.RequestException as e: print(f"Upload failed: {e}") raise
def download_file(self, file_id, save_path, password=None): """ Download a file from FileRise
Args: file_id: The file ID from the share link save_path: Where to save the downloaded file password: Password if file is protected """ url = f"{self.base_url}/d/{file_id}"
headers = {} if password: headers['X-Password'] = password
try: response = requests.get(url, headers=headers, stream=True) response.raise_for_status()
with open(save_path, 'wb') as f: for chunk in response.iter_content(chunk_size=8192): f.write(chunk)
print(f"File downloaded successfully to {save_path}") except requests.exceptions.RequestException as e: print(f"Download failed: {e}") raise
def get_file_info(self, file_id): """ Get information about a shared file """ url = f"{self.base_url}/api/info/{file_id}"
try: response = requests.get(url) response.raise_for_status() return response.json() except requests.exceptions.RequestException as e: print(f"Failed to get file info: {e}") raise
# Usage exampleclient = FileRiseClient('https://example-app.klutch.sh')
# Upload a fileresult = client.upload_file( 'document.pdf', password='securepass123', expiry=72, # 3 days max_downloads=5)
print(f"Upload successful!")print(f"Share link: {result['link']}")print(f"Expires at: {result['expiresAt']}")
# Download a fileclient.download_file( 'abc123xyz', 'downloaded_document.pdf', password='securepass123')Production Best Practices
Security
- Enable Password Protection: Always enable password protection for sensitive files
- Set Appropriate Expiration: Use short expiration times for temporary sharing
- Use HTTPS Only: Always use HTTPS (automatic on Klutch.sh)
- Regular Updates: Keep FileRise updated to the latest version
- File Type Restrictions: Consider blocking executable files (.exe, .sh, .bat)
- Virus Scanning: Enable virus scanning if handling user-uploaded content
- Rate Limiting: Enable rate limiting to prevent abuse
- Strong Passwords: Enforce strong password requirements
- Access Logging: Monitor access logs for suspicious activity
- Regular Cleanup: Implement automated cleanup of expired files
Storage Management
-
Monitor Disk Usage: Regularly check volume capacity and usage
- Set up alerts for 80% capacity
- Plan for storage growth
- Implement quota limits per upload
-
Storage Optimization:
- Enable compression for large files
- Set reasonable file size limits
- Implement automatic cleanup policies
- Archive old files to cold storage
-
Backup Strategy:
- Daily automated backups of data volume
- Weekly backups of upload volume
- Test restore procedures regularly
- Off-site backup storage
Performance
-
Resource Allocation: Allocate sufficient resources based on usage
- Small deployments (< 100 uploads/day): 512MB RAM, 1 CPU
- Medium deployments (100-1000 uploads/day): 1GB RAM, 2 CPUs
- Large deployments (1000+ uploads/day): 2GB+ RAM, 4+ CPUs
-
Optimization Settings:
Terminal window # Concurrent upload handlingMAX_CONCURRENT_UPLOADS=10# Connection pool sizeDB_MAX_CONNECTIONS=100# Request timeoutREQUEST_TIMEOUT=300# Buffer size for uploadsUPLOAD_BUFFER_SIZE=8192 -
Caching: Enable caching for static assets and metadata
-
CDN Integration: Consider CDN for serving download links (optional)
Monitoring
Monitor these key metrics:
- Application Health: Response times, error rates, uptime
- Storage Metrics: Available disk space, upload/download volume
- Resource Usage: CPU, memory, disk I/O
- Upload Statistics: Number of uploads, file sizes, popular file types
- Download Metrics: Download count, bandwidth usage
- Security Events: Failed password attempts, rate limit hits
- Cleanup Status: Expired files removed, cleanup success rate
Troubleshooting
Application Won’t Start
Issue: Container starts but application doesn’t respond
Solutions:
- Verify internal port is set to 8080
- Check application logs in Klutch.sh dashboard
- Ensure persistent volumes are properly mounted
- Verify sufficient disk space in volumes
- Check for Go compilation errors in build logs
Cannot Upload Files
Issue: File uploads fail or timeout
Solutions:
- Check
MAX_FILE_SIZEenvironment variable - Verify upload volume has sufficient free space
- Ensure volume permissions are correct
- Review
MAX_FILES_PER_UPLOADsetting - Check network connectivity
- Verify no rate limiting is blocking uploads
Files Not Persisting
Issue: Uploaded files disappear after restart
Solutions:
- Verify persistent volumes are attached to correct mount paths
- Check volume permissions (user
fileriseneeds write access) - Ensure
UPLOAD_DIRenvironment variable matches mount path - Review volume mount configuration in Klutch.sh dashboard
Download Links Not Working
Issue: Generated links return 404 or errors
Solutions:
- Verify
PUBLIC_URLenvironment variable is set correctly - Check that files haven’t expired
- Ensure data volume is properly mounted
- Review download limit hasn’t been exceeded
- Check link format is correct
- Verify password is correct if protected
Slow Upload/Download Performance
Issue: File transfers are slow or timeout
Solutions:
- Increase instance CPU and memory resources
- Check network bandwidth limits
- Optimize
UPLOAD_BUFFER_SIZEsetting - Review concurrent upload limits
- Check volume I/O performance
- Consider using compression for large files
Files Not Expiring Automatically
Issue: Expired files remain in storage
Solutions:
- Verify
CLEANUP_INTERVALis set correctly - Check cleanup service is running (review logs)
- Ensure timezone (
TZ) is configured properly - Manually trigger cleanup if needed
- Review expiration time calculations
High Storage Usage
Issue: Storage volume filling up quickly
Solutions:
- Review and reduce
DEFAULT_EXPIRY_HOURS - Lower
MAX_FILE_SIZElimit - Enable more aggressive cleanup policies
- Implement file compression
- Monitor upload patterns for abuse
- Set up storage alerts
Advanced Configuration
Custom Expiration Policies
Configure different expiration rules for different file sizes:
# Small files (< 10MB): 7 daysSMALL_FILE_EXPIRY=168
# Medium files (10MB-100MB): 3 daysMEDIUM_FILE_EXPIRY=72
# Large files (> 100MB): 24 hoursLARGE_FILE_EXPIRY=24
# Size thresholdsSMALL_FILE_THRESHOLD=10485760LARGE_FILE_THRESHOLD=104857600File Type Restrictions
Restrict certain file types for security:
# Allowed file extensions (comma-separated)ALLOWED_EXTENSIONS=pdf,jpg,jpeg,png,gif,zip,tar,gz,mp4,mp3,doc,docx,xls,xlsx,txt
# Blocked file extensionsBLOCKED_EXTENSIONS=exe,bat,sh,ps1,cmd,scr,vbs
# Enable MIME type checkingENABLE_MIME_CHECK=trueRate Limiting Configuration
Prevent abuse with rate limiting:
# Enable rate limitingENABLE_RATE_LIMIT=true
# Uploads per IP per hourUPLOAD_RATE_LIMIT=50
# Downloads per IP per hourDOWNLOAD_RATE_LIMIT=200
# API requests per IP per minuteAPI_RATE_LIMIT=100
# Ban duration after limit exceeded (minutes)BAN_DURATION=60Email Notifications
Configure email notifications for uploads:
# Enable email notificationsENABLE_EMAIL=true
# SMTP configurationSMTP_HOST=smtp.example.comSMTP_PORT=587SMTP_USER=notifications@example.comSMTP_PASSWORD=your-smtp-passwordSMTP_FROM=FileRise <notifications@example.com>
# Notification settingsNOTIFY_ON_UPLOAD=trueNOTIFY_ON_DOWNLOAD=trueNOTIFY_ADMIN_EMAIL=admin@example.comUpgrading FileRise
To upgrade FileRise to a new version:
Method 1: Rebuild from Latest Source
-
Update the Dockerfile to pull the latest code:
# In the builder stage, add version tagRUN git clone --branch v1.2.0 https://github.com/filerise/filerise.git . -
Commit and push the changes:
Terminal window git add Dockerfilegit commit -m "Upgrade FileRise to version 1.2.0"git push origin main -
Redeploy the application through Klutch.sh dashboard.
-
Verify the upgrade was successful:
- Check version in application footer or about page
- Test file upload and download
- Verify existing links still work
Pre-Upgrade Checklist
- ✅ Backup both persistent volumes
- ✅ Review FileRise changelog for breaking changes
- ✅ Test upgrade in a development environment
- ✅ Notify users of scheduled maintenance
- ✅ Document current configuration
- ✅ Monitor logs after upgrade
- ✅ Test all critical functionality
Use Cases
Client File Delivery
Share project deliverables with clients:
- Upload final project files
- Set password protection
- Configure 7-day expiration
- Send link and password separately
- Track when client downloads files
Team Collaboration
Quick file sharing within teams:
- Share large design files
- No email attachment limits
- Track who downloaded what
- Automatic cleanup after project completion
Temporary File Hosting
Host files for limited-time events:
- Conference presentation materials
- Workshop resources
- Event photos and videos
- Automatic deletion after event
Secure Document Exchange
Exchange sensitive documents:
- Legal documents with clients
- Medical records (HIPAA-compliant setup)
- Financial statements
- Password protection required
- Single-use download links
Resources
- FileRise GitHub Repository
- FileRise Documentation
- FileRise Docker Hub
- Klutch.sh Quick Start Guide
- Klutch.sh Volumes Guide
- Klutch.sh Builds Guide
- Klutch.sh Deployments Guide
Conclusion
You now have a fully functional FileRise file sharing platform running on Klutch.sh with persistent storage, configured security settings, and production-ready features. This setup allows you to:
- Share files securely with password protection
- Control access with expiration times and download limits
- Maintain privacy with self-hosted infrastructure
- Track file sharing activity and usage
- Automatically clean up expired files
- Scale storage as your needs grow
FileRise on Klutch.sh provides a secure, privacy-focused alternative to commercial file sharing services while giving you complete control over your data. With automatic HTTPS, persistent storage, and easy scalability, you have a robust platform for all your file sharing needs.
For questions or community support, refer to the FileRise GitHub Issues or the official documentation.