DEV Community

Cover image for How I Built a Full-Featured SaaS with Rails 8 and Deploy It with One Command
José
José

Posted on

How I Built a Full-Featured SaaS with Rails 8 and Deploy It with One Command

When I set out to build MatGoat, a management platform for martial arts academies, I had one goal: keep it simple.

No Kubernetes. No microservices. No complex CI/CD pipelines. Just a Rails monolith that I could deploy with a single command.

Here's how I did it.

## The Stack

  • Rails 8.1 with Hotwire (Turbo + Stimulus)
  • PostgreSQL for the database
  • Kamal 2 for deployment
  • Hetzner Cloud for hosting (~€20/month)
  • Solid Queue for background jobs
  • Tailwind CSS for styling

That's it. No webpack. No Node.js build step. No Redis cluster. No separate job server infrastructure.

Why Rails 8 Changes Everything

Rails 8 introduced what I call the "Solid trifecta":

  • Solid Queue - Database-backed job processing
  • Solid Cache - Database-backed caching
  • Solid Cable - Database-backed Action Cable

This means I don't need Redis for most use cases. My background jobs, caching, and real-time updates all run on the same PostgreSQL database that handles my application data.

One less service to manage. One less thing to break.

Deployment in One Command

Here's the entire deployment process:

  kamal deploy
Enter fullscreen mode Exit fullscreen mode

That's it. That's the actual command. Kamal handles:

  • Building the Docker image
  • Pushing it to the registry
  • Rolling out the new version with zero downtime
  • Running database migrations
  • Managing SSL certificates via Let's Encrypt

My deploy.yml is about 100 lines. It defines my web server, job worker, PostgreSQL database, Redis (for Action Cable in production), and automated database backups to S3.

The Architecture That Scales Down

Most architecture articles focus on scaling up. But for indie developers and small teams, scaling down is more valuable.

https://matgoat.com runs on Hetzner. The entire infrastructure costs less than a Netflix subscription each month. Yet it handles:

  • Multi-tenant academy management.
  • Real-time class registrations via WebSockets.
  • Video content delivery.
  • Student progress tracking.
  • Automated class scheduling.

When (if) I need to scale, I add another server to the servers array in my Kamal config. That's it.

What I Don't Have

  • No container orchestration platform.
  • No managed database service.
  • No separate CDN configuration.
  • No infrastructure-as-code beyond the Kamal config.

And I don't miss any of it.

The Maintenance Story

Every day, I run:

kamal deploy

If something goes wrong:

kamal rollback

Need to check logs?

kamal logs

Need a Rails console?

kamal console

The mental overhead is minimal. I spend my time building features, not fighting infrastructure.

The Takeaway

You don't need a complex architecture to build a real product. Rails 8 with Kamal gives you:

  • Simplicity: One language, one framework, one deployment tool
  • Speed: Deploy in minutes, not hours
  • Cost efficiency: Run everything on a single VPS
  • Maintainability: Less moving parts means fewer things that break

If you're an indie developer or a small team, consider whether you really need that Kubernetes cluster. Sometimes the boring solution is the right one.

Top comments (0)