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:
- Add authentication through a reverse proxy or Klutch.sh’s authentication features
- Use this only for non-sensitive content
- 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└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM ghcr.io/tanq16/local-content-share:latest
# Set environment variablesENV PORT=8080
# Create data directoryRUN mkdir -p /data
# Set working directoryWORKDIR /app
# Expose the web interface portEXPOSE 8080
# The base image includes the default entrypointCreating the .dockerignore File
Create a .dockerignore file:
.git.github*.mdLICENSE.gitignore*.log.DS_Store.env.env.localEnvironment Variables Reference
Local Content Share supports configuration through environment variables:
| Variable | Required | Default | Description |
|---|---|---|---|
PORT | No | 8080 | Port to listen on |
DATA_DIR | No | /data | Directory for storing content |
Deploying Local Content Share on Klutch.sh
Once your repository is prepared, follow these steps to deploy:
- Select HTTP as the traffic type
- Set the internal port to 8080
- Detect your Dockerfile automatically
- Build the container image
- Attach the persistent volumes
- Start the Local Content Share container
- Provision an HTTPS certificate
Push Your Repository to GitHub
Initialize your repository and push to GitHub:
git initgit add Dockerfile .dockerignoregit commit -m "Initial Local Content Share deployment configuration"git remote add origin https://github.com/yourusername/local-content-share-deploy.gitgit push -u origin mainCreate 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:
Set Environment Variables
In the environment variables section:
| Variable | Value |
|---|---|
PORT | 8080 |
Attach Persistent Volumes
Add persistent storage for your content:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/data | 10 GB | Uploaded files, snippets, and links |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
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:
- Snippets: Share and view text content
- Files: Upload and download files
- Links: Store and access URLs
- Notepad: Markdown editor with preview
Sharing Text Snippets
Share text content instantly:
- Navigate to the Snippets section
- Enter or paste your text
- Click Save or Share
- The snippet becomes accessible from any device
Snippets are displayed in reverse chronological order (newest first).
Uploading Files
Share files across devices:
- Navigate to the Files section
- Click Upload or drag and drop files
- Files become immediately available for download
- 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
Storing Links
Save links for quick access:
- Navigate to the Links section
- Enter the URL
- Optionally add a description
- 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:
# Create snippetcurl -X POST https://your-instance.klutch.sh/api/snippets \ -H "Content-Type: application/json" \ -d '{"content": "Hello World"}'
# List snippetscurl https://your-instance.klutch.sh/api/snippetsFiles:
# Upload filecurl -X POST https://your-instance.klutch.sh/api/files \ -F "file=@/path/to/file.pdf"
# List filescurl https://your-instance.klutch.sh/api/filesProgrammatic Integration
Use the API for automation:
import requests
# Upload a filewith open('document.pdf', 'rb') as f: response = requests.post( 'https://your-instance.klutch.sh/api/files', files={'file': f} )
# Create a snippetresponse = 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:
- Regular Backups: Back up
/datadirectory regularly - Automated Backups: Set up scheduled backup jobs
- 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.