Deploying a Rails 8 App to Vultr: What the Docs Don't Tell You

Deployment · October 20, 2026 · 5 min read

Kamal makes deployment feel simple. It is, right up until the first time you run it against a real server. We've shipped Rails 8 apps to bare Vultr VPS instances enough times now to have a list of things that bit us, and this is that list. It assumes you already have a Rails 8 app that runs locally and a Vultr account.

Start with the DNS record, not the deploy

Kamal 2 ships with kamal-proxy, which gets a Let's Encrypt certificate for you when you set proxy.ssl: true and a host. That only works if your domain's A record already points at the server when the first deploy runs. If it doesn't, the certificate request fails, the deploy looks half-broken, and you waste an hour. Create the record first, confirm it with dig +short yourdomain.com, then deploy.

Prepare the box

A fresh Ubuntu instance is nearly ready. Add your SSH key when you create it, and Kamal will log in as root and install Docker for you during kamal setup. Two things are still worth doing by hand:
  • Open only what you need. Allow 22, 80 and 443 and nothing else. Vultr's firewall groups work, or use ufw on the host. One caveat: Docker publishes ports by editing iptables directly and bypasses ufw rules, so never publish a database port on a public interface. Use the Vultr firewall as your real boundary.
  • Add swap on small instances. A 1 GB machine can run a Rails container happily and still get killed by the OOM killer during a deploy, when the old and new containers briefly overlap. A 1–2 GB swap file is cheap insurance.

Build for the right architecture

Kamal builds your image on your machine and pushes it to a registry. If you develop on an ARM laptop and deploy to an x86 VPS, set builder.arch: amd64 in config/deploy.yml or you'll get an image that fails to start with an exec format error. Build time is slower when it's emulated, but it works.

Secrets belong in the environment, not the repo

Kamal reads secrets from .kamal/secrets, which is just a file that resolves values from your shell or a password manager. List each name under env.secret in deploy.yml and reference the value in .kamal/secrets. Never put the values in deploy.yml. If a variable is listed but empty at deploy time, the app boots and then fails on the first request that needs it, which is a worse failure than a deploy that stops early. We check every variable with bin/kamal secrets print before deploying.

Postgres: pick where it lives on purpose

You have three reasonable choices: a Kamal accessory (Postgres in a container on the same host), Postgres installed directly on the VPS, or Vultr Managed Databases. For a small site, an accessory is the least friction, but only if you mount a volume for the data directory. Without the volume, the data lives inside the container and disappears on the next accessory reboot. Whichever you choose, set DATABASE_URL as a secret, and set up backups on day one. pg_dump on a cron job, shipped to object storage, is enough to start. A database with no tested restore is not a backup.

Active Storage on Vultr Object Storage

Vultr's object storage speaks the S3 API, so Rails uses the standard S3 service with three things set correctly: the endpoint for your region (for example https://ewr1.vultrobjects.com), force_path_style: true, and a region value that matches. Add the aws-sdk-s3 gem, and require it nowhere, because Active Storage loads it on demand. The bucket must be in the same datacenter as the endpoint you configure. If uploads fail with a signature or redirect error, a region mismatch is the first thing to check.

Run background jobs without a second server

Rails 8 can run Solid Queue inside Puma. Set SOLID_QUEUE_IN_PUMA: true in the env.clear section and you get a job runner without another container. This is fine for a site that sends a few emails and processes the occasional upload. When job volume grows, move it to its own job role in deploy.yml. The config change is small.

Let the health check do its job

Rails 8 includes a /up endpoint, and Kamal uses it to decide whether the new container is healthy before sending traffic to it. Don't point it at anything that talks to external services, or a third-party outage will block your deploys. When a deploy fails, run bin/kamal app logs before anything else. Nine times out of ten the error is a missing environment variable or a failed migration, and it's right there in the log.

Our pre-flight list

  • DNS A record resolves to the server
  • Firewall allows 22, 80 and 443 only
  • builder.arch matches the server
  • Every secret prints a value from bin/kamal secrets print
  • Database volume is mounted and a backup job exists
  • Storage bucket region matches the configured endpoint
  • RAILS_MASTER_KEY is correct and config/master.key is not committed
Do all that and bin/kamal setup is usually uneventful, which is exactly what you want from a deploy. If your project is stuck on this last stretch, that's the kind of work we do. Get in touch.