Deploy Ruby on Rails on Oracle Cloud's free tier
Puma, Sidekiq and Active Storage on an ARM instance with no per-dyno pricing.
At a glance
| Base image | ruby:3.3-alpine |
|---|---|
| Port | 3000 |
| Build command | bundle install && bundle exec rails assets:precompile |
| Start command | bundle exec puma -C config/puma.rb |
| Infrastructure cost | $0 on Oracle Always Free (platform fee for managed DevOps) |
Running Ruby on Rails on Ampere ARM
Native gems (pg, nokogiri, bcrypt) compile cleanly on Ampere but add a minute or two to cold builds; layer caching makes subsequent deploys fast.
Steps
- Precompile assets in the image. Use a dummy SECRET_KEY_BASE at build time so precompilation does not need production secrets.
- Run Sidekiq as a second container. Same image, different command — no extra dyno cost because it is your own VM.
- Migrate before the traffic switch. Add `rails db:migrate` as a release step.
Dockerfile for Ruby on Rails on ARM64
FROM ruby:3.3-alpine
WORKDIR /app
RUN apk add --no-cache build-base postgresql-dev tzdata nodejs yarn
COPY Gemfile Gemfile.lock ./
RUN bundle config set --local without 'development test' && bundle install
COPY . .
ENV RAILS_ENV=production RAILS_SERVE_STATIC_FILES=true RAILS_LOG_TO_STDOUT=true
RUN SECRET_KEY_BASE=dummy bundle exec rails assets:precompile
EXPOSE 3000
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]Need one tailored to your repository? The free Dockerfile generator writes an ARM-ready multi-stage build for you.
Common mistakes
- Missing tzdata: Alpine images need tzdata or Rails raises on timezone lookups.
- Serving assets: Set RAILS_SERVE_STATIC_FILES unless a proxy serves public/ for you.
- Active Storage on local disk: Mount a volume or use Oracle Object Storage, or uploads vanish on redeploy.
Related reading
- /alternatives/heroku-free-2026
- /compare/heroku-alternatives-free
- /guides/self-host-docker
- All deployment guides
Get the Oracle Always Free deploy checklist
One email with the exact steps, capacity workarounds and tools we use to ship apps for $0 of cloud spend.
One email, no spam. Unsubscribe anytime.
Frequently asked
Is this a Heroku replacement?+
Functionally yes: web, worker and cron processes all run as containers on hardware that costs nothing.
Does Action Cable work?+
Yes — WebSockets stay open on a persistent server.
What about zero-downtime?+
Health-check gated blue/green swaps are built into the deploy.
Deploy your project for $0
No credit card. No Oracle sales call. Ship to your own cloud in under 10 minutes.
Start free