Skip to content

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:

Repository Structure

Create a GitHub repository with the following structure:

wastebin-deploy/
├── Dockerfile
└── .dockerignore

Dockerfile

Create a Dockerfile in your repository:

FROM matze/wastebin:latest
# Wastebin default port
EXPOSE 8088
# The base image handles the entrypoint

Environment Variables

VariableRequiredDefaultDescription
WASTEBIN_ADDRESS_PORTNo0.0.0.0:8088Listen address and port
WASTEBIN_BASE_URLNoAuto-detectedBase URL for the application
WASTEBIN_MAX_BODY_SIZENo1048576Maximum paste size in bytes (1 MB default)
WASTEBIN_DATABASE_PATHNo/data/wastebin.dbPath to SQLite database
WASTEBIN_SIGNING_KEYNoGeneratedKey for signing cookies
WASTEBIN_TITLENowastebinSite title

Deployment on Klutch.sh

  1. Push your Dockerfile to your GitHub repository.
  2. Log in to Klutch.sh and create a new project.
  3. Create a new app within your project and connect your GitHub repository containing the Dockerfile.
  4. Configure the deployment settings: - Select **HTTP** as the traffic type - Set the internal port to **8088**
  5. 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
  6. Attach a persistent volume: - Mount path: `/data` - Recommended size: 1 GB - Purpose: SQLite database storing all pastes
  7. Click **Deploy** and wait for the build to complete.
  8. Access your Wastebin instance at the provided URL and create your first paste.

Usage

Creating Pastes

  1. Navigate to your Wastebin URL
  2. Paste or type your content
  3. Select the language for syntax highlighting (or leave on auto-detect)
  4. Optionally enable encryption or set an expiration time
  5. 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:

Terminal window
curl -X POST -d "content=your paste here" https://your-wastebin.klutch.sh

Troubleshooting

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.

Additional Resources