{"catalogRevision":"cat_726f873af6f566cc","recipeId":"page:migrate:aws-ec2-app:rails","recipeRevision":"r1","canonicalPath":"/migrate/aws-ec2-app/rails","label":"Migrate AWS EC2 app: Rails","title":"How to move a Rails app from AWS EC2 to Ample","family":"Migration guide","summary":"Move Rails compute from AWS EC2 app to Ample, one component at a time. Destination verified on Ample: the app built, started and answered on its public HTTPS URL with encrypted configuration delivered. Source procedure: Collect the process environment from the instance (systemd unit or process manager config) into an env file kept out of the repository. Move separately: cron jobs become `ample job` schedules, files on the instance disk move to a bucket or an Ample volume, and IAM instance roles become encrypted env credentials; Ample handles networking. Cutover: Add the custom domain with `ample domain add`, update DNS from the instance or load balancer, keep the instance until verified, then stop it. Rollback: keep the source untouched until you confirm; nothing at the source is changed or deleted by this guide.","representativeQueries":["Migrate AWS EC2 app: Rails","Where can I host Rails built with Rails?","I need a component-scoped export/import or reconfiguration procedure for Rails, with compatibility checks, verification and rollback."],"breadcrumbIds":["discovery","migration","migration:compute-sources","migration:aws-ec2-app","page:migrate:aws-ec2-app:rails"],"breadcrumbs":[{"id":"discovery","label":"Agent hosting discovery","canonicalPath":"/discover/discovery","kind":"root"},{"id":"migration","label":"Migration sources by component","canonicalPath":"/discover/migration","kind":"facet"},{"id":"migration:compute-sources","label":"Compute sources","canonicalPath":"/discover/migration/compute-sources","kind":"group"},{"id":"migration:aws-ec2-app","label":"AWS EC2 app","canonicalPath":"/discover/migration/aws-ec2-app","kind":"atom"},{"id":"page:migrate:aws-ec2-app:rails","label":"Migrate AWS EC2 app: Rails","canonicalPath":"/migrate/aws-ec2-app/rails","kind":"recipe"}],"parentIds":["migration:aws-ec2-app","stack:framework-rails","intent:migrate-compute"],"parents":[{"id":"migration:aws-ec2-app","label":"AWS EC2 app","canonicalPath":"/discover/migration/aws-ec2-app","kind":"atom"},{"id":"stack:framework-rails","label":"Rails","canonicalPath":"/discover/stack/framework-rails","kind":"atom"},{"id":"intent:migrate-compute","label":"Migrate compute","canonicalPath":"/discover/intent/migrate-compute","kind":"atom"}],"resourceRequirements":["primitive:compute","primitive:postgres"],"infrastructureRequirements":[{"primitiveId":"primitive:compute","label":"Compute","canonicalPath":"/discover/primitive/compute","status":"verified","summary":"Apps run in isolated x86_64 Firecracker microVMs; sizes are the priced VM sizes."},{"primitiveId":"primitive:postgres","label":"Postgres","canonicalPath":"/discover/primitive/postgres","status":"verified","summary":"Managed PostgreSQL 16 with pgvector runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied."}],"framework":"Rails","workload":"Rails","migrationSource":"AWS EC2 app","releaseStatus":"published","supportStatus":"verified","executionStatus":"unbound","docsOnly":true,"prerequisites":["Authorized access to the AWS EC2 app source and its export tooling","An inventory of every component in scope and out of scope","A validated backup or copy before any cutover","An Ample account token with servers:write, databases:read"],"testedConfiguration":{"template":"ruby-3.4","runtime":"ruby","size":"s-1vcpu-1gb","install":"bundle config set --local path vendor/bundle && bundle config set --local without 'development test' && bundle install","start":"bundle exec rails server -b 0.0.0.0 -p $PORT"},"inputSchema":null,"outputSchema":null,"workflowSteps":[{"title":"Inventory the source","body":"List what AWS EC2 app provides beyond the component you are moving. Plan these separately: cron jobs become `ample job` schedules, files on the instance disk move to a bucket or an Ample volume, and IAM instance roles become encrypted env credentials; Ample handles networking."},{"title":"Source step 1","body":"Collect the process environment from the instance (systemd unit or process manager config) into an env file kept out of the repository"},{"title":"Source step 2","body":"Replace the instance's process manager with the repository's start command; Ample supervises the process and restarts it"},{"title":"Source step 3","body":"Inventory what else runs on the instance: databases, cron, reverse proxy rules, local files"},{"title":"Deploy on Ample in parallel","body":"bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via `rails server` reading PORT on the ruby-3.4 template with RAILS_ENV=production. Pass the exported variables with --env; keep the source running.","command":"ample deploy . --name <app-name> --public --env-file .env.production"},{"title":"Validate before cutover","body":"Run the app's own checks and, for data, compare counts and checksums; the example checks are the pattern self-tests (/p/configuration-secrets, /p/relational-records)."},{"title":"Cut over","body":"Add the custom domain with `ample domain add`, update DNS from the instance or load balancer, keep the instance until verified, then stop it."},{"title":"Rollback","body":"Point DNS or configuration back to the source. The source was never modified; deletion is a separate, user-executed step after validation."}],"examples":[{"title":"Rails pattern fixture (destination)","description":"Verified destination basis: Rails compute.","sourceRef":"tests/deploy-canaries/rails-patterns"}],"successChecks":[{"description":"destination app responds on its public URL","kind":"http_get","path":"/","expect":"ample canary rails patterns"},{"description":"configuration-secrets check from the destination example","kind":"http_get","path":"/p/configuration-secrets","expect":"see the pattern fixture checks"},{"description":"relational-records check from the destination example","kind":"http_get","path":"/p/relational-records","expect":"see the pattern fixture checks"},{"description":"data or object counts and checksums match the source","kind":"manual","expect":"operator comparison before cutover"}],"limitations":["A step-by-step guide: each stage is an ordinary `ample deploy`, `ample database` or `ample bucket` command you run.","The destination side was verified on Ample with the pattern fixture; the source-side steps use AWS EC2 app's standard tooling.","Plan separately: cron jobs become `ample job` schedules, files on the instance disk move to a bucket or an Ample volume, and IAM instance roles become encrypted env credentials; Ample handles networking.","Verified on the ruby-3.4 template at s-1vcpu-1gb.","Managed PostgreSQL 16 with pgvector. Back up and restore with pg_dump and pg_restore."],"costEstimate":{"currency":"USD","monthlyAmount":10.0,"authoritative":true,"basis":"size prices from pricing.toml (loaded by the API) at build revision 3a3dfe06151688a20d397caac2aa66e562c23eb0","components":[{"name":"app server","size":"s-1vcpu-1gb","quantity":1.0,"monthlyAmount":5.0},{"name":"managed PostgreSQL database","size":"s-1vcpu-1gb","quantity":1.0,"monthlyAmount":5.0}],"note":"Upper-bound monthly price of the tested sizes at the destination."},"evidenceSummary":[{"kind":"canary_run","summary":"Destination side verified: the Rails pattern fixture deployed on Ample (bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via `rails server` reading PORT on the ruby-3.4 template with RAILS_ENV=production) and its checks passed (the app built, started and answered on its public HTTPS URL with encrypted configuration delivered). The source-side export from AWS EC2 app uses the vendor's standard tooling.","observedAt":"2026-11-06T00:41:08Z","implementationRevision":"7360fc06ef21","expiresAt":"2027-05-05T00:41:08Z","scope":{"checks":["/p/configuration-secrets","/p/relational-records"],"destinationOnly":true,"template":"ruby-3.4"}}],"lastVerifiedAt":"2026-11-06T00:41:08Z","mcpBinding":null,"unknowns":[],"formats":{"html":"https://ample.computer/migrate/aws-ec2-app/rails","markdown":"https://ample.computer/migrate/aws-ec2-app/rails.md","json":"https://api.ample.computer/v1/catalog/recipes/page%3Amigrate%3Aaws-ec2-app%3Arails"},"nextActions":[{"actionId":"browse-catalog","label":"Browse the catalog index","operationId":"catalog_index","method":"GET","relativePath":"/v1/catalog","origin":"api","parameters":{},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"search-recipes","label":"Search published recipes by intent, stack and constraints","operationId":"search_recipes","method":"POST","relativePath":"/v1/catalog/search","origin":"api","parameters":{"body":{"limit":5,"query":"Migrate AWS EC2 app: Rails"}},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"plan:page:migrate:aws-ec2-app:rails","label":"Prepare a side-effect-free deployment plan for an authorized project","operationId":"plan_deployment","method":"POST","relativePath":"/v1/catalog/plan","origin":"api","parameters":{"body":{"inputs":{},"projectId":"<workspace or server id you own>","recipeId":"page:migrate:aws-ec2-app:rails","recipeRevision":"r1"}},"requiresAuthentication":true,"requiresApproval":false},{"actionId":"auth-setup","label":"Read the existing agent authentication setup","operationId":"existing_auth_setup","method":"GET","relativePath":"/mcp/setup","origin":"api","parameters":{},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:migration:aws-ec2-app","label":"Browse AWS EC2 app","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/migration%3Aaws-ec2-app","origin":"api","parameters":{"nodeId":"migration:aws-ec2-app"},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:stack:framework-rails","label":"Browse Rails","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/stack%3Aframework-rails","origin":"api","parameters":{"nodeId":"stack:framework-rails"},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:intent:migrate-compute","label":"Browse Migrate compute","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/intent%3Amigrate-compute","origin":"api","parameters":{"nodeId":"intent:migrate-compute"},"requiresAuthentication":false,"requiresApproval":false}]}