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 DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
VGSources
Blog

How to Install and Run Ruby on Rails on an Ubuntu VPS

Deploy Rails on an Ubuntu LTS VPS with a pinned Ruby, PostgreSQL, Puma, Nginx, and TLS—or use Kamal and Docker. Follow the commands, security checks, verification steps, and troubleshooting guidance for a reliable production setup.
Length13 min Posted Quest giverVGSources Team

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.

The dependable production pattern is Ubuntu LTS → pinned Ruby → Bundler-managed Rails → PostgreSQL → Puma → Nginx with TLS. You can assemble that stack yourself with systemd, or let Rails’ documented Kamal workflow package the application in Docker containers. This guide covers both paths, including security, credentials, database setup, assets, deployment, verification, and recovery.

It assumes a fresh Ubuntu LTS VPS, SSH access, a domain name (or a temporary test IP), and a Rails application stored in version control. Exact Ruby and Rails releases must come from the application’s .ruby-version, Gemfile, and lockfile rather than from a hard-coded tutorial version.

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.

Choose the deployment shape before installing anything

There are two sound ways to run Rails on one Ubuntu VPS:

Approach How it works Best fit Main trade-off
Manual Puma, systemd, and Nginx Ruby and gems run directly on Ubuntu. systemd keeps Puma alive; Nginx terminates TLS and proxies requests. Teams that want transparent host-level control, simple debugging, or several small services on one machine. You own runtime upgrades, dependency isolation, release directories, and rollback procedures.
Kamal with Docker Kamal builds the application image, pushes it to a registry, and manages containers on the VPS. Rails’ current Getting Started guide documents this workflow. Teams that prefer repeatable image-based releases and straightforward rollback between image versions. Docker, a registry, image lifecycle, and container networking add another operational layer.
One-click Rails image A provider image supplies a preconfigured Ubuntu/Ruby/Rails/database/web-server baseline. Someone who values a quick starting point over a bespoke build. Catalog versions and defaults can change; you still must secure, configure, back up, and update the server.

In either design, the public request path should look like this:

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Internet :443/:80 → Nginx (TLS and static files) → Puma/Rails → PostgreSQL

Do not expose Puma’s internal port or socket directly to the internet. Keep it reachable only by Nginx on the same host (or by the private network you deliberately configure).

Prepare and secure the Ubuntu VPS

1. Start with an Ubuntu LTS release

Canonical’s server documentation targets the latest Ubuntu LTS. Select an LTS image offered by your VPS provider, record its region and address, and create a DNS record for the application domain. The exact package names and service defaults can differ between LTS releases, so verify commands against the release you selected.

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

2. Update the operating system first

Connect as the provider-supplied administrator, then update package metadata and installed packages before adding application software:

sudo apt update
sudo apt upgrade

Reboot when the package manager requests it, reconnect over SSH, and confirm the host is running the expected release with lsb_release -a or the provider’s console.

3. Create a non-root deployment account

Use a dedicated account for deployments and service files. Keep administrative work behind sudo; do not run Bundler, Rails tasks, or Puma as root.

sudo adduser rails
sudo usermod -aG sudo rails
sudo install -d -m 700 -o rails -g rails /home/rails/.ssh

Add the deployer’s public key to /home/rails/.ssh/authorized_keys, set ownership to rails:rails, and test a second SSH session before closing the original administrator session. After key login works, disable password authentication and root SSH login through the SSH server configuration, then reload the service.

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

4. Allow only required network ports

Ubuntu treats firewalls, authentication, encrypted communications, and updates as ongoing administration tasks. A minimal host firewall normally permits SSH and web traffic:

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status verbose

Do not open PostgreSQL’s port to the public internet unless you have a specific private-network design and additional access controls. If your provider has a separate network firewall, apply the same narrow policy there.

Match Ruby to the application

Ruby’s official installation guidance shows that Ubuntu’s package manager can install Ruby with:

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
sudo apt-get install ruby-full

It also warns that major package managers may provide an older Ruby than the latest release. The decision is therefore driven by the application’s declared runtime, not by whichever version happens to be in the Ubuntu repository.

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

Read the project’s runtime declaration

  • Check .ruby-version if present.
  • Inspect the ruby requirement in the Gemfile.
  • Read the lockfile’s RUBY VERSION section when it exists.
  • Check CI and deployment files for the same version and architecture assumptions.

If the project accepts the Ubuntu-provided Ruby, install ruby-full and the development packages required by its gems. If the project pins a version unavailable in the repository, use a maintained version manager such as rbenv with ruby-build (or your team’s approved equivalent). Install exactly the declared version, set it as the deploy user’s local or global version, and verify:

ruby --version
 gem --version

Do not mix a system Ruby, a version-manager Ruby, and a container Ruby within the same release process. The shell used by systemd must resolve the same Ruby and Bundler that you tested interactively.

Install build tools, clone the application, and resolve gems

Install only the dependencies your app needs

Every Rails application has a different native dependency set. A common baseline includes Git, a compiler toolchain, OpenSSL and compression headers, YAML/readline headers, and PostgreSQL client headers:

sudo apt install -y build-essential git libssl-dev zlib1g-dev libreadline-dev libyaml-dev libpq-dev

Treat that as a starting point, not a universal package list. Applications that process images, compile JavaScript, use Redis, or run background workers may require additional packages and services. Check the gems’ installation notes and the selected Ubuntu LTS repository before accepting a package name.

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

Clone into a release location

As the deploy user, clone the repository into a stable application directory. Keep configuration and shared data outside individual release directories if you plan to support rollback:

sudo install -d -o rails -g rails /srv/myapp
sudo -iu rails git clone YOUR_REPOSITORY_URL /srv/myapp/current
cd /srv/myapp/current

For an existing application, use its repository and configuration rather than generating a new Rails project. Only create a new app when starting from scratch; the Rails Getting Started guide covers initial app creation and database setup.

Install Bundler and the locked dependency set

Use the Bundler version recorded by the lockfile when one is specified. Then install gems in a deployment-friendly path:

bundle install --deployment --without development test

Modern Bundler versions may prefer configuration over the older flags. Follow the project’s lockfile and CI command exactly, for example by setting a local path and excluding groups in bundle config. The important invariant is that production uses the lockfile, not a fresh, unconstrained dependency resolution.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Confirm the Rails executable comes from the bundle:

bundle exec rails --version
bundle exec ruby --version

Install and configure PostgreSQL

Install the database service or use a managed endpoint

You can run PostgreSQL on the VPS or point Rails at a managed PostgreSQL service. If it runs locally, install the server and client packages from the Ubuntu LTS repositories, enable the service, and keep its listener private unless a private network requires otherwise.

Create a least-privilege role and database

Use a dedicated role for the application rather than the PostgreSQL superuser. The exact SQL and naming are yours, but the pattern is:

sudo -u postgres psql
CREATE ROLE myapp LOGIN PASSWORD 'use-a-long-random-secret';
CREATE DATABASE myapp_production OWNER myapp;
q

Store the password in protected environment management, not in Git, shell history, screenshots, or a world-readable file. If your provider supplies a connection URL, use that value instead of duplicating host, port, database, and credential settings.

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

Prepare the production schema

After the production environment variables are available, run the project’s documented database task. Rails commonly supports:

RAILS_ENV=production bundle exec rails db:prepare

db:prepare can create the database and run migrations where supported, but inspect the application’s Rails version and deployment scripts first. Some teams deliberately separate database creation, migrations, and seed operations. Never run development seeds blindly against production.

Set secrets, credentials, and environment configuration

Production Rails needs a secret key base and any application-specific credentials. Provide SECRET_KEY_BASE and the Rails master key through a secret store, an environment file readable only by the service account, or your container platform’s secret mechanism. Protect file permissions:

sudo install -m 600 -o rails -g rails /dev/null /etc/myapp.env

Populate that file with database settings, host names, mail credentials, storage keys, and other values required by the application. Never commit credentials, registry tokens, or the master key to the repository. Kamal’s documented example likewise passes registry credentials through environment variables and uses a production Dockerfile rather than embedding secrets in the image.

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

Compile assets and prepare the release

Set the production environment and run the asset task supported by your Rails version and JavaScript pipeline. Depending on the application, that may be bundle exec rails assets:precompile or a project-specific wrapper. Run it from the release directory with all required node, package-manager, and environment dependencies installed.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
RAILS_ENV=production bundle exec rails assets:precompile

If the app uses a separate JavaScript build, execute the command documented in its package scripts before or during asset precompilation. Verify that compiled files appear under the configured public asset path and that the release can boot without contacting development services.

Run Rails with Puma and systemd

Configure Puma for the host

Puma’s worker count, thread count, bind address, and timeout must match the application and VPS resources. There is no universal safe number. Start conservatively, measure memory and latency, and increase concurrency only when the workload and database can support it.

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

Bind Puma to localhost or a Unix socket. A socket avoids exposing an internal TCP port publicly:

# config/puma.rb (illustrative)
environment ENV.fetch("RAILS_ENV", "production")
bind "unix:///run/myapp/puma.sock"
workers ENV.fetch("WEB_CONCURRENCY", "1")
threads_count = ENV.fetch("RAILS_MAX_THREADS", "5")
threads threads_count, threads_count
preload_app!

Use the project’s existing config/puma.rb when it has one; do not overwrite tuned settings without understanding their purpose.

Create a dedicated runtime directory

sudo install -d -m 755 -o rails -g rails /run/myapp

Because /run is ephemeral, create that directory with a systemd RuntimeDirectory setting or a small boot-time unit so it exists after every reboot.

Add a systemd service

Create /etc/systemd/system/myapp.service with a dedicated user, working directory, environment file, restart policy, and journal logging:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
[Unit]
Description=My Rails application
After=network.target postgresql.service

[Service]
Type=simple
User=rails
Group=rails
WorkingDirectory=/srv/myapp/current
EnvironmentFile=/etc/myapp.env
Environment=RAILS_ENV=production
ExecStart=/home/rails/.rbenv/shims/bundle exec puma -C config/puma.rb
Restart=always
RestartSec=5
UMask=027

[Install]
WantedBy=multi-user.target

Adjust ExecStart to the Ruby installation actually used by the deploy account. If Ruby came from apt, use the corresponding system path. Then load, enable, and inspect the service:

sudo systemctl daemon-reload
sudo systemctl enable --now myapp
sudo systemctl status myapp
sudo journalctl -u myapp -n 100 --no-pager

When deploying a new release, stop accepting traffic only when your migration strategy requires it. Otherwise update the release, run the project’s migration and asset steps, switch the current symlink atomically, and restart or reload Puma according to the application’s compatibility plan.

Put Nginx in front and enable TLS

Proxy dynamic requests and serve public files

Install Nginx from the Ubuntu repository, create a server block for the domain, and point its root at the Rails public directory. A representative configuration is:

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
server {
    listen 80;
    server_name example.com www.example.com;
    root /srv/myapp/current/public;

    location /assets/ {
        try_files $uri =404;
    }

    location / {
        proxy_pass http://unix:/run/myapp/puma.sock;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

The Rails reverse-proxy guidance uses the same essential pattern: Nginx or Apache accepts public traffic and forwards the host and client IP information to the application server. Test the configuration before reloading:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo nginx -t
sudo systemctl reload nginx

Obtain and renew a certificate

Point the domain’s DNS A/AAAA record at the VPS, make sure ports 80 and 443 are reachable, and use the ACME provider or certificate tooling selected by your operator. Configure HTTP-to-HTTPS redirection only after the certificate is active, then verify renewal in a staging or dry-run mode offered by that tooling. Keep the private key readable only by the certificate service and Nginx.

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

Alternative deployment: Kamal and Docker

Rails’ current Getting Started guide states that Rails includes Kamal, a deployment tool that can deploy an application directly to a server. Its documented path uses Docker containers, a production-ready Dockerfile, an Ubuntu LTS host with 1 GB of RAM or more, a container registry account, and a domain when enabling SSL.

Prepare the prerequisites

  • An Ubuntu LTS VPS with SSH access and at least 1 GB RAM for the documented minimum.
  • A Docker-capable host and a registry account that can accept your application image.
  • DNS pointing the application domain to the server.
  • Registry credentials and Rails secrets supplied through protected environment variables.

Run the documented workflow after adapting it

From the Rails project, inspect config/deploy.yml, the production Dockerfile, image name, server address, registry settings, and proxy/SSL section. Replace every example value with your own host and credentials, then run:

bin/kamal setup
bin/kamal deploy

bin/kamal setup provisions the server-side pieces and starts the initial release; subsequent bin/kamal deploy commands build and roll out new images. Confirm the database service, persistent storage, health checks, and migration hooks in your project before relying on unattended deploys. Container replacement does not automatically protect uploads or database data: those need persistent volumes or external services and a tested backup plan.

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

One-click Ubuntu Rails images: what you gain and what you still own

A provider image can remove much of the initial assembly. DigitalOcean’s documented Rails image, for example, lists Ubuntu 24.04, Ruby 3.4.7, Rails 8.1.1, PostgreSQL 15, Nginx, Docker, SSL/TLS setup, and systemd integration. Those are catalog details that may change as the image is revised, so check the provider’s current listing before provisioning.

Regardless of the image, immediately rotate any temporary credentials, create a non-root deploy account, review firewall rules, confirm the installed Ruby matches your application, and establish backups and update procedures. A preconfigured server is a starting point, not a substitute for application-specific secrets, migrations, storage, monitoring, or rollback design.

Verify the deployment before declaring it live

Test from the server

  1. Check that Puma is active: sudo systemctl is-active myapp.
  2. Read recent application errors: sudo journalctl -u myapp -n 100 --no-pager.
  3. Request the local Nginx endpoint with the correct Host header if your server block requires it.
  4. Run a Rails health endpoint or a minimal route that exercises the database.

Test from outside

  1. Resolve the domain and confirm it points to the VPS.
  2. Request https://example.com and inspect the certificate name and expiry.
  3. Exercise login, database writes, file uploads, mail delivery, and any background-job-triggering action.
  4. Confirm static assets load through Nginx and dynamic requests reach Puma.

Test a reboot and a failed release

Reboot during a maintenance window, then verify that PostgreSQL, the runtime directory, Puma, and Nginx return automatically. Practice restoring the previous application release, reversing a symlink or image tag, and applying a database rollback only when the migration is explicitly reversible. Keep a documented emergency procedure rather than improvising during an outage.

Operations checklist for an Ubuntu Rails VPS

  • Updates: apply Ubuntu security updates and restart when required; update Ruby, gems, Node tooling, and Docker images on a planned cadence.
  • Secrets: rotate database passwords, registry tokens, API keys, and certificates; audit file permissions on environment files.
  • Backups: schedule PostgreSQL backups, retain copies away from the VPS, and perform test restores.
  • Logs: monitor journald, Nginx access/error logs, job-worker logs, and disk usage; configure retention so logs cannot fill the volume.
  • Jobs and mail: verify the process that runs background jobs, retry behavior, outbound SMTP credentials, and failure alerts.
  • Storage: back up uploaded files or use durable object storage; container or release replacement must not delete user data.
  • TLS: verify automatic certificate renewal and alert before expiry.
  • Capacity: watch memory, CPU, disk, database connections, and Puma queue time before changing worker or thread counts.
  • Rollback: preserve the previous release or image, record migration compatibility, and know exactly how to return traffic to it.

Troubleshoot by symptom

Nginx returns 502 Bad Gateway

  • Check systemctl status myapp and the Puma journal.
  • Confirm the Unix socket exists and is owned so Nginx can read/write it.
  • Make sure Nginx’s proxy_pass socket path exactly matches Puma’s bind path.
  • Verify the service’s Ruby and Bundler paths; a systemd environment does not inherit your interactive shell.

The app boots but database requests fail

  • Confirm the production environment variables are loaded by systemd or the container.
  • Test DNS, socket/port reachability, role permissions, and the database name.
  • Inspect migration status and run the project’s supported production preparation task.

Assets are missing or stale

  • Run the application’s production asset build with the same environment used by Puma.
  • Check Nginx’s root and the Rails public asset path.
  • Ensure the release switch includes compiled assets and that a CDN or browser is not serving an old manifest.

Deployments fail while compiling a gem

  • Read the gem’s native-library requirement and install the matching Ubuntu development package.
  • Confirm the Ruby version matches .ruby-version and the lockfile.
  • Run bundle install as the deploy user, not root, and preserve the lockfile.

Which approach should you use?

Decision factor Manual Puma/systemd/Nginx Kamal/Docker One-click image
Runtime isolation Shared host runtime; isolation comes from users, directories, and service boundaries. Image captures Ruby and system dependencies per release. Preselected host baseline; you still manage application isolation.
Upgrade and rollback Requires release directories, symlink switching, and careful gem/runtime changes. Image tags make application rollbacks explicit, but data migrations still need planning. Fast initial setup; image upgrades depend on provider release practices.
Operational complexity Fewer moving parts, more host-level responsibility. More tooling and registry concepts, more repeatable deployments. Least initial assembly, greatest dependence on documented image defaults.
Multi-app hosting Efficient when you can isolate users, ports/sockets, databases, and Nginx server blocks. Convenient when each app has its own image and resources, subject to VPS capacity. Usually optimized for one prepared stack; verify how additional apps are supported.
TLS handling You configure Nginx and an ACME or certificate provider. Kamal’s proxy section can manage SSL when adapted with your domain and DNS. Often prewired, but renewal and key ownership remain your responsibility.
Observability journald, Nginx logs, and host metrics are direct and familiar. Collect container, proxy, and host logs together and monitor image health. Start with provider defaults, then add application-specific alerts.

Choose manual deployment when you want to understand and control every host process. Choose Kamal when image-based, repeatable releases are more valuable than minimizing components. Choose a one-click image when reducing initial setup matters, provided you are willing to audit and maintain the resulting stack.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

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 quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

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.