# Deploy a Rails app

Keep your Rails repo focused on the app while we handle the server and bring it online at an HTTPS URL.

## Start with your Rails repo

The Rails setup you already maintain carries into deployment, keeping extra configuration to a minimum. After you [push the repo or connect GitHub](/getting-started), we detect the Ruby version and the existing commands for starting the app and running migrations. The environment variables your code reads also appear for review before the app is built.

Before deploying, you review the setup and enter the private credentials only you know. Tokay creates the database credentials and keeps every secret encrypted in storage until the app receives it at runtime.

## Your Rails app stays together

Your Rails app runs as one system on Tokay, so it is easy to understand and operate. The web app and its background work share the Project's databases and secrets, with each process getting its own Service. The whole Project runs on one dedicated virtual machine, where background workers stay running and scheduled Rails tasks start when they are due.

If the app expects Postgres or Redis, Tokay creates the database and supplies its connection to each Service that needs it.

## Deployments protect your app and data

Rails database changes are seamless on Tokay because they are part of the normal deployment workflow. Tokay rehearses each migration against a copy of your data. If a migration would remove data, you see the impact and decide whether to continue. Before an approved migration runs in production, we take a database snapshot.

You can move on quickly from a failed release because recovery is automatic. Health checks run before the new version receives traffic. If a check fails, Tokay rolls back to the working version.

## Hand the deployment to your AI agent

A coding agent like Claude Code or Codex can handle routine deployment work so you can keep your attention on the app. Through the GraphQL API, the agent can submit the repo and review the same detected setup you see. After you provide the secret values, the agent sets them through the API before deploying the Services and verifying the live app. Destructive database changes require your approval. Point your agent to [app.tokay.io/llms.txt](https://app.tokay.io/llms.txt) to get started.

Tokay has a very generous free tier with no credit card. [Get started](/getting-started).
