Deploy a Rails app to Wokku with Postgres, migrations on release, and asset
precompilation handled automatically.
Prerequisites
- A Wokku account and a connected server
- An SSH key registered for
git push - A Rails app with a
Gemfile
1. Create the app
Apps → New App → server, name my-rails-app, box size, Create.
wokku apps:create my-rails-app --server my-server
2. Prepare your Rails app
The Ruby buildpack detects Rails from your Gemfile and precompiles assets
automatically. Add a Procfile:
web: bin/rails server -p $PORT -e $RAILS_ENV
release: bin/rails db:migrate
The release process runs migrations after a successful build, before traffic
shifts — zero-downtime deploys.
3. Set environment variables
App → Config:
| Key | Value |
|---|---|
RAILS_MASTER_KEY |
contents of config/master.key |
RAILS_ENV |
production |
RAILS_SERVE_STATIC_FILES |
true |
RAILS_LOG_TO_STDOUT |
true |
wokku config:set my-rails-app \
RAILS_MASTER_KEY="$(cat config/master.key)" \
RAILS_ENV=production RAILS_SERVE_STATIC_FILES=true RAILS_LOG_TO_STDOUT=true
4. Add a database
wokku addons:create postgres my-rails-app
Wokku injects DATABASE_URL, which Rails reads natively in production. See
Create & Link a Database.
5. Deploy
git remote add wokku git@git.wokku.cloud:my-rails-app
git push wokku main
Connect under Apps → Connect GitHub for push-to-deploy —
see GitHub Auto-Deploy.
git remote add wokku git@git.wokku.cloud:my-rails-app
git push wokku main
Live at https://my-rails-app.wokku.app.
Background jobs
Run Sidekiq/Solid Queue as a second process — add worker: to your Procfile
and scale it. See Bundled Processes.
Custom domain
Custom Domains — SSL is automatic.
Troubleshooting
ActiveSupport::MessageEncryptor::InvalidMessage— wrong/missingRAILS_MASTER_KEY.- Assets 404 — set
RAILS_SERVE_STATIC_FILES=true(or use a CDN). - Migrations didn’t run — confirm the
release:line and check deploy logs.