Lenpaste - Self Hosted Pastebin Alternative

Lenpaste is a Pastebin alternative with syntax highlighting and optional expiring notes. Self host your own instance! 🐳

Lenpaste - Self Hosted Pastebin Alternative

Sometimes you need a quick way to send code snippets and written guides or tutorials to people on the fly. Using Lenpaste is an excellent way to do this that allows you to add syntax and expiration times.

What is Lenpaste?

Lenpaste is a web service that allows you to share notes anonymously, an alternative to pastebin.com. Java Script is not used. There is its own API.

Using Lenpaste

Creating a paste is simple. Start by adding a title then pasting your content into to larger block. From here you can select the syntax that matches your content. I don't want this one to expire so I won't need to change that option.

I am using Markdown as an example so I chose the Markdown syntax. I'll add my name as the author and a link to the Self Hosted Roundup #17.

When the paste is created it will give you a link with a random string of 8 numbers and letters. This is the link you will send to others so they can view your note.

Lenpaste Core Features

  • No need to register
  • Supports multiple languages
  • Uses cookies only to store settings
  • Can work without JavaScript
  • Has its own API
  • Open source and self-hosted

Installing Lenpaste using Docker Compose

Lenpaste is super simple to setup. Using the provided Docker Compose stack we can install it and start making notes in seconds.

version: "2"

services:
  lenpaste:
    image: git.lcomrade.su/root/lenpaste:latest
    restart: always
    environment:
      # All parameters are optional
      - LENPASTE_ADDRESS=:80                 # Set -address flag
      - LENPASTE_DB_DRIVER=sqlite3           # Set -db-driver flag
      - LENPASTE_DB_SOURCE=/data/lenpaste.db # Set -db-source flag
      - LENPASTE_DB_CLEANUP_PERIOD=3h        # Set -db-cleanup-period flag
      - LENPASTE_ROBOTS_DISALLOW=false       # If true set -robots-disallow flag
      - LENPASTE_TITLE_MAX_LENGTH=100        # Set -title-max-length flag. If 0 disable title, if -1 disable length limit.
      - LENPASTE_BODY_MAX_LENGTH=10000       # Set -body-max-length flag. If -1 disable length limit. Can't be -1.
      - LENPASTE_MAX_PASTE_LIFETIME=never    # Set -max-paste-lifetime flag. Examples: 2d, 12h, 7m.
      - LENPASTE_ADMIN_NAME=                 # Set -admin-name flag.
      - LENPASTE_ADMIN_MAIL=                 # Set -admin-mail flag.
    volumes:
      # /data/lenpaste.db - SQLite DB
      # /data/about.html  - About this server
      # /data/rules.html  - This server rules
      - "${PWD}/data:/data"
      - "/etc/timezone:/etc/timezone:ro"
      - "/etc/localtime:/etc/localtime:ro"
    ports:
      - "80:80"

Final Notes and Thoughts

Lenpaste is a great way to quickly share notes and code snippets. You can also embed the pastes using the embed option that provides a generated iframe of the paste you create.

There's no registration or authentication so if you are looking to expose this and keep it private, it won't happen. At least right now it won't. One other thing, there's no way to see your previous notes without separately keeping track of all the links. It's very basic and works very well for what it is!