Gemfile and runs your app with no configuration. You push your code, Miget builds it, and your Rails server goes live.
Prerequisites
Before you start, make sure you have:- A Miget account
- Git installed locally
- A Rails app with a
Gemfilecommitted to a Git repository
Bind to the right port
Every app on Miget must listen on0.0.0.0:5000. Miget sets an immutable PORT=5000, and public traffic only reaches port 5000.
Puma respects the PORT environment variable, so rails server binds to 5000 automatically. No changes needed for the default setup.
Learn more about ports and buildpacks.
Set environment variables
Add these variables to your app before deploying. Set them under your app’s settings - see using secrets.| Variable | Value | Purpose |
|---|---|---|
RAILS_ENV | production | Run in production mode |
SECRET_KEY_BASE | your secret | Required by Rails to sign sessions and cookies |
RAILS_SERVE_STATIC_FILES | true | Serve precompiled assets from the app |
Generate a
SECRET_KEY_BASE locally with bundle exec rails secret and paste the value into Miget.Deploy your app
Create the application
Go to app.miget.com, click New then Application. Give your app a name, pick a resource, and click Next.
Choose auto detection
Select Auto detection (Miget Buildpacks) and choose a size, then click Next. Miget will detect Ruby from your
Gemfile, detect Rails, and run the Rails server.Push your code
Add the Miget remote and push:Miget builds your app and starts the Rails server. See git push to builder for the full reference.
This guide uses git push, but it’s one of several ways to deploy. You can also connect a GitHub repository for auto-deploys and pull request previews, deploy from a public Git repository, or push a prebuilt container image. See all deployment methods.
Precompile assets and run migrations
Precompile your assets during the build or as a post-deploy step:Connect a database
Rails readsDATABASE_URL automatically, so connecting a database takes no code changes.
Add a PostgreSQL addon
Add a PostgreSQL addon to your app. Miget provisions the database and auto-injects a
DATABASE_URL (postgres://...) into your app’s environment.You do not need to edit
database.yml beyond honoring DATABASE_URL, which recent Rails versions do out of the box.Next steps
Add a custom domain
Point your own domain at your Rails app.
Manage secrets
Store
SECRET_KEY_BASE and other config securely.PostgreSQL databases
Learn how Miget provisions and injects your database.
Fair Scheduler
Understand how Miget allocates compute across your apps.

