selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

hasty-paste logo

Self-host hasty-paste

v2.4.1

Lightning-fast pastebin with sleek web UI

ReleaseOpen SourceAGPL-3.0
Updated9 hours ago
LanguageGo
Setup difficultyEasy
MobileResponsive
ThemeDark mode
Stars
254
Port
8080 (HTTP web interface)
Docker
ghcr.io/enchant97/hasty-paste
Install with Docker Compose
Showcase of Hasty Paste II web interface showing multiple app pages

What is hasty-paste?

Hasty Paste II is a self-hosted pastebin designed for individuals and teams who want a fast, modern way to share text and code snippets. It offers three visibility levels (public, unlisted, private), customizable slugs, paste expiry, and file attachments. Content can be rendered as plain text, Markdown, or syntax-highlighted code. User accounts support an anonymous mode, and single sign-on works via any OpenID Connect/OAuth2 provider. The UI includes both light and dark themes and is fully responsive. The application runs as a single Docker container (ghcr.io/enchant97/hasty-paste) with configuration via environment variables, using SQLite by default for storage. It exposes a REST API for programmatic paste creation. The project is licensed under AGPL-3.0 and accepts donations via Buy Me A Coffee.

Should you self-host hasty-paste?

hasty-paste scores 48/100 on selfhost.directory (how scoring works) and ranks #10 of 19 in Pastebins. It has 254 GitHub stars.

It shipped 4 stable releases in the past year. The latest, v2.4.1, came out on 3 September 2026. New versions land roughly every 6 weeks.

Setup is easy: most people get it running in one sitting. An official Docker image is available. It is AGPL-3.0-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is Opengist (68/100, 3 406 stars). It scores higher overall, so compare the two before you pick. See hasty-paste vs Opengist side by side.

Features

  • Content rendering
  • Customizable paste slugs
  • File attachments
  • OpenID/OAuth2 SSO
  • Paste expiry
  • Paste visibility controls
  • REST API
  • User accounts with anonymous mode

hasty-paste README

How to install hasty-paste

Install hasty-paste with Docker Compose

Docker and Docker Compose
Environment variables
AUTH_TOKEN_SECRET, SESSION_SECRET, PUBLIC_URL, ANONYMOUS_PASTES_ENABLED, SIGNUP_ENABLED

volumes: data:

services: hasty-paste: image: ghcr.io/enchant97/hasty-paste:2 restart: unless-stopped volumes: - data:/opt/hasty-paste/data environment: AUTH_TOKEN_SECRET: "${AUTH_TOKEN_SECRET}" SESSION_SECRET: "${SESSION_SECRET}" PUBLIC_URL: "http://example.com" # it is recommended to disable the anonymous account if hosting publicly # ANONYMOUS_PASTES_ENABLED: "false" # once users have been created, disable this, if hosting publicly # SIGNUP_ENABLED: "false" ports: - 80:8080

Requires AUTH_TOKEN_SECRET and SESSION_SECRET environment variables (generate with: openssl rand -base64 32). Recommended to use a reverse proxy for HTTPS.

How to configure hasty-paste

  • ANONYMOUS_PASTES_ENABLEDtrueWhether to allow anonymous users to create new pastes

    Whether to allow anonymous users to create new pastes

  • ATTACHMENTS_ENABLEDtrueWhether to allow attachments

    Whether to allow attachments

  • ATTACHMENTS_PATHwhere paste attachments will be stored

    where paste attachments will be stored

  • AUTH_TOKEN_EXPIRY604800seconds until a token expires

    seconds until a token expires

  • AUTH_TOKEN_SECRETbase64 encoded secret (must be at least 32 bytes)

    base64 encoded secret (must be at least 32 bytes)

  • BEHIND_PROXYfalseWhether app is behind a reverse proxy

    Whether app is behind a reverse proxy

  • BIND__HOST127.0.0.1What interface to listen on

    What interface to listen on

  • BIND__PORT8080What port to listen on

    What port to listen on

  • DB_URIURI for database connection

    URI for database connection

    values: sqlite://path/to/db.sqlite, postgresql://user:pass@host/db

  • EXPIRY__ANONYMOUS__DAYS2Days for anonymous expiry

    Days for anonymous expiry

  • EXPIRY__ANONYMOUS__ENABLEDfalseWhether to enable default expiry for anonymous users

    Whether to enable default expiry for anonymous users

  • EXPIRY__ANONYMOUS__HOURS0Hours for anonymous expiry

    Hours for anonymous expiry

  • EXPIRY__ANONYMOUS__LIMIT_ENABLEDfalseWhether to force an expiry for anonymous users

    Whether to force an expiry for anonymous users

  • EXPIRY__ANONYMOUS__MONTHS0Months for anonymous expiry

    Months for anonymous expiry

  • EXPIRY__ANONYMOUS__YEARS0Years for anonymous expiry

    Years for anonymous expiry

  • EXPIRY__USERS__DAYS2Days for user expiry

    Days for user expiry

  • EXPIRY__USERS__ENABLEDfalseWhether to enable default expiry for users with accounts

    Whether to enable default expiry for users with accounts

  • EXPIRY__USERS__HOURS0Hours for user expiry

    Hours for user expiry

  • EXPIRY__USERS__LIMIT_ENABLEDfalseWhether to force an expiry for users with accounts

    Whether to force an expiry for users with accounts

  • EXPIRY__USERS__MONTHS0Months for user expiry

    Months for user expiry

  • EXPIRY__USERS__YEARS0Years for user expiry

    Years for user expiry

  • INTERNAL_AUTH_ENABLEDtrueWhether to allow login for internal accounts

    Whether to allow login for internal accounts

  • MAX_PASTE_SIZE12582912Max paste size in bytes including all attachments

    Max paste size in bytes including all attachments

  • OIDC__CLIENT_IDThe client id

    The client id

  • OIDC__CLIENT_SECRETThe client secret

    The client secret

  • OIDC__ENABLEDfalseWhether OpenID/OAuth2 Is Enabled

    Whether OpenID/OAuth2 Is Enabled

  • OIDC__ISSUER_URLThe OIDC issuer url

    The OIDC issuer url

  • OIDC__NAMEThe provider name (used for UI)

    The provider name (used for UI)

  • PUBLIC_URLPublic URL where service can be accessed

    Public URL where service can be accessed

  • RANDOM_SLUG_LENGTH10How long the randomly generated slug will be

    How long the randomly generated slug will be

  • SESSION_SECRETbase64 encoded secret (must be at least 32 bytes)

    base64 encoded secret (must be at least 32 bytes)

  • SIGNUP_ENABLEDtrueWhether to allow new accounts to be created

    Whether to allow new accounts to be created

hasty-paste releases & version history

More in Pastebins

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…