---
title: "Rails hosting on Edge | Puma, Kamal and Active Storage"
description: "Run Ruby on Rails on Edge: Puma on real VMs, Kamal deploys, Active Storage on S3-compatible storage and a global CDN for assets, with zero egress fees."
url: https://edge.network/solutions/rails
---

For Rails

# Rails on real VMs, no platform tax

Puma on a VM you control, Active Storage on an S3-compatible bucket, and assets cached in 988 locations. Keep Kamal or Capistrano. We supply the machines and the network.

[Deploy a VM](/console/access/new?product=compute)[Have us migrate it](/solutions/expert-services)

The setup on this page costs $40.17 a month, with no egress line.

Why Rails on Edge

## Linux and a VM were right all along

Rails runs best on a plain server you understand. We add the global CDN and S3 storage that make it sing.

-   ### Puma or Falcon on real VMs
    
    Run any Rack server (Puma, Falcon, Iodine) on a VM sized to fit. Boring, predictable and quick.
    
-   ### Active Storage on S3
    
    Configure the S3 service with the Edge endpoint. Direct uploads, variants and public URLs work unchanged.
    
-   ### Postgres or MySQL alongside
    
    Run the database as a Kamal accessory, on a separate VM over a free private network, or with your managed provider.
    
-   ### Variants without the worker
    
    Serve blobs through the CDN and ask for ?width=640&format=auto. No libvips on the request path, no variant records to track.
    
-   ### Propshaft assets and blobs from the edge
    
    Propshaft assets and public blobs cache in 988 locations. Everything users download is free on the way out.
    
-   ### Kamal or Capistrano
    
    Keep the deploy workflow you like: Kamal, Capistrano or plain SSH. The Edge CLI provisions the VMs underneath.
    

Reference architecture

## Puma behind kamal-proxy, blobs in a bucket

Puma behind kamal-proxy, Postgres and jobs alongside, Active Storage in a bucket and the CDN in front.

-   [Compute](/compute)
    
    Runs Puma (or Falcon) in Docker behind kamal-proxy, plus jobs and Postgres.
    
-   [Storage](/storage)
    
    Holds Active Storage uploads through the S3 service.
    
-   [CDN](/cdn)
    
    Caches the asset pipeline output and public blob URLs.
    
-   [Image optimisation](/docs/cdn/image-optimization)
    
    Generates image variants on request, with no processing in Rails.
    
-   [DNS](/dns)
    
    Anycast DNS for the apex, www and email records.
    
-   [Shield](/shield)
    
    Guards Devise logins and signups against credential stuffing.
    
-   [Assist](/assist)
    
    One line in application.html.erb adds grounded answers to every page.
    

Deploy

## From rails new to live in four steps

Rails 8 ships with a Dockerfile and Kamal config. Give Kamal an Edge VM and it does the rest.

1.  01
    
    ### Create a VM
    
    The hardened-ssh script turns off password logins and enables fail2ban and UFW. Kamal installs Docker itself on the first run.
    
    shell
    
    ```
    $ edge compute create --name rails --size s-4vcpu-8gb \
        --image ubuntu-24 --region london --script hardened-ssh
    ```
    
2.  02
    
    ### Put Active Storage on Edge Storage
    
    Then set config.active\_storage.service = :edge in production.rb.
    
    config/storage.yml
    
    ```
    edge:
      service: S3
      endpoint: https://storage.edge.network
      access_key_id: <%= ENV["EDGE_ACCESS_KEY"] %>
      secret_access_key: <%= ENV["EDGE_SECRET_KEY"] %>
      region: us-east-1
      bucket: acme-blobs
      force_path_style: true
    ```
    
3.  03
    
    ### Point Kamal at the VM
    
    Postgres runs as an accessory on the same VM. Move it to its own VM later by changing one host.
    
    config/deploy.yml
    
    ```
    service: acme
    image: acme/app
    servers:
      web:
        - <vm-ip>
    proxy:
      host: app.acme.co
    registry:
      server: ghcr.io
      username: acme
      password:
        - KAMAL_REGISTRY_PASSWORD
    builder:
      arch: amd64
    env:
      secret:
        - RAILS_MASTER_KEY
        - EDGE_ACCESS_KEY
        - EDGE_SECRET_KEY
    accessories:
      db:
        image: postgres:16
        host: <vm-ip>
        port: "127.0.0.1:5432:5432"
        env:
          secret:
            - POSTGRES_PASSWORD
        directories:
          - data:/var/lib/postgresql/data
    ```
    
4.  04
    
    ### Deploy and front it with the CDN
    
    kamal setup prepares the server and boots accessories once. After that, every release is kamal deploy.
    
    shell
    
    ```
    $ kamal setup
    $ kamal deploy
    
    $ edge cdn create --name acme
    $ edge cdn domains add cdn-0f4b7a \
        --domain app.acme.co \
        --origin https://<vm-ip> \
        --jit-image
    ```
    

Prefer to hand it off? [Give the job to your AI agent](/solutions/agentic-development) or [have our engineers do it](/solutions/expert-services).

What it costs

## A monolith-sized bill

One Performance VM runs Puma, jobs and Postgres with room to breathe. Blobs live in a bucket and the CDN carries the bytes.

-   No dynos, add-ons or per-seat charges
-   Zero egress on blobs and assets
-   Image variants included with the CDN

[See compute pricing](/compute/pricing)

Estimated monthly bill on Edge

Rails monolith, 5.5M requests a month, 35 GB of blobs

USD

-   Compute$38.47Performance VM, 4 vCPU, 8 GiB, 160 GB NVMe
-   CDN$1.255.5M requests: first 500k free, 5M × $0.25 per million
-   Storage$0.4535 GB of blobs: first 5 GB free, 30 GB × $0.015
-   DNS$0.00Zone, apex, www and email records
-   Egress$0.00

Total$40.17

FAQ

## Kamal, Active Storage and background jobs

Something else? [Ask an engineer](/contact).

Does Kamal work on Edge?

Yes. Kamal deploys to any server it can reach over SSH. Create the VM with the Edge CLI, put its IP in config/deploy.yml and run kamal setup. Docker and kamal-proxy are installed for you.

Can I keep Capistrano?

Yes. Create the VM, install Ruby and Puma as you would on any Ubuntu server, and point deploy/production.rb at its IP. Nothing about Capistrano changes.

How does Active Storage connect?

Through the standard S3 service with endpoint https://storage.edge.network and force\_path\_style: true. Direct uploads, variants and public URLs work as documented.

Where do background jobs run?

Solid Queue can run inside Puma on the same VM. For Sidekiq or GoodJob, add a job role or a Redis accessory in Kamal, or move workers to their own VM when volume grows.

Can I run in more than one region?

Yes. Edge Compute runs in London and Miami. Put a VM in each and use geographic routing in Edge DNS to send visitors to the nearest one. The CDN serves assets from every location either way.

Drop-in services

## A before\_action and one layout line

-   [
    
    Edge ShieldBot protection`POST /siteverify → score: 94`
    
    A before\_action guards Devise logins and signups against credential stuffing. Free, with no puzzle.
    
    Free forever, with unlimited widgets. No puzzles for visitors.Explore
    
    ](/shield)
-   [
    
    Edge AssistAI answers`<script src="…/assist.js">`
    
    One line in application.html.erb puts grounded answers on every page.
    
    Free tier: 250 answered questions a monthExplore
    
    ](/assist)

Related stacks

## Sibling frameworks, Docker and Postgres

[All 38 stacks](/solutions/stacks)

-   [LaravelProduction VMs, S3 storage and CDN](/solutions/laravel)
-   [DjangoPython web apps, no surprise bills](/solutions/django)
-   [DockerRun any container on global VMs](/solutions/docker)
-   [PostgreSQLSelf-hosted Postgres on dedicated NVMe](/solutions/postgresql)

## Deploy Rails with Kamal, onto Edge

Bring your rails new or your ten-year-old monolith. Both deploy the same way.

[Deploy a VM](/console/access/new?product=compute)[Talk to an engineer](/contact)

Billed hourly from a prepaid balance. Egress is free on every product.
