Joseph Scott

Redbean Is Software Wizardry


Every now and then you come across a piece of code that feels like magic. Today that is Redbean, it handles web requests with wizard like powers.

Redbean is a single binary web server, written in C, that runs on natively on Linux, Mac, Windows, FreeBSD, OpenBSD, and NetBSD. All of that is made possible by Cosmopolitan Libc. And if that were not enough it also embeds Lua and SQLite. How big is that binary you ask? 2.1 megabytes.

On my MacOS laptop it was three easy steps:

$ curl >
$ chmod 755
$ ./

Then visit The documentation at covers the details of what Redbean can do.

Oh, and it comes with TLS support out of the box, using an automatically generated self signed certificate by default. Meaning those three commands above already include HTTPS. That self signed certificate will generate a warning in browsers, Chrome says NET::ERR_CERT_AUTHORITY_INVALID.

But wait, there is more!

Redbean uses a protocol polyglot for serving HTTP and HTTPS on the same port numbers.

You read that right, it supports HTTP and HTTPS on the same port. Going to works right away. Not something I'd generally look at for regular production services, but it makes getting things started locally very easy.

All in all, Redbean is a fascinating piece of software, one that I'll be keeping my eye on.