Yes — very easily.
Caddy is actually excellent for hosting multiple Rails apps on one machine.
You simply:
- run each Rails app on a different internal port
- let Caddy route domains/subdomains to the correct app
Example architecture
Mac mini
├── Caddy
├── App 1 (Puma :3000)
├── App 2 (Puma :3001)
├── App 3 (Puma :3002)
└── SQLite files
Traffic:
app1.com ──► localhost:3000
app2.com ──► localhost:3001
api.app3.com ──► localhost:3002
Example Caddyfile
app1.com {
reverse_proxy localhost:3000
}
app2.com {
reverse_proxy localhost:3001
}
api.app3.com {
reverse_proxy localhost:3002
}
That’s it.
Caddy automatically:
- handles SSL for all domains
- renews certificates
- routes traffic correctly
Each Rails app runs independently
For example:
App 1
PORT=3000 bundle exec puma
App 2
PORT=3001 bundle exec puma
This setup is surprisingly scalable
A modern Mac mini can comfortably run:
- several Rails apps
- SQLite databases
- Sidekiq workers
- background jobs
especially:
- M1/M2/M3 models
- 16GB+ RAM
Rails apps are often much lighter than people assume.
Process management
You’ll eventually want something to keep apps running.
On macOS, common choices are:
launchd (native macOS)
Built into macOS.
Overmind / Foreman
Simple Procfile-based management.
systemd
(Not available on macOS.)
Docker Compose
If you later move toward containers.
Very practical structure
Example:
/apps
/myapp1
/myapp2
/myapp3
Each app:
- has its own Rails directory
- own SQLite DB
- own Puma process
- own environment variables
Caddy sits in front routing requests.
SQLite works well here too
Each app just has:
- its own
.sqlite3file
Example:
myapp1/storage/production.sqlite3
myapp2/storage/production.sqlite3
No DB server needed.
One thing to watch
Because all apps share one machine:
- RAM usage adds up
- runaway apps can affect others
- backups become important
But for:
- indie apps
- internal tools
- small SaaS projects
this is very common and practical.
You can even do zero-downtime-ish deploys
Eventually you can:
- restart Puma gracefully
- deploy with git hooks
- use blue/green ports
- or adopt Kamal later
without changing Caddy much.
This is honestly a nice setup
Your architecture becomes:
MacBook
│
▼
git push / rsync / deploy script
│
▼
Mac mini
├── Caddy
├── Rails app 1
├── Rails app 2
├── Rails app 3
└── SQLite DBs
Simple, understandable, low maintenance.
🤖 created with help of ai