Deployment Platforms
Deploy marimo notebooks to production environments using cloud platforms, Docker containers, Kubernetes, and more. This guide covers best practices for production deployments across various platforms.Docker Deployment
Official Docker Images
marimo provides official Docker images for quick deployment:Custom Dockerfile
Build a custom image with your dependencies:Docker Compose
Orchestrate multi-container deployments:Cloud Platform Deployment
Railway
Deploy to Railway with one click:1
Create railway.toml
2
Add requirements.txt
3
Deploy
Connect your GitHub repo to Railway and deploy automatically on push.
Hugging Face Spaces
Deploy as a Hugging Face Space:1
Create README.md
2
Create Dockerfile
3
Push to Hugging Face
Upload files to a new Space and it will build automatically.
Google Cloud Run
Deploy serverless on Google Cloud:AWS ECS/Fargate
Deploy on AWS Elastic Container Service:Azure Container Instances
Kubernetes Deployment
Basic Deployment
Deploy to Kubernetes cluster:HPC and Research Computing
Slurm Clusters
Deploy on HPC clusters with Slurm:SkyPilot
Deploy to any cloud with SkyPilot:Reverse Proxy Configuration
Nginx
Configure nginx as reverse proxy:Caddy
Use Caddy for automatic HTTPS:Environment Configuration
Environment Variables
Configure marimo with environment variables:Secrets Management
Production Best Practices
Security
1
Use authentication
Enable token authentication or implement custom auth middleware:
2
Run as non-root user
Create and use a dedicated user in Docker:
3
Enable HTTPS
Use TLS/SSL certificates via reverse proxy (nginx, Caddy).
4
Configure CORS
Restrict allowed origins:
5
Use security headers
Add via reverse proxy: HSTS, X-Frame-Options, CSP, etc.
Performance
Reliability
Monitoring
Monitor your deployment:Troubleshooting
Common Issues
Connection refused / timeout
Connection refused / timeout
- Check firewall rules
- Verify port binding (
0.0.0.0not127.0.0.1) - Check health endpoint:
curl http://localhost:8080/health
WebSocket connection failed
WebSocket connection failed
- Configure reverse proxy for WebSocket upgrade
- Check timeout settings (increase for long operations)
- Verify SSL/TLS termination handling
Out of memory errors
Out of memory errors
- Increase container memory limits
- Reduce session TTL to clean up faster
- Profile memory usage
- Use more efficient data structures
Slow response times
Slow response times
- Check resource limits (CPU/memory)
- Profile application performance
- Add caching for expensive operations
- Scale horizontally with more replicas
Examples
Complete Production Setup
Next Steps
Deploy as App
Configure app deployment options
Authentication
Secure your deployment
Docker Guide
Detailed Docker deployment guide
Kubernetes
Advanced Kubernetes patterns