Skip to content

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

    1. Create a new GitHub repository for your FileRise deployment.

    2. Create a Dockerfile in the root of your repository with the following content:

    FROM golang:1.21-alpine AS builder
    # Install build dependencies
    RUN apk add --no-cache git make
    # Set working directory
    WORKDIR /app
    # Clone FileRise repository
    RUN git clone https://github.com/filerise/filerise.git .
    # Build the application
    RUN go mod download
    RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o filerise .
    # Final stage
    FROM alpine:latest
    # Install runtime dependencies
    RUN apk --no-cache add ca-certificates tzdata
    # Create app user
    RUN addgroup -g 1000 filerise && \
    adduser -D -u 1000 -G filerise filerise
    # Set working directory
    WORKDIR /app
    # Copy binary from builder
    COPY --from=builder /app/filerise .
    # Create necessary directories
    RUN mkdir -p /app/data /app/uploads && \
    chown -R filerise:filerise /app
    # Switch to non-root user
    USER filerise
    # Expose HTTP port
    EXPOSE 8080
    # Set default environment variables
    ENV PORT=8080
    ENV DATA_DIR=/app/data
    ENV UPLOAD_DIR=/app/uploads
    # Health check
    HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
    CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1
    # Run the application
    CMD ["./filerise"]

    Note: This Dockerfile uses a multi-stage build to create a minimal, secure image with the FileRise application.

    1. (Optional) Create a .dockerignore file:
    .git
    .github
    *.md
    README.md
    .env
    .env.local
    docker-compose.yml
    node_modules
    .DS_Store
    1. Create a README.md file with setup information:
    # 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.sh
    2. Attach persistent volumes for uploads and data
    3. Configure environment variables
    4. Access the web interface
    5. 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.sh
    1. Commit and push your changes to GitHub:
    Terminal window
    git add Dockerfile .dockerignore README.md
    git commit -m "Add FileRise Dockerfile for Klutch.sh deployment"
    git push origin main

Step 2: Create Your App on Klutch.sh

    1. Log in to Klutch.sh and navigate to the dashboard.

    2. Create a new project (if you don’t have one already) by clicking “New Project” and providing a project name like “File Sharing”.

    3. Create a new app within your project by clicking “New App”.

    4. Connect your GitHub repository by selecting it from the list of available repositories.

    5. Configure the build settings:

      • Klutch.sh will automatically detect the Dockerfile in your repository root
      • The build will use this Dockerfile automatically
    6. Set the internal port to 8080 (FileRise’s default HTTP port). This is the port that traffic will be routed to within the container.

    7. 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.

    1. In your app settings, navigate to the “Volumes” section.

    2. 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)
    3. Add a second persistent volume for application data and metadata:

      • Mount Path: /app/data
      • Size: 1 GB is typically sufficient for metadata and configuration
    4. 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:

    1. In your app settings, navigate to the “Environment Variables” section.

    2. Add basic configuration variables:

    Terminal window
    # Server configuration
    PORT=8080
    HOST=0.0.0.0
    # Public URL (set to your actual app URL)
    PUBLIC_URL=https://example-app.klutch.sh
    # File storage settings
    DATA_DIR=/app/data
    UPLOAD_DIR=/app/uploads
    # Upload limits
    MAX_FILE_SIZE=104857600
    MAX_FILES_PER_UPLOAD=10
    # Default expiration (in hours)
    DEFAULT_EXPIRY_HOURS=24
    # Timezone configuration
    TZ=America/New_York
    1. Add security and feature variables:
    Terminal window
    # Enable password protection for shared files
    ENABLE_PASSWORDS=true
    # Require passwords for all uploads
    REQUIRE_PASSWORD=false
    # Maximum number of downloads before expiration
    DEFAULT_MAX_DOWNLOADS=0
    # Cleanup expired files interval (in minutes)
    CLEANUP_INTERVAL=60
    # Enable file scanning (requires ClamAV)
    ENABLE_VIRUS_SCAN=false
    # Maximum link generation attempts
    MAX_LINK_RETRIES=10
    # Enable anonymous uploads
    ALLOW_ANONYMOUS=true
    1. Optional advanced configuration:
    Terminal window
    # Custom expiration limits (in hours)
    MIN_EXPIRY_HOURS=1
    MAX_EXPIRY_HOURS=168
    # Custom download limits
    MIN_DOWNLOADS=1
    MAX_DOWNLOADS=100
    # Enable rate limiting
    ENABLE_RATE_LIMIT=true
    RATE_LIMIT_REQUESTS=100
    RATE_LIMIT_WINDOW=60
    # Enable logging
    LOG_LEVEL=info
    LOG_FORMAT=json
    # Enable metrics
    ENABLE_METRICS=true
    METRICS_PORT=9090
    1. Mark sensitive values as secrets in the Klutch.sh UI to prevent them from appearing in logs.

Important 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

    1. Review your configuration to ensure all settings are correct:

      • Dockerfile is detected
      • Internal port is set to 8080
      • Persistent volumes are mounted to /app/uploads and /app/data
      • Environment variables are configured
      • Traffic type is set to HTTP
    2. Click “Deploy” to start the build and deployment process.

    3. Monitor the build logs to ensure the deployment completes successfully. The build typically takes 3-5 minutes due to the Go compilation.

    4. 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

    1. Access your FileRise instance by navigating to your app URL (e.g., https://example-app.klutch.sh).

    2. 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”
    3. Receive your shareable link:

      • Copy the generated link
      • Share it with recipients
      • Track download statistics
    4. 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 URL
2. Click "Upload File" or drag & drop
3. Select file from your computer
4. Click "Generate Link"
5. Copy and share the link

Password-Protected Upload

Steps:

1. Upload your file
2. Check "Protect with password"
3. Enter a strong password
4. Set expiration time
5. Generate link
6. Share link AND password separately

Time-Limited Sharing

Configuration:

1. Upload file
2. Set "Expires in": 24 hours
3. Optional: Set max downloads to 1
4. Generate link
5. File automatically deletes after expiration

Using the API

FileRise provides a REST API for programmatic file uploads:

Upload File via cURL:

Terminal window
# Upload a file
curl -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:

Terminal window
# Download without password
curl -O https://example-app.klutch.sh/d/abc123xyz
# Download with password
curl -O -H "X-Password: securepassword123" \
https://example-app.klutch.sh/d/abc123xyz

JavaScript Integration

// FileRise Upload Client
class 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 example
const client = new FileRiseClient('https://example-app.klutch.sh');
// Upload file with options
const 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 requests
from 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 example
client = FileRiseClient('https://example-app.klutch.sh')
# Upload a file
result = 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 file
client.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 handling
    MAX_CONCURRENT_UPLOADS=10
    # Connection pool size
    DB_MAX_CONNECTIONS=100
    # Request timeout
    REQUEST_TIMEOUT=300
    # Buffer size for uploads
    UPLOAD_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_SIZE environment variable
  • Verify upload volume has sufficient free space
  • Ensure volume permissions are correct
  • Review MAX_FILES_PER_UPLOAD setting
  • 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 filerise needs write access)
  • Ensure UPLOAD_DIR environment variable matches mount path
  • Review volume mount configuration in Klutch.sh dashboard

Issue: Generated links return 404 or errors

Solutions:

  • Verify PUBLIC_URL environment 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_SIZE setting
  • 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_INTERVAL is 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_SIZE limit
  • 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:

Terminal window
# Small files (< 10MB): 7 days
SMALL_FILE_EXPIRY=168
# Medium files (10MB-100MB): 3 days
MEDIUM_FILE_EXPIRY=72
# Large files (> 100MB): 24 hours
LARGE_FILE_EXPIRY=24
# Size thresholds
SMALL_FILE_THRESHOLD=10485760
LARGE_FILE_THRESHOLD=104857600

File Type Restrictions

Restrict certain file types for security:

Terminal window
# Allowed file extensions (comma-separated)
ALLOWED_EXTENSIONS=pdf,jpg,jpeg,png,gif,zip,tar,gz,mp4,mp3,doc,docx,xls,xlsx,txt
# Blocked file extensions
BLOCKED_EXTENSIONS=exe,bat,sh,ps1,cmd,scr,vbs
# Enable MIME type checking
ENABLE_MIME_CHECK=true

Rate Limiting Configuration

Prevent abuse with rate limiting:

Terminal window
# Enable rate limiting
ENABLE_RATE_LIMIT=true
# Uploads per IP per hour
UPLOAD_RATE_LIMIT=50
# Downloads per IP per hour
DOWNLOAD_RATE_LIMIT=200
# API requests per IP per minute
API_RATE_LIMIT=100
# Ban duration after limit exceeded (minutes)
BAN_DURATION=60

Email Notifications

Configure email notifications for uploads:

Terminal window
# Enable email notifications
ENABLE_EMAIL=true
# SMTP configuration
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=notifications@example.com
SMTP_PASSWORD=your-smtp-password
SMTP_FROM=FileRise <notifications@example.com>
# Notification settings
NOTIFY_ON_UPLOAD=true
NOTIFY_ON_DOWNLOAD=true
NOTIFY_ADMIN_EMAIL=admin@example.com

Upgrading FileRise

To upgrade FileRise to a new version:

Method 1: Rebuild from Latest Source

    1. Update the Dockerfile to pull the latest code:

      # In the builder stage, add version tag
      RUN git clone --branch v1.2.0 https://github.com/filerise/filerise.git .
    2. Commit and push the changes:

      Terminal window
      git add Dockerfile
      git commit -m "Upgrade FileRise to version 1.2.0"
      git push origin main
    3. Redeploy the application through Klutch.sh dashboard.

    4. 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


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.