capsule serve app.py:app starts the local dev loop. capsule deploy app.py:app ships the app. In hosted mode, Capsule runs the app in isolated per-user runtimes so each app user has their own sandboxed execution context.
1. Confirm the entry point
app.py:app means:
- module:
app.py - symbol:
app
2. Create required resources
Create any resources your app declares before deploy:3. Deploy
4. Know what changes in hosted mode
The code stays the same, but requests now come from the hosted app:- users sign into this app’s own user pool
session.useris the current app useraccess="authenticated"pages are gated- workspace secrets are resolved in the managed runtime
- each app user gets an isolated runtime for agent work
- filesystems and container-local files are available to code running in that runtime
- declared channels can deliver messages to the app
5. Iterate
Make changes locally, serve again, then deploy the same entry point when ready.Next steps
- Use Troubleshooting if serve or deploy fails.
- See the CLI Reference for every command.
- Read SDK And Runtime Versions if local and hosted behavior diverge.