If you’re upgrading an existing Rails app with Kamal, here are three tips to help you avoid common pitfalls:
/up
Endpoint to config/routes.rb
By default, Kamal uses /up
to check if the server is ready. Ensure this is defined in your routes:
get "up" => "rails/health#show", as: :rails_health_check
/up
Since the /up
check is an HTTP request (not HTTPS), you might encounter 301 redirect errors if config.force_ssl = true
is set. To fix this, allow the /up
endpoint to bypass SSL redirection:
# config/environments/production.rb
config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
If you’ve added a database as an accessory and can’t connect, it may not be booted. Run this command to get it started:
kamal accessory boot db
(Replace db with the name of your database accessory.)
Have you tried Kamal? What’s your experience been like? Hit reply and let me know!