Agency

Deploying Anywhere with Kamal: A Modern Guide to Simple, Portable, and Reliable Application Delivery

Kamal takes a different approach: package your application as a container, connect it to servers you control, and let a lightweight deployment workflow handle releases, networking, health checks, and rollbacks.

LAST UPDATED: May 31, 2025
9 min read
Deploying Anywhere with Kamal: A Modern Guide to Simple, Portable, and Reliable Application Delivery

Modern deployment does not have to mean building a massive platform team, maintaining a complex Kubernetes cluster, or stitching together dozens of infrastructure services. Kamal takes a different approach: package your application as a container, connect it to servers you control, and let a lightweight deployment workflow handle releases, networking, health checks, and rollbacks. The result is a deployment model that can work across cloud providers, dedicated servers, VPS platforms, and private infrastructure without tying the application too tightly to one hosting environment. But simplicity does not mean ignoring production engineering. To use Kamal well, teams still need to think carefully about secrets, persistent data, zero-downtime releases, observability, backups, and failure recovery.

Why Deployment Has Become Too Complicated

Application deployment has evolved from:

Build
 ↓
Copy Files
 ↓
Restart Server

into increasingly elaborate systems:

Git
 ↓
CI/CD
 ↓
Container Registry
 ↓
Orchestrator
 ↓
Cluster
 ↓
Ingress
 ↓
Service Discovery
 ↓
Application

For organizations operating at enormous scale, this complexity can be justified.

But many applications do not need a large orchestration platform.

A typical SaaS product might need:

A few application servers

A database

A cache

Background workers

TLS

Health checks

Automated deployments

Rollback capability

Building an entire platform for this can create more operational overhead than business value.

This is the problem Kamal attempts to address.

What Is Kamal?

Kamal is a deployment tool designed around containers and remote servers.

At a high level:

Application
    ↓
Container Image
    ↓
Kamal
    ↓
Remote Server
    ↓
Running Container

The application can be packaged once and deployed to infrastructure without requiring a heavyweight orchestration layer.

The infrastructure might be:

A VPS

A dedicated server

A cloud VM

Multiple cloud instances

Private infrastructure

The underlying provider matters less because the deployment unit is the container.

That leads to an important principle:

Your application should be portable even when your infrastructure changes.

The Core Kamal Deployment Model

A simplified Kamal workflow looks like:

Developer
    ↓
Git Push
    ↓
CI / Build
    ↓
Container Image
    ↓
Kamal Deploy
    ↓
Remote Host
    ↓
New Container
    ↓
Health Check
    ↓
Traffic

Instead of manually configuring every server, deployment configuration describes the application and its infrastructure requirements.

This can make deployments repeatable.

A production release should not depend on:

"Ask the engineer who knows how this server works."

It should depend on:

Version-controlled deployment configuration.

Why Containerized Deployment Changes the Equation

Containers create a consistent application boundary.

Without containers:

Developer Machine
     ≠
Production Server

With containers:

Build Environment
      ↓
Container Image
      ↓
Production

The same image can move through environments.

That reduces a common deployment problem:

"It worked locally."

A container does not eliminate environment differences, but it makes the application runtime much more explicit.

The deployment artifact becomes:

Application
+
Runtime
+
Dependencies
+
Configuration Interface

That is a much stronger foundation for repeatable releases.

Deploying Without a Large Platform

One of Kamal's most attractive ideas is that you can achieve modern deployment practices without introducing a massive orchestration platform.

Consider a small production environment:

                Load Balancer
                     │
          ┌──────────┴──────────┐
          ▼                     ▼
      Server 1              Server 2
          │                     │
       App A                  App A
       Worker                 Worker

You can get:

Containerized releases

Rolling updates

Health checks

Remote deployment

Service management

without necessarily operating an entire Kubernetes control plane.

This can significantly reduce the number of systems engineers need to understand.

Configuration and Environment Management

Deployment configuration should be explicit.

A modern application typically separates:

Application Code
      +
Deployment Configuration
      +
Secrets
      +
Infrastructure Settings

Secrets should not be committed directly into source control.

Examples include:

Database credentials

API keys

Encryption keys

Application secrets

Cloud credentials

A deployment process should inject sensitive configuration securely.

The principle is:

Configuration can be versioned. Secrets should be protected.

This distinction becomes increasingly important as deployment infrastructure scales.

Zero-Downtime Deployments

A production deployment should ideally avoid:

Old Version
    ↓
Stop Everything
    ↓
Deploy
    ↓
Start Everything

because users experience downtime.

A safer model is:

Old Version
     │
     │ Serving Traffic
     ▼
New Version Starts
     │
     ▼
Health Check
     │
     ▼
Traffic Moves
     │
     ▼
Old Version Removed

This creates a deployment transition instead of a hard restart.

For customer-facing applications, this distinction matters.

A deployment should ideally feel like:

The system changed.

not:

The system disappeared for a minute.

Health Checks and Release Safety

Starting a container is not the same as having a healthy application.

A process can be running while:

The database is unreachable

Required configuration is missing

A migration failed

A critical dependency is unavailable

The application cannot serve requests

Therefore, deployments should validate application health before directing traffic to a new release.

Conceptually:

New Container
     ↓
Start
     ↓
Health Check
     ↓
Healthy?
   /      \
 No        Yes
 ↓          ↓
Stop      Receive
          Traffic

This creates a basic safety barrier between deployment and production traffic.

Rollbacks and Recovery

Even well-tested deployments can fail.

A good deployment strategy therefore needs a fast recovery path.

Release N
   ↓
Release N+1
   ↓
Production Issue
   ↓
Rollback
   ↓
Release N

The ability to recover quickly is often more important than trying to make deployments perfect.

Teams should know:

What gets rolled back?

How quickly can it happen?

What happens to database changes?

How are background jobs affected?

How do we verify recovery?

A rollback plan should be designed before the incident.

Database Migrations Are Different

Application containers are disposable.

Databases are not.

This creates an important boundary:

Application
  ↓
Disposable Container

Database
  ↓
Persistent State

A deployment can be rolled back easily if the new container is incompatible.

But a database migration may change persistent state permanently.

For example:

App v1
 ↓
Migration
 ↓
App v2

Rolling back to App v1 may not automatically reverse the migration.

This is why database changes should be designed with backward compatibility where possible.

A safer migration strategy often looks like:

Add Compatible Schema
        ↓
Deploy Code Using It
        ↓
Migrate Data
        ↓
Remove Old Structure Later

This is often called an expand-and-contract approach.

Managing Databases and Persistent Storage

Kamal can simplify application deployment, but it does not remove the need for sound data architecture.

Ask:

Where does persistent data live?

A production architecture might be:

Application Containers
        │
        ├── Database
        ├── Redis
        └── Object Storage

The application containers can be replaced freely.

Persistent systems need:

Backups

Replication where required

Monitoring

Recovery procedures

Capacity planning

Do not confuse containerized deployment with disposable infrastructure for stateful systems.

Scaling Applications with Kamal

Kamal can support a deployment model where application workloads run across multiple servers.

For example:

                  Traffic
                     │
               Load Balancer
                     │
          ┌──────────┼──────────┐
          ▼          ▼          ▼
       Server 1   Server 2   Server 3
          │          │          │
        App        App        App

The application should remain as stateless as practical.

That means avoiding important data being stored only inside one application container.

Use shared systems for:

Sessions

Caches

Files

Queues

Databases

This allows a request to reach any application instance.

Deploying Across Different Infrastructure

One of Kamal's strongest conceptual advantages is infrastructure portability.

Your application deployment model can remain relatively consistent across:

Cloud VM
Dedicated Server
VPS
Private Infrastructure

The infrastructure changes.

The container remains the deployment unit.

That can reduce platform lock-in.

For example:

Same Application Image
       │
 ┌─────┼──────────┐
 ▼     ▼          ▼
AWS   Hetzner   Private VM

The exact operational environment still matters, but the application does not need to be redesigned simply because the hosting provider changes.

Observability and Operations

Simple deployment does not mean simple production operations.

You still need visibility into:

Application logs

Request latency

Error rates

Container health

CPU

Memory

Disk

Database health

Background jobs

A useful architecture is:

Application
    │
    ├── Logs
    ├── Metrics
    └── Traces
          │
          ▼
      Observability

When a deployment causes an issue, you need to answer quickly:

What changed?

When did it change?

Which service is affected?

Can we roll back safely?

Deployment simplicity is valuable because it can make these questions easier to answer.

Common Kamal Deployment Mistakes

Treating Kamal as a Replacement for Architecture

A deployment tool cannot fix poor application architecture.

Assuming Containers Solve Everything

Containers package applications.

They do not solve:

Database scaling

Observability

Backups

Security

Capacity planning

Ignoring Rollbacks

A deployment process without a recovery strategy is incomplete.

Treating Databases Like Containers

Application processes are disposable.

Persistent data requires a different operational strategy.

Storing Important State Locally

Local container storage should not become the source of truth for important application data.

Skipping Health Checks

A running container is not necessarily a healthy application.

Deploying Without Monitoring

A successful deployment command does not guarantee a successful production release.

Making Infrastructure Too Complicated

If the application is small, do not build an infrastructure platform whose complexity exceeds the application's needs.

A Modern Kamal Architecture

A production architecture can remain surprisingly straightforward:

                         Users
                           │
                           ▼
                    Load Balancer
                           │
             ┌─────────────┼─────────────┐
             ▼             ▼             ▼
          Server 1      Server 2      Server 3
             │             │             │
          App vX        App vX        App vX
             │             │             │
             └─────────────┼─────────────┘
                           │
             ┌─────────────┼─────────────┐
             ▼             ▼             ▼
          Database        Redis       Object Storage
                           │
                           ▼
                        Workers

Kamal manages the application deployment layer.

The rest of the architecture can remain deliberately simple.

That is often the point.

When Kamal Is the Right Choice

Kamal can be especially attractive for:

Small and medium-sized SaaS products

Rails applications

Containerized web applications

API services

Internal platforms

Teams with small infrastructure groups

Applications deployed to VMs

It is particularly useful when a team wants modern deployment practices without taking on the full operational complexity of a large orchestration platform.

Making the Call

Engineering leaders considering Kamal should ask:

How much deployment complexity does our application actually require?

Do we need a full orchestration platform?

Can containers give us the portability we need?

How important is infrastructure flexibility?

Can our application remain stateless?

Where will persistent data live?

How will we monitor deployments?

How quickly can we roll back a failed release?

Most importantly:

Are we solving a real operational problem, or are we adopting infrastructure complexity simply because larger companies use it?

The right deployment platform should make the engineering team faster and more confident—not create another system they have to constantly maintain.

Final Takeaway

Deploying anywhere with Kamal is fundamentally about reducing the distance between:

Code
 ↓
Container
 ↓
Server
 ↓
Production

without requiring an enormous infrastructure stack.

A strong deployment model provides:

Reproducible releases

Containerized applications

Health checks

Zero-downtime deployment patterns

Rollback capability

Infrastructure portability

Simple operational workflows

But the real advantage is not merely technical simplicity.

It is operational clarity.

The best deployment system is not the one with the most features. It is the one that gives your team enough automation, safety, and visibility to deploy confidently without making the infrastructure harder to understand than the application itself.

Kamal is particularly compelling when a team wants the benefits of modern containerized deployment while retaining control over straightforward servers and infrastructure.

The winning architecture is therefore not:

"Use the biggest orchestration platform available."

It is:

"Use the smallest operational system that reliably meets the application's requirements."

With containers as the deployment unit, version-controlled configuration, health-aware releases, proper monitoring, persistent data handled separately, and tested rollback procedures, teams can achieve a deployment workflow that is both modern and refreshingly simple.

That simplicity is not a step backward. It can be a competitive advantage—because every layer of infrastructure you do not have to operate is another layer of complexity your engineering team does not have to debug at 2 a.m.

Frequently Asked Questions

No. Kamal is designed specifically to avoid the complexity of Kubernetes for applications that don't need it. It deploys containers directly to standard servers (VPS, dedicated, or cloud VMs) while still providing features like zero-downtime deploys and rolling updates.
While Kamal is excellent for stateless application containers, managing persistent state like databases requires a different operational strategy. It's often recommended to use managed database services or dedicated, separately-managed infrastructure for stateful workloads.
Kamal supports health checks before routing traffic to new containers and allows for fast rollbacks to previous versions. A strong deployment strategy with Kamal should always include a pre-planned recovery and rollback procedure.

Need a product built?

We build custom software, mobile apps, and web platforms for startups and enterprises.

Alejandro D.
Vatsalya R.Backend Developer
Gustavo A.
Ganeshan S.Sr. Software Engineer
Fiorella G.
Uptal JoshiSr. Data Scientist

Their team became an extension of ours — within months they'd rebuilt our entire product experience from the ground up.

BitForge
Sr. ArchitectBitForge
Read Case Study