Hanami hosting on infrastructure you control

Deploy Hanami apps to servers you own

Hanami 2 is a fast, modular Ruby framework. Hatchbox deploys it the same way it has deployed Ruby apps since 2016 — git push, build, restart, no downtime.

Includes a 7 day free trial. $10 per server per month after that — unlimited apps.

Hatchbox spots Hanami in your Gemfile.lock and configures the deploy itself — it installs your Ruby, bundles your gems, compiles assets, runs migrations, and sets HANAMI_ENV=production for you. Nothing about your app has to change to make it container-shaped first.

It's version-aware, too. Hanami 2.x builds use the bin/hanami CLI while 1.3 uses bundle exec hanami, and the steps that don't apply to your version are skipped rather than failing the deploy.

Why deploy Hanami with Hatchbox

Built for Rack apps, not just Rails

Hatchbox doesn't assume Rails. Any Rack-compatible app — Hanami, Sinatra, Roda — deploys with the same build script and process model.

Assets and migrations, handled

Hatchbox runs bin/hanami assets compile and bin/hanami db migrate on every deploy without being told to — and skips whichever your Hanami version predates.

Postgres, MySQL, or SQLite

Run a database on the same server for free, attach a managed database cluster, or point DATABASE_URL anywhere you like.

Slice-friendly processes

Run separate processes for your web app and background work, each restarted automatically on deploy and on crash.

What customers say

I run 15+ Rails apps and static sites with Hatchbox. My bill went from $400/month on Heroku to $28/mo with Hatchbox & DigitalOcean combined.

Donn Felker

Software Professional

If you want the most bang for your buck, Hatchbox / Hetzner / DigitalOcean is the killer combo. You can throw sooo much at this and it's crazy how inexpensive it is.

Josh Pigford

Serial Entrepreneur

Applications deployed
24,000+
Deployments run
2 million+
Deploying since
2016

Read more customer stories

How to deploy a Hanami app

Four steps from an empty server to a live site. Most people finish in under half an hour.

  1. Connect a server

    Provision a server through your hosting provider's API key, or bring an existing Ubuntu LTS machine.

  2. Connect your repository

    Pick the GitHub repo and branch holding your Hanami app. Auto-deploy on push is one checkbox.

  3. Set your database URL

    HANAMI_ENV=production is set for you when Hanami is detected, so DATABASE_URL is usually the only variable you need to add.

  4. Deploy

    Hatchbox bundles, compiles assets, migrates, and starts Puma. Watch it all in the streaming deploy log.

What Hatchbox does for you

Hatchbox detects Hanami from your Gemfile.lock and picks the right commands for your version. There's no build script to write.

Build steps on Hanami 2.x

bin/hanami db migrate       # skipped on 2.0–2.1, which shipped without database support
bin/hanami assets compile   # skipped on 2.0, which shipped without asset compilation

Build steps on Hanami 1.3

bundle exec hanami db migrate
bundle exec hanami assets precompile

Environment variables

HANAMI_ENV is set automatically. Add the rest in Hatchbox and they're written into every release.

HANAMI_ENV=production   # set for you on detection
DATABASE_URL=postgres://user:pass@host/db_name

Hanami deployment questions

Still stuck? Ask us directly — a real person who has deployed a lot of Hanami apps will answer.

Simple, predictable pricing.

We charge per server, not per app. Run one application or twenty on the same box — the bill doesn't change.

Start free trial

$10

/server/mo
  • Unlimited applications
  • Deploy anywhere
  • Zero downtime deployments
  • Custom domains & free SSL
  • Databases, cron jobs & background workers
  • Full SSH access to your servers
  • Real, human support
  • 7 day free trial

One server, one bill, as many apps as it can hold. Run any of these alongside your Hanami app for no extra cost.

See every framework we deploy

Ready to deploy your Hanami app?

Hatchbox has run more than 2 million deploys across 24,000+ applications since 2016. Start a 7 day free trial and put yours on a server you own.