Ruby on Rails implementation checklist
This checklist outlines the technical requirements for deploying a Rails 8 application to production, specifically focusing on Kamal deployment, Hotwire patterns, and the Solid suite for background processing.
Environment & Configuration
0/5Master Key Management
criticalVerify RAILS_MASTER_KEY is present in the production environment and not committed to version control.
Force SSL
criticalSet config.force_ssl = true in production.rb to ensure all traffic is encrypted and HSTS is enabled.
Canonical Host Redirection
recommendedConfigure middleware or load balancer to redirect non-www to www (or vice versa) to prevent session fragmentation.
Logger Configuration
recommendedSet config.log_level to :info and use ActiveSupport::TaggedLogging to include request IDs in logs.
Secret Key Base
criticalEnsure SECRET_KEY_BASE is generated uniquely for production to secure cookie-based sessions.
Database & Background Jobs
0/5Connection Pool Sizing
criticalMatch the database pool size in database.yml to the sum of RAILS_MAX_THREADS and the concurrency level of background workers.
Solid Queue Configuration
criticalVerify that config.active_job.queue_adapter is set to :solid_queue and the database has the required schema migrations.
Database Backups
criticalConfirm automated daily snapshots and WAL-G or similar point-in-time recovery is active for the production database.
Prepared Statements
recommendedDisable prepared statements in database.yml if using a connection pooler like PgBouncer in transaction mode.
Solid Cache Setup
recommendedVerify config.cache_store is set to :solid_cache_store and the dedicated cache table is indexed.
Deployment with Kamal
0/5Health Check Endpoint
criticalEnsure the /up endpoint returns a 200 OK and is correctly referenced in the deploy.yml healthcheck section.
Registry Authentication
criticalVerify KAMAL_REGISTRY_PASSWORD is set in the local .env file and the deployer has push access to the Docker registry.
Asset Precompilation
criticalConfirm the Dockerfile includes 'RUN bundle exec rails assets:precompile' and all build arguments for CSS/JS are passed.
Multi-arch Builds
recommendedConfigure buildx in deploy.yml if the deployment target architecture (e.g., ARM64) differs from the CI/CD runner.
Remote Environment Variables
recommendedUse the 'env: clear' and 'env: secret' blocks in deploy.yml to separate public config from sensitive credentials.
Security & Rate Limiting
0/5Rack Attack Implementation
criticalConfigure the rack-attack gem to throttle login attempts by IP and prevent brute-force attacks on /users/sign_in.
Content Security Policy (CSP)
recommendedDefine a strict CSP in initializers/content_security_policy.rb to prevent XSS, specifically allowing Stimulus and Turbo origins.
Dependency Audit
criticalRun 'bundle audit' and 'npm audit' to identify and patch known vulnerabilities in gems and node modules.
Permission Policy
optionalConfigure the Permissions-Policy header to disable unused browser features like camera, microphone, and geolocation.
Secure Cookies
criticalEnsure config.ssl_options = { hsts: true, subdomains: true } is active to prevent session hijacking.
Monitoring & Resilience
0/5Error Tracking Integration
criticalInstall and verify an error reporting client (Sentry, Honeybadger, or AppSignal) for the production environment.
Log Aggregation
recommendedVerify that Docker logs are being forwarded to a centralized logging service for post-deployment analysis.
Uptime Monitoring
criticalConfigure an external service to ping the /up endpoint every 60 seconds and alert on failure.
Memory Usage Profiling
recommendedSet up jemalloc in the Dockerfile to reduce memory fragmentation and prevent OOM kills on small VPS instances.
Disk Space Alerts
recommendedEnsure monitoring is in place for the host machine's disk space, specifically for Docker image pruning and database growth.