Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk6 min

How to Deploy a Ruby on Rails App to a VPS with Kamal

Use Rails’ Kamal deployment flow to build and deploy your app to a VPS, then verify the database, HTTPS, backups, and ongoing operations.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The current Ruby on Rails Guides deployment walkthrough uses Kamal to build and deploy your app as a Docker container on a VPS. You’ll need an Ubuntu LTS server with SSH access, a container registry account and credentials, and—if you want HTTPS on a domain—DNS pointed at the server. The guide’s example specifies at least 1 GB of RAM; treat that as a starting example, not a sizing recommendation for every production app. Rails Guides: Getting Started with Rails

What Kamal does in a Rails deployment

Kamal builds your application image from its production Dockerfile, pushes the image to a container registry, and deploys it to your server. The Rails Guides walkthrough uses Docker Hub, though Kamal’s deploy configuration supports other registry hosts. You configure the service, image, server address, and registry username in config/deploy.yml; credentials belong in secrets, not committed configuration.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For Rails 8, the launch announcement describes a production Dockerfile with Thruster in front of Puma, and Kamal Proxy handling routing. It also describes zero-downtime deploys and automated Let’s Encrypt certificates as part of that architecture. Those details are Rails 8 launch context, not a guarantee that every version or customized app has identical defaults; follow the current guides for your installed versions. Rails 8.0: No PaaS Required · Rails 8.0 release notes

Before you deploy: make the production decisions

Choose and size the VPS

Provision an Ubuntu LTS VPS and arrange SSH access for deployment. The Rails Guides example asks for at least 1 GB RAM. That is a documented example prerequisite, not evidence that a server of that size can handle your app’s workload. Account for the application, database if colocated, background workers, traffic, and memory or CPU needed while deploying a new release.

The guide names Hetzner and DigitalOcean as examples, not as a ranking. Compare providers and plans using current details: region, CPU, memory, storage, networking, snapshots or backup terms, support, and total cost.

Decide where the database and persistent files live

Choose whether the database will run on the same VPS, on a separate server, or with an external managed service. A same-server arrangement may reduce infrastructure complexity, but it couples application and database capacity and recovery to one machine. A separate or managed database introduces network dependency and may change cost and operational responsibilities. Your workload and recovery needs determine the trade-off; the Rails deployment walkthrough does not prescribe a universal topology.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Plan separately for uploaded files and other persistent data. A container image deployment does not by itself establish where your app’s data is stored or how it is restored. Verify that your chosen storage approach survives container replacement and server recovery.

Prepare registry access and production secrets

Create a repository and access token at your chosen container registry. The Rails walkthrough’s Docker Hub example requests read/write access because Kamal needs to push and retrieve the image. Keep the registry password and Rails master key out of source control. Kamal identifies KAMAL_REGISTRY_PASSWORD and, for Rails apps, RAILS_MASTER_KEY among deployment secrets. See the Kamal documentation for current secret handling and configuration.

Deploy with Kamal

  1. Provision the server and confirm access

    Create an Ubuntu LTS VPS, note its public IP address, and ensure your deployment user can connect over SSH. The Rails walkthrough puts the server address in config/deploy.yml. Confirm that the account and SSH configuration you use locally can reach the machine before starting the deployment.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  2. Create the image registry credentials

    Set up a registry repository and token with permissions to push and retrieve the app image. The official example uses Docker Hub; if you use another registry, configure its host and credentials as appropriate. Supply the password through Kamal’s secret mechanism rather than placing it in a committed file.

  3. Configure config/deploy.yml

    Set the service and image names, target server address, and registry username in the deploy configuration. Review the generated production Dockerfile and app-specific configuration as well: the image must include what your app needs to boot, serve assets, connect to its database, and run any required workers.

    Provide KAMAL_REGISTRY_PASSWORD and RAILS_MASTER_KEY securely. Do not paste production secrets into a repository or a public issue. Restrict access to the machines and accounts that need them, and include secret rotation in your maintenance plan.

  4. Point your domain and enable HTTPS, if applicable

    Create DNS records that point your hostname to the VPS. Configure the Kamal proxy host and enable SSL in the deployment configuration. The Rails walkthrough says Kamal obtains a Let’s Encrypt certificate after DNS points to the server. Allow DNS changes to take effect, then verify the hostname and certificate in a browser. If you deploy without a domain, follow the current guide’s configuration for that case rather than assuming the domain-based SSL flow applies.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  5. Run the initial setup

    From your Rails project, run bin/kamal setup for the first deployment. This performs the initial server setup and deploy flow described by the Rails walkthrough. Review command output and resolve SSH, registry, configuration, or boot errors before treating the app as live.

  6. Deploy later releases

    For subsequent releases, run bin/kamal deploy. Keep the deployment configuration and production image in step with changes to your app, and confirm release-specific tasks such as database migrations are appropriate for your application.

  7. Verify the app beyond the landing page

    Open the deployed hostname over HTTPS and exercise the routes and background workflows that matter to your application. Check database connectivity, migrations, uploaded files, outbound mail, and worker processing separately; these depend on your app and topology and are not fully configured by a generic deployment walkthrough. If needed, Kamal documents bin/kamal console for opening a remote Rails console. Treat production console access as privileged and keep it restricted.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Production work continues after the first successful deploy

  • Backups and restore: decide what needs backing up, how often, how long to retain copies, and how to restore them. Test restoration rather than assuming a backup is usable.
  • Security and secrets: apply server and application security updates, restrict SSH and administrative access, and rotate credentials when needed.
  • Monitoring and logs: review application and server logs, watch for errors and resource pressure, and define how you will learn about failures. The official deployment walkthrough does not choose a monitoring product or set a universal alert policy.
  • Recovery and rollback: establish how you will respond to a failed release, server loss, or database problem. Set recovery objectives appropriate to the app and verify that the chosen backup and deployment process can meet them.

Kamal or a manual Puma service?

Kamal is the documented Rails deployment route and packages the app in a Docker image, making the build and release process repeatable once configured. It does require familiarity with containers, a registry, and Kamal’s deployment configuration. A manual host installation can avoid a container workflow, but leaves more host setup and release details for you to manage.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puma’s upstream documentation describes systemd as a common Linux init system that can monitor Puma and restart it, and includes a sample service unit. That is process supervision, not a complete Rails deployment recipe. A manual setup still needs a versioned Ruby and app installation, environment and secret management, reverse proxy and TLS, database setup, asset build, migration and release strategy, logs, backups, and rollback planning. Puma systemd documentation

Or let it run in the cloud

For a different task—not deploying a Rails app—StreamNeo keeps an uploaded video or playlist live on a YouTube channel. Upload the recording, add your YouTube stream key, and go live. It loops the uploaded video from the cloud; it does not deploy Rails or stream from a camera. Nothing needs to stay on at home, and it streams the file as uploaded up to 4K 60fps at one price per slot. It can automatically recover if YouTube drops the stream. The first day is free with no card, with no quality tiers. Monthly: $9.99 per month. Start the free day on StreamNeo.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.