Skip to content

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:

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
└── .dockerignore

Creating the Dockerfile

FROM golang:alpine AS builder
RUN apk add --no-cache git
WORKDIR /build
RUN 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 directory
RUN mkdir -p /data
# Set environment variables
ENV GOPLOADER_DATA=/data
ENV GOPLOADER_PORT=8080
ENV GOPLOADER_EXPIRY=24h
# Expose port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080 || exit 1
# Run application
CMD ["goploader"]

Environment Variables Reference

VariableRequiredDescription
GOPLOADER_DATANoData storage directory
GOPLOADER_PORTNoHTTP port (default: 8080)
GOPLOADER_EXPIRYNoDefault file expiration time
GOPLOADER_MAX_SIZENoMaximum upload size in bytes
GOPLOADER_DOMAINNoPublic domain for URLs

Deploying Goploader on Klutch.sh

    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:

    • Select HTTP as the traffic type
    • Set the internal port to 8080

    Set Environment Variables

    VariableValue
    GOPLOADER_DOMAINyour-app.klutch.sh
    GOPLOADER_EXPIRY24h
    GOPLOADER_MAX_SIZE104857600

    Attach Persistent Volumes

    Mount PathSizePurpose
    /data10+ GBUploaded 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

  1. Visit your Goploader URL
  2. Drag and drop a file or click to select
  3. File uploads automatically
  4. Copy the generated share link
  5. Share the link with recipients

Links follow the pattern:

https://your-app.klutch.sh/f/abc123

File 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:

Terminal window
# Using curl
curl -F "file=@myfile.txt" https://your-app.klutch.sh/upload
# Response contains the share URL

Shell Alias

Create a convenient alias:

Terminal window
alias share='curl -F "file=@$1" https://your-app.klutch.sh/upload'

Configuration Options

Expiration Times

Configure how long files persist:

  • 1h - One hour
  • 24h - One day
  • 168h - One week
  • 720h - One month

Upload Limits

Set maximum file size:

GOPLOADER_MAX_SIZE=104857600 # 100 MB

URL Configuration

Set your public domain:

GOPLOADER_DOMAIN=share.example.com

Use 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:

Terminal window
# Remove files older than 7 days
find /data -type f -mtime +7 -delete

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