Deploying Wastebin
Introduction
Wastebin is a minimal, fast, and privacy-focused pastebin server written in Rust. It provides a simple way to share code snippets, configuration files, logs, and other text content with syntax highlighting support and optional client-side encryption.
Unlike many pastebin alternatives, Wastebin is designed to be lightweight and efficient, using SQLite for storage and requiring minimal resources to run. The clean, distraction-free interface focuses on the content while supporting modern features like dark mode and keyboard shortcuts.
Key features of Wastebin include:
- Syntax Highlighting: Automatic language detection with manual override support
- Client-Side Encryption: Optional AES-256-GCM encryption with the key never leaving your browser
- Expiration Times: Set pastes to expire after a specified duration
- Burn After Reading: Create one-time pastes that delete after being viewed
- Raw View: Access paste content as plain text for easy programmatic access
- QR Code Generation: Generate QR codes for easy mobile sharing
- Dark Mode: Automatic or manual dark/light theme switching
- Line Numbers: Toggle line numbers for code pastes
- Keyboard Shortcuts: Efficient navigation with keyboard shortcuts
- No JavaScript Required: Core functionality works without JavaScript
This guide walks you through deploying Wastebin on Klutch.sh using Docker for a fast, private pastebin service.
Prerequisites
Before deploying Wastebin on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Wastebin configuration
- Basic familiarity with Docker concepts
Repository Structure
Create a GitHub repository with the following structure:
wastebin-deploy/├── Dockerfile└── .dockerignoreDockerfile
Create a Dockerfile in your repository:
FROM matze/wastebin:latest
# Wastebin default portEXPOSE 8088
# The base image handles the entrypointEnvironment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
WASTEBIN_ADDRESS_PORT | No | 0.0.0.0:8088 | Listen address and port |
WASTEBIN_BASE_URL | No | Auto-detected | Base URL for the application |
WASTEBIN_MAX_BODY_SIZE | No | 1048576 | Maximum paste size in bytes (1 MB default) |
WASTEBIN_DATABASE_PATH | No | /data/wastebin.db | Path to SQLite database |
WASTEBIN_SIGNING_KEY | No | Generated | Key for signing cookies |
WASTEBIN_TITLE | No | wastebin | Site title |
Deployment on Klutch.sh
- Push your Dockerfile to your GitHub repository.
- Log in to Klutch.sh and create a new project.
- Create a new app within your project and connect your GitHub repository containing the Dockerfile.
- Configure the deployment settings: - Select **HTTP** as the traffic type - Set the internal port to **8088**
- Add environment variables: - `WASTEBIN_BASE_URL`: Your app URL (e.g., `https://your-app.klutch.sh`) - `WASTEBIN_TITLE`: Optional custom title - `WASTEBIN_MAX_BODY_SIZE`: Adjust if you need larger pastes
- Attach a persistent volume: - Mount path: `/data` - Recommended size: 1 GB - Purpose: SQLite database storing all pastes
- Click **Deploy** and wait for the build to complete.
- Access your Wastebin instance at the provided URL and create your first paste.
Usage
Creating Pastes
- Navigate to your Wastebin URL
- Paste or type your content
- Select the language for syntax highlighting (or leave on auto-detect)
- Optionally enable encryption or set an expiration time
- Click “Save” or use Ctrl+S
Encrypted Pastes
When encryption is enabled, the encryption key is added to the URL fragment (after the #). This key never reaches the server, ensuring end-to-end encryption.
API Usage
Wastebin supports creating pastes via the command line:
curl -X POST -d "content=your paste here" https://your-wastebin.klutch.shTroubleshooting
Pastes Not Persisting
Ensure the persistent volume is mounted at /data and the WASTEBIN_DATABASE_PATH points to a file within that directory.
Large Pastes Rejected
Increase WASTEBIN_MAX_BODY_SIZE to allow larger pastes. The value is in bytes.