How DHH Solved Deploying to Production (with Open Source)


How DHH Solved Deploying to Production
(with Open Source)

Ever felt depressed by the sheer complexity of getting your application live and serving users?

You’re not alone.

But what if deploying to production, even (or especially) across multiple servers, could be straightforward and more importantly, free?

That’s the reality DHH, the creator of Ruby on Rails and CTO of Basecamp & HEY, wanted to create, and he delivered with an open source tool called Kamal.

DHH’s approach to technology always involves simplicity, developer experience, and skepticism towards “the next big complex thing,” especially when it involves crazy monthly bills or vendor lock-ins.

He’s a well known proponent of a “do-it-yourself” approach when it makes sense, advocating for owning your own servers rather than being entirely reliant on the cloud.

Kamal, officially released by Basecamp, is the hate-child 👺 of DHH’s allergy to overpaying cloud bills.

It’s designed to make managing your own servers a breeze, by requiring nothing but an Ubunutu box with SSH. That's it.

The Deployment Dilemma: Complexity and Cost

Let’s be honest, deploying modern applications can be a nightmare.

You need to get your code onto servers, ensure it runs reliably, handle updates with zero downtime, manage sensitive information like API keys, and ideally integrate everything smoothly with your workflow using CI/CD.

Many devs and teams turn to powerful but often ungodly complex solutions like Kubernetes (or less crazy ones like Docker Swarm).

These are fantastic tools, but they come with a steep learning curve, and lots of base requirements. You might find yourself wrestling with concepts like leader and follower nodes, control planes, and worker setups, all before your app even sees the light of day.

The alternative?

Paid Platform-as-a-Service or managed services, like Fly, Heroku, Render etc.
These can simplify things but often lead to significant ongoing costs and can lock you into a specific provider’s ecosystem, reducing your flexibility.
For many, especially smaller teams or projects, these solutions can feel like using a sledgehammer to crack a nut (or this:)


Enter Kamal: The Open Source Answer

So, how did DHH decide to tackle this differently?

He built Kamal.
The core idea is radical simplicity without sacrificing power.

Imagine being asked to deploy a production-grade system, complete with all the bells and whistles, but with one crucial rule: no paid services.
Kamal is designed to win that game.

What makes Kamal stand out?

Simplicity is Key: Forget complex preconfiguration.
All Kamal needs is a list of your server IPs (fresh Ubuntu servers are perfect) and SSH access (yes, that's it).
Kamal handles the rest: even installing Docker if it’s not there.
You don’t even need to SSH into the servers yourself to get started.


Deploy Anywhere:

This simplicity means incredible flexibility.
Kamal can deploy your application to multiple cloud providers simultaneously, to your own bare-metal servers, or even to the Raspberry Pi on your shelf at home.
I actually deployed an app running in Paris with its cache (a Valkey instance) running on a completely different server on AWS in the United States! - (there was no real good reason to do that, pure curiosity, but it wokred!)

Production ready Features, built In:

Kamal isn’t just for hobby projects.
It handles zero-downtime deployments (rolling updates), manages your application secrets securely, and can automate SSL certificate provisioning and renewal using Let’s Encrypt – a huge win for anyone who had the pleasure of fighting with certificate expiry.

Open Source and Free:

As mentioned, Kamal is open source.
There's no premium features or tiers behind it.
This means no subscription fees, no vendor lockins, and a community driven tool that empowers you to own your servers.

Sensible Configuration:

You start off by running

kamal init

This will create a skeleton by dropping a bunch of basic configuration files to your project.

You define your application, servers, and other settings in a straightforward config/deploy.yaml file. Kamal also supports “accessories” – supporting services like databases or cache instances (like Redis or Valkey) that don’t need to be part of every rolling update of your main application.

Developer friendly:

Written in Ruby (you wouldn't expect anything else from the creator of Ruby on Rails, would you?), Kamal offers handy aliases for common commands, much like scripts in a package.json files on node projects, and hooks to run custom actions at different stages of the deployment process.

My world famous guestbook app ended up running across two continents in under a minute, with subsequent updates taking a similar amount of time.

With each update, all that's required is running

kamal deploy

Kamal will contact remote servers, update a new version, create a rolling update while maintaining incoming traffic through its proxy to maintain zero downtime deployments.

Kamal essentially bundles a set of machines together into a cluster you control, without the typical overhead.
If you’re tired of deployment complexity, looking to reduce hosting costs, or simply want more control over your infrastructure without becoming a full time sysadmin, Kamal is definitely worth exploring.

It shines for applications where you want the power of modern deployment practices without the operational burden of systems like full blown Kubernetes.

It’s a proof that robust infrastructure management doesn’t always require intricate systems or expensive contracts. Sometimes, a well-thought-out, simpler tool can be far more effective.

It's also a great reminder that some status quo's in tech can be questioned. I mean, I'd be thinking about swarm, k3s, nomad and a bunch of other options before even considering it can be done any other way...
While often controversial I highly recommend his blog and thoughts on tech life and in this case, infrastructure.

So, if the challenge of “production-ready in no time, with zero spend” resonates with you, give Kamal a look.

You might find it’s the breath of fresh air your production process needs.


Thank you for reading.
Feel free to reply directly with any question or feedback.
Have a great weekend!

ESPRESSO FRIDAYS

Every once in a while I send hand picked things I've learned. Kind of like your filter to the tech internet. No spam, I promise!

Read more from ESPRESSO FRIDAYS

Is Gemini CLI Worth The Hype? This issue is brought to you by: Securing AI agents is now possible with Auth0 . AI agents are reshaping digital experiences. But securing them requires rethinking identity and access controls built for a human-first world. Get Started Today With a new AI coding assistant announced every other week, it’s easy to feel overwhelmed by the “paradox of choice.” Google entered the game late with its Gemini CLI, but they made a smart move: they made it free and...

I Used Heroku Open Source Alternatives So You Don't Have To This issue is brought to you by: Enjoy fast, secure and reliable web hosting with Hostinger. Use "devopstoolbox" at checkout of extra discounts on op! Start hosting with Hostinger today! I recently went down the rabbit hole of self-hosted application platforms. Just 5 weeks ago I made a video covering Coolify end 2 end.Once that got released (or maybe, because of that?) I started seeing many similar, open source, self-hostable...

SQLite Is the ULTIMATE Choice For 99% of Projects When you need to crack a nut, you grab a nutcracker, not a sledgehammer. So why, when it comes to databases, do so many of us immediately reach for a heavy, complex solution, just because we “feel” it’s right? too much? This simple question changes how you look at building software.The default solution for most developers is to spin up a dedicated database server like MySQL, Postgres, or a NoSQL option. This means dealing with separate running...