DEV Community

Hulk in Public
Hulk in Public

Posted on

I’m Blown Away by Kamal

My Previous Deployment Choices

Since I mostly do web development using Ruby on Rails, these were my go-to options for deployment:

  • PaaS like Heroku, Render, or Railway
  • Serverless setups (Cloud Run + NeonDB)

Honestly, I didn’t have any major complaints. PaaS costs a bit more, but in return, you get a clean UI and dead-simple workflows like GitHub integration. If the cost bothered me, I’d just go serverless. For my personal servers—where huge traffic isn't exactly a concern—going serverless meant the app would just sleep when inactive, allowing me to run services for around 50 yen a month. Compared to the headache of clicking through complex AWS or GCP dashboards to piece things together based on architecture diagrams, it was a walk in the park. I was perfectly content. Seriously.

Kamal Became the Default in Rails 8

Everything changed when Rails 8 dropped. I heard they adopted Kamal as the official deployment tool.

Kamal — Deploy web apps anywhere

From bare metal to cloud VMs using Docker, deploy web apps anywhere with zero downtime.

favicon kamal-deploy.org

Kamal? Is deploying really going to get any easier? I mean, I’m doing completely fine right now, though...

That’s what I thought. But once I gave it a shot, it felt like being struck by lightning. This is an absolute game-changer.

All you have to do is run rails new, throw your server's IP address into deploy.yml, and run kamal setup. That’s it—your app is deployed. For every release after that, it's just kamal deploy. I couldn't believe how simple the deployment workflow was.

# deploy.yml
service: my-app
image: my-user/my-app

servers:
  web:
    - 192.0.2.1 # Just swap in your VPS IP address here

proxy:
  ssl: true
  host: app.example.com # Set up your domain here
Enter fullscreen mode Exit fullscreen mode

Sure, you have to bring your own server, but Kamal prides itself on being able to deploy absolutely anywhere.

I rented a couple of VPS instances from Hetzner for about $10 a month each to host SuperRails and LazyCafe. From what I looked into, you can't really find a VPS much cheaper than that. It’s a tool that beautifully embodies DHH’s philosophy of refusing to be locked into any single platform.

Why You Should Be Using Kamal

If you're reading this, you might be feeling skeptical. You might be thinking, "What's wrong with PaaS?" or "Wait, isn't that more expensive than going serverless?"

But using Kamal comes with some serious advantages:

  • It’s incredibly simple: Like I just mentioned, it's effortless. Even if you aren't using Rails, anything that runs as a Docker container can be deployed to any VPS out there.
  • Zero platform lock-in: You can deploy to literally any VPS. This means your business won't get messed up by sudden policy or pricing changes from a specific PaaS provider. Pricing, server specs, regions—you get to make all those choices yourself. For instance, I sometimes need a Tokyo region server for Japanese users, but PaaS providers often lack Asian data centers. Heck, you could even turn an old, unused PC at home into a server and deploy to that.
  • Always-on connection: When you try to save money on server costs, serverless always crosses your mind. However, serverless forces a 10 to 20-second cold start on the user during the initial hit. That is simply not a good user experience.

The Return to VPS

To be completely honest, I didn't even know what a VPS was until recently. When I started learning to code about five years ago, the standard choices were already either using a PaaS like Heroku, going all-in on cloud services like AWS/GCP, or running things serverless. But looking at the history of computing, renting a VPS and deploying your own service there used to be the norm—the last decade or so was the anomaly. Why? Because the deployment process on a VPS used to be incredibly bloated and complicated.

Kamal completely solved that problem. Now, there's really no reason to rely on PaaS or massive cloud providers anymore.

By the way, I’ve accidentally racked up hundreds of dollars in bills from AWS and GCP before, usually because I forgot to delete a PostgreSQL database or an EC2 instance. It really makes me wonder why services with clunky, 2000s-era user interfaces are dominating the industry and treated as the default choice for businesses, despite being run by some of the most valuable corporations in the world.

It’s Crazy for Indie Devs and Startups to Spend Hundreds on Servers

I’ve been involved in a few small-scale startup projects, and it was totally normal to see them blowing $500 a month on server costs alone, even when they barely had any users. It made me think: If you just hold off for two months, that $1,000 could buy you a pretty solid physical server to build yourself.

I’m not saying everyone should manually assemble servers and run them out of their offices. But from a cost-performance standpoint, people are clearly being ripped off.

Moving forward, our company will be running all our products using Kamal. There is simply no better way to launch a service right now. Our third project is targeted at users in Japan, so we signed up with a provider offering a VPS in the Tokyo region. The total cost? Just $8 a month.

Top comments (0)