Pastebins

pastes.dev

Modern, open source code pastebin built on the Monaco editor, with highlighting for many languages, themes, line links and a one-line curl API. No account needed.

  • Code editor
  • Syntax highlighting
  • Command line
  • Open source
  • No account

About pastes.dev

pastes.dev is a web app for writing and sharing code, created by the developer lucko as a personal take on traditional pastebin sites. The editor is built on Monaco, the same editor component used in Visual Studio Code, so it offers syntax highlighting for many languages, automatic indentation, themes and zoom.

Once saved, a paste gets a short URL, and you can link to specific lines or sections within it. The front end is written in React, and pastes are stored by a companion service, bytebin. Both are open source under the MIT licence.

The site needs JavaScript to run in the browser, but it also has a plain HTTP endpoint, which makes it convenient for sending logs or command output straight from a terminal.

How to create a paste

  1. Go to pastes.dev and type or paste into the editor.
  2. Choose a language for highlighting if needed.
  3. Save the paste and share the link it creates.

From the command line, send content to the API with curl:

curl -T example.txt https://api.pastes.dev/post
echo "Hello world" | curl -T - https://api.pastes.dev/post
curl -T config.yml -H "Content-Type: text/yaml" https://api.pastes.dev/post

Things to know

  • Visibility: pastes are readable by anyone with the link. There are no accounts, passwords or encryption options, so do not paste secrets.
  • Self-hosting: the project can be run locally or on a server with docker compose up -d.
  • Limits and retention: the project documentation does not state a paste size limit or how long pastes on pastes.dev are kept, so keep your own copy of anything important.

Frequently asked questions

Is pastes.dev the same as Hastebin?

No. pastes.dev is a separate open source project by the developer lucko. It offers a similar quick, no-account way to share code, while Hastebin itself is now run by Toptal.

Can I use pastes.dev from the terminal?

Yes. Upload a file or piped output to https://api.pastes.dev/post with curl, and the service returns a key identifying the new paste (in the Location header and as JSON).

Can I host my own copy?

Yes. The code is MIT licensed and the project provides a Docker Compose set-up. Storage is handled by a separate service called bytebin.

Sources

  1. pastes.dev
  2. github.com/lucko/paste
  3. github.com/lucko/bytebin
  4. toptal.com/developers/hastebin