// framework · camping

Camping: the 4kB micro-framework.

_why's tiny single-file framework is still alive — and still perfect for one-off tools and micro-services that fit in your head.

Camping is a whole web framework in ~4 kilobytes of Ruby. The whole app fits in one file. Deploying it is delightfully boring: it's a Rack app, so Puma + a slim container image is all you need.
~4 kB
framework size
96 MB
min container size
180 ms
cold boot
01 / 03

One file, one container

The whole app — models, controllers, views — is one .rb file. Copy it in, expose Puma, ship. This is the entire Dockerfile.
Dockerfile
FROM ruby:3.3-slim WORKDIR /app RUN gem install camping puma COPY app.rb ./ EXPOSE 9292 CMD ["puma", "-p", "9292", "-e", "production", "app.rb"]
02 / 03

Persistence: SQLite for tiny, Postgres for real

Camping ships with an ActiveRecord-lite via Camping::Models. For a tool nobody else uses, SQLite on a mounted volume is fine. For anything shared, point at a managed Postgres and you're done.
03 / 03

When Camping is the right tool

Internal admin pages, single-purpose webhooks, personal dashboards. If the whole spec fits on an index card, Camping saves you a week vs. reaching for Rails.

Gotchas we learned the hard way

  • !Camping is a maintenance-mode project. Pin the version and don't expect frequent releases — but it's stable and small enough to audit yourself.
  • !The bundled Mab template language is unfamiliar to most Rubyists. Erubi via Tilt works too if you'd rather write ERB.
  • !Don't try to add Sprockets/Propshaft or a JS bundler. If you need those, you've outgrown Camping — reach for Sinatra or Roda.

Official resources

Docs, repos, and training materials for this framework.

Related guides

Ready?
Deploy your 4kB app

Fly.io, Heroku and Cloud Run all take the container as-is. Pick the one you already have an account for and move on.