Deploying Goploader
Introduction
Goploader is a simple, self-hosted file sharing service written in Go. It allows you to quickly upload and share files with automatically expiring links, making it perfect for temporary file sharing without the clutter of permanent storage.
Built for simplicity and speed, Goploader provides a minimal interface for uploading files and receiving shareable links. Files are automatically deleted after a configurable period, ensuring your storage stays clean without manual intervention.
Key highlights of Goploader:
- Simple Uploads: Drag-and-drop or click to upload
- Expiring Links: Files automatically delete after set time
- Short URLs: Easy-to-share short links
- Fast Performance: Written in Go for speed
- Minimal Interface: Clean, distraction-free UI
- No Registration: Upload without creating accounts
- CLI Support: Upload from command line
- Customizable: Configure expiration times and limits
- Lightweight: Small resource footprint
- Open Source: MIT licensed
This guide walks through deploying Goploader on Klutch.sh using Docker.
Why Deploy Goploader on Klutch.sh
Deploying Goploader on Klutch.sh provides several advantages:
Quick Sharing: Share files instantly with anyone.
Always Available: File sharing service runs 24/7.
HTTPS by Default: Secure file transfers.
Clean Storage: Automatic expiration prevents clutter.
Private Hosting: Control your own file sharing infrastructure.
Prerequisites
Before deploying Goploader on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Basic familiarity with Docker
Understanding Goploader Architecture
Goploader has a simple architecture:
Go HTTP Server: Handles uploads and file serving.
File Storage: Stores uploaded files on disk.
Cleanup Worker: Removes expired files periodically.
URL Generator: Creates short, unique URLs.
Preparing Your Repository
Create a GitHub repository with your configuration.
Repository Structure
goploader-deploy/├── Dockerfile└── .dockerignoreCreating the Dockerfile
FROM golang:alpine AS builder
RUN apk add --no-cache git
WORKDIR /buildRUN git clone https://github.com/Depado/goploader.git . && \ go build -o goploader .
FROM alpine:latest
RUN apk add --no-cache ca-certificates
COPY --from=builder /build/goploader /usr/local/bin/goploader
# Create data directoryRUN mkdir -p /data
# Set environment variablesENV GOPLOADER_DATA=/dataENV GOPLOADER_PORT=8080ENV GOPLOADER_EXPIRY=24h
# Expose portEXPOSE 8080
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:8080 || exit 1
# Run applicationCMD ["goploader"]Environment Variables Reference
| Variable | Required | Description |
|---|---|---|
GOPLOADER_DATA | No | Data storage directory |
GOPLOADER_PORT | No | HTTP port (default: 8080) |
GOPLOADER_EXPIRY | No | Default file expiration time |
GOPLOADER_MAX_SIZE | No | Maximum upload size in bytes |
GOPLOADER_DOMAIN | No | Public domain for URLs |
Deploying Goploader on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 8080
Push Your Repository to GitHub
Commit your Dockerfile to GitHub.
Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project named “goploader” or “file-share”.
Create a New App
Create a new app and connect your GitHub repository.
Configure HTTP Traffic
Set up HTTP traffic:
Set Environment Variables
| Variable | Value |
|---|---|
GOPLOADER_DOMAIN | your-app.klutch.sh |
GOPLOADER_EXPIRY | 24h |
GOPLOADER_MAX_SIZE | 104857600 |
Attach Persistent Volumes
| Mount Path | Size | Purpose |
|---|---|---|
/data | 10+ GB | Uploaded files |
Deploy Your Application
Click Deploy to build and launch Goploader.
Start Sharing Files
Navigate to your app URL and upload your first file.
Using Goploader
Web Interface
- Visit your Goploader URL
- Drag and drop a file or click to select
- File uploads automatically
- Copy the generated share link
- Share the link with recipients
Share Link Format
Links follow the pattern:
https://your-app.klutch.sh/f/abc123File Expiration
Files are automatically deleted:
- After configured expiration time
- When storage limits are reached
- Manually if implemented
CLI Usage
Upload files from the command line:
# Using curlcurl -F "file=@myfile.txt" https://your-app.klutch.sh/upload
# Response contains the share URLShell Alias
Create a convenient alias:
alias share='curl -F "file=@$1" https://your-app.klutch.sh/upload'Configuration Options
Expiration Times
Configure how long files persist:
1h- One hour24h- One day168h- One week720h- One month
Upload Limits
Set maximum file size:
GOPLOADER_MAX_SIZE=104857600 # 100 MBURL Configuration
Set your public domain:
GOPLOADER_DOMAIN=share.example.comUse Cases
Temporary File Sharing
Share files that should not persist:
- One-time documents
- Quick transfers to collaborators
- Screenshots and images
Pastebin Alternative
Share text files and code snippets:
- Log files
- Configuration snippets
- Quick notes
Development Assets
Share development resources:
- Build artifacts
- Test files
- Documentation drafts
Security Considerations
File Privacy
Consider implementing:
- Password protection
- Private links only (no listing)
- IP-based access control
Upload Restrictions
Prevent abuse:
- File size limits
- Rate limiting
- File type restrictions
Content Moderation
For public instances:
- Implement reporting
- Monitor uploads
- Set clear terms of service
Storage Management
Automatic Cleanup
Goploader cleans up expired files automatically. Configure cleanup interval as needed.
Manual Cleanup
If needed, implement manual cleanup:
# Remove files older than 7 daysfind /data -type f -mtime +7 -deleteStorage Monitoring
Monitor storage usage:
- Set alerts for high usage
- Review large files
- Adjust expiration times
Customization
Appearance
Customize the interface:
- Logo and branding
- Color scheme
- Instructions
Behavior
Modify default settings:
- Default expiration
- Allowed file types
- Maximum sizes
Troubleshooting
Upload Failures
- Check file size limits
- Verify storage space
- Review server logs
Missing Files
- Check expiration settings
- Verify cleanup schedule
- Review error logs
Performance Issues
- Monitor storage I/O
- Check memory usage
- Review concurrent upload handling
Additional Resources
Conclusion
Deploying Goploader on Klutch.sh provides a simple, self-hosted solution for temporary file sharing. Without the complexity of full-featured cloud storage, Goploader offers quick uploads with automatic cleanup for casual sharing needs.
The combination of Goploader’s simplicity and Klutch.sh’s reliable hosting creates an ideal platform for personal or team file sharing.