# Ruby and Rails Deploy a Rails app, or any Ruby web server, from source. Smolcloud installs the gems in your `Gemfile.lock`. ## Start from the Rails template ```sh smolcloud init rails ./my-app ``` This creates a small working app with a Dockerfile. You can use your own project instead. Either way, [create an app](builder-guide.md) first to get its ID. The Rails starter runs Puma on the port in `PORT` and has a health route at `/api/health`. Rails signs cookies with a secret key, and that key must stay the same across deployments or everyone is signed out. The starter generates one and keeps it on a 64 MiB disk, which it requests in `innie-resources.json`. The first deployment therefore waits for the workspace owner to approve the disk. Smolcloud doesn't run `rails db:migrate` for you; run migrations as your own step. ## Deploy source Include `Gemfile` and `Gemfile.lock`. Public gems are downloaded from RubyGems. For a plain Ruby server such as Sinatra, put the start command in a `Procfile` at the source root. Create the app to get its ID, then deploy the source folder: ```sh smolcloud deploy APP_ID ./my-app ``` If the folder has a Dockerfile, Smolcloud uses it. The starter includes one; delete it if you'd rather Smolcloud work out the build itself. [Automatic builds](source-preparation.md) lists what a build can download and where to see the commands it chose. Set the port and health path in the app's **Configuration**. `deploy` waits until the app is live and prints its address. Open it and try a real page, not only the health path. If you need a private package registry, build an image in your own CI and [deploy that](image-publishing.md). ## Limits - The app runs as user `10001:10001`, not root, and can't write to its own filesystem. - Builds can't reach private package registries or other download sites. - Keep data in [PostgreSQL, a bucket or a disk](data-services.md); anything else is lost on the next deploy.