Skip to content

Deploying Local Content Share

Introduction

Local Content Share is a simple yet elegant self-hosted application for storing and sharing text snippets, files, and links across your network. Acting as an all-in-one alternative to AirDrop, local pastebin services, and scratchpad applications, Local Content Share provides a unified interface for quick content sharing without requiring any client-side setup on recipient devices.

Built with Go for performance and simplicity, Local Content Share features a clean web interface that works in any browser. The application includes a built-in Notepad with Markdown editing and preview capabilities, making it useful for quick note-taking alongside file sharing.

Key highlights of Local Content Share:

  • Text Snippets: Share plain text instantly across any device
  • File Sharing: Upload and download files through the web interface
  • Link Storage: Store links in a last-in-first-show order
  • Markdown Notepad: Built-in editor with Markdown support and live preview
  • No Client Setup: Access from any device with a web browser
  • Zero Configuration: Works out of the box with sensible defaults
  • Lightweight: Minimal resource usage with fast performance
  • Cross-Platform: Works on any device with a web browser
  • Self-Contained: Single binary deployment with embedded assets
  • Open Source: MIT licensed with active development

This guide walks through deploying Local Content Share on Klutch.sh using Docker, configuring storage, and securing your instance.

Why Deploy Local Content Share on Klutch.sh

Deploying Local Content Share on Klutch.sh provides several advantages:

Accessible Anywhere: Unlike local network deployments, Klutch.sh makes your content sharing accessible from anywhere with internet access.

Persistent Storage: Attach persistent volumes for your uploaded files and snippets. Content survives container restarts.

HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure file transfers.

GitHub Integration: Connect your configuration repository directly from GitHub. Push updates to trigger automatic redeployments.

Always Available: Your content sharing service remains online 24/7 without managing personal infrastructure.

Custom Domains: Use your own domain for a memorable, branded URL.

Simple Setup: Docker deployment means no complex installation or configuration required.

Prerequisites

Before deploying Local Content Share on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • Basic familiarity with Docker and containerization concepts
  • (Optional) A custom domain

Important Security Notice

Local Content Share is designed for trusted environments and does not include built-in authentication. When deploying on Klutch.sh (which makes the app publicly accessible), you should:

  1. Add authentication through a reverse proxy or Klutch.sh’s authentication features
  2. Use this only for non-sensitive content
  3. Consider implementing access controls at the network level

If you need public sharing without authentication, ensure no sensitive data is stored.

Understanding Local Content Share Architecture

Local Content Share uses a minimalist architecture:

Go Backend: The application is written in Go, providing excellent performance with minimal resource usage. The single binary contains all server logic.

Embedded Frontend: HTML, CSS, and JavaScript are embedded in the binary, eliminating the need for separate static file serving.

File-Based Storage: Uploaded files and snippets are stored on the filesystem, making backup and migration simple.

REST API: The application exposes a simple REST API for programmatic access.

Preparing Your Repository

To deploy Local Content Share on Klutch.sh, create a GitHub repository containing your Dockerfile.

Repository Structure

local-content-share-deploy/
├── Dockerfile
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM ghcr.io/tanq16/local-content-share:latest
# Set environment variables
ENV PORT=8080
# Create data directory
RUN mkdir -p /data
# Set working directory
WORKDIR /app
# Expose the web interface port
EXPOSE 8080
# The base image includes the default entrypoint

Creating the .dockerignore File

Create a .dockerignore file:

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
.env
.env.local

Environment Variables Reference

Local Content Share supports configuration through environment variables:

VariableRequiredDefaultDescription
PORTNo8080Port to listen on
DATA_DIRNo/dataDirectory for storing content

Deploying Local Content Share on Klutch.sh

Once your repository is prepared, follow these steps to deploy:

    Push Your Repository to GitHub

    Initialize your repository and push to GitHub:

    Terminal window
    git init
    git add Dockerfile .dockerignore
    git commit -m "Initial Local Content Share deployment configuration"
    git remote add origin https://github.com/yourusername/local-content-share-deploy.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “content-share” or “file-share”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your configuration.

    Configure HTTP Traffic

    In the deployment settings:

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

    Set Environment Variables

    In the environment variables section:

    VariableValue
    PORT8080

    Attach Persistent Volumes

    Add persistent storage for your content:

    Mount PathRecommended SizePurpose
    /data10 GBUploaded files, snippets, and links

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will:

    • Detect your Dockerfile automatically
    • Build the container image
    • Attach the persistent volumes
    • Start the Local Content Share container
    • Provision an HTTPS certificate

    Access Local Content Share

    Once deployment completes, access your instance at https://your-app-name.klutch.sh.

Using Local Content Share

Web Interface

The main interface provides four primary sections:

  1. Snippets: Share and view text content
  2. Files: Upload and download files
  3. Links: Store and access URLs
  4. Notepad: Markdown editor with preview

Sharing Text Snippets

Share text content instantly:

  1. Navigate to the Snippets section
  2. Enter or paste your text
  3. Click Save or Share
  4. The snippet becomes accessible from any device

Snippets are displayed in reverse chronological order (newest first).

Uploading Files

Share files across devices:

  1. Navigate to the Files section
  2. Click Upload or drag and drop files
  3. Files become immediately available for download
  4. Click on any file to download it

Supported file types include:

  • Documents (PDF, DOC, TXT, etc.)
  • Images (PNG, JPG, GIF, etc.)
  • Archives (ZIP, TAR, etc.)
  • Any other file type

Save links for quick access:

  1. Navigate to the Links section
  2. Enter the URL
  3. Optionally add a description
  4. Click Save

Links are displayed in last-in-first-show order, making recent links easily accessible.

Using the Notepad

The built-in Notepad provides:

  • Markdown Editing: Write using Markdown syntax
  • Live Preview: See rendered output in real-time
  • Persistent Storage: Notes are saved automatically

Useful for:

  • Quick notes
  • Code snippets with syntax highlighting
  • Formatted documentation
  • Meeting notes

API Access

REST Endpoints

Local Content Share provides API access:

Snippets:

Terminal window
# Create snippet
curl -X POST https://your-instance.klutch.sh/api/snippets \
-H "Content-Type: application/json" \
-d '{"content": "Hello World"}'
# List snippets
curl https://your-instance.klutch.sh/api/snippets

Files:

Terminal window
# Upload file
curl -X POST https://your-instance.klutch.sh/api/files \
-F "file=@/path/to/file.pdf"
# List files
curl https://your-instance.klutch.sh/api/files

Programmatic Integration

Use the API for automation:

import requests
# Upload a file
with open('document.pdf', 'rb') as f:
response = requests.post(
'https://your-instance.klutch.sh/api/files',
files={'file': f}
)
# Create a snippet
response = requests.post(
'https://your-instance.klutch.sh/api/snippets',
json={'content': 'Important note'}
)

Adding Authentication

Since Local Content Share lacks built-in authentication, consider these options:

Basic Auth with Nginx

Deploy a sidecar Nginx container with basic authentication.

OAuth Proxy

Use an OAuth2 proxy like oauth2-proxy for SSO integration.

Klutch.sh Authentication

Check if Klutch.sh provides authentication features for deployed apps.

VPN Access

Restrict access to users on your VPN network.

Production Best Practices

Security Recommendations

  • Add Authentication: Implement authentication before storing sensitive data
  • HTTPS Only: Always use HTTPS for secure transfers
  • Access Monitoring: Monitor who accesses your instance
  • Content Review: Regularly review stored content

Storage Management

  • Monitor Usage: Keep track of storage consumption
  • Clean Old Files: Remove files that are no longer needed
  • Organize Content: Use meaningful names for files and snippets

Backup Strategy

Protect your shared content:

  1. Regular Backups: Back up /data directory regularly
  2. Automated Backups: Set up scheduled backup jobs
  3. Offsite Storage: Store backups in a separate location

Use Cases

Personal Use

  • Quick file transfers between devices
  • Temporary storage for snippets
  • Cross-device clipboard
  • Note-taking on the go

Team Use

  • Share files with colleagues
  • Quick code snippet sharing
  • Link collections for projects
  • Meeting notes distribution

Development

  • Share configuration files
  • Quick log sharing
  • Temporary file hosting
  • Code snippet exchange

Troubleshooting Common Issues

Files Not Uploading

Symptoms: Upload fails or times out.

Solutions:

  • Check file size limits
  • Verify available storage space
  • Check network connectivity
  • Review browser console for errors

Snippets Not Saving

Symptoms: Text doesn’t persist after saving.

Solutions:

  • Verify persistent volume is mounted
  • Check write permissions
  • Review application logs
  • Test with a simple snippet

Interface Not Loading

Symptoms: Browser shows error or blank page.

Solutions:

  • Verify deployment is running
  • Check correct port configuration
  • Clear browser cache
  • Test in incognito mode

Performance Issues

Symptoms: Slow uploads or interface lag.

Solutions:

  • Check allocated resources
  • Monitor storage I/O
  • Review file sizes
  • Consider upgrading resources

Additional Resources

Conclusion

Deploying Local Content Share on Klutch.sh gives you a simple, effective content sharing solution accessible from anywhere. The combination of text snippets, file sharing, link storage, and Markdown notepad provides all the tools needed for quick content exchange.

While designed for local network use, deploying on Klutch.sh with proper authentication extends its utility to remote access scenarios. The minimal resource requirements and straightforward interface make it an excellent choice for personal or small team use.

Remember to implement authentication when deploying publicly and regularly back up your data to protect your shared content.