Deployment, Databases & Production
From the course Replit AI & Agent for Developers
Take your Replit projects from prototypes to production with databases, deployment, and scaling features.
Deployment Options
Autoscale Deployments
- Automatically scales based on traffic
- Pay for compute time used
- Supports custom domains
- Zero-downtime deploys
Reserved VM Deployments
- Always-on virtual machines
- Consistent performance
- Background tasks and cron jobs
- WebSocket support
Static Deployments
- For static sites and SPAs
- Fast global CDN distribution
- Free for basic usage
- Custom domain support
Database Options
Replit Database
- Built-in key-value store
- Simple API: set, get, delete, list
- Good for prototypes and small projects
- Persistent across restarts
PostgreSQL
- Full relational database
- SQL queries and joins
- Suitable for production applications
- Managed by Replit — no setup required
Connecting External Databases
- Use Secrets to store connection strings
- Connect to MongoDB, MySQL, Supabase, or any database
- Standard library support for all major databases
Environment & Secrets
Managing Secrets
- Store API keys, database URLs, and tokens securely
- Access in code via environment variables
- Never committed to version control
- Separate secrets per environment
Environment Configuration
- .replit file configures run commands and environment
- replit.nix for system-level dependencies
- pyproject.toml or package.json for language-specific deps
Custom Domains
- Purchase or bring your own domain
- Add the domain in Replit's deployment settings
- Configure DNS records (CNAME) at your registrar
- SSL certificates automatically provisioned
- Domain active within minutes
Named Example: Shopify App Partners & NGOs
Several Shopify app partners bootstrap their initial prototypes on Replit before migrating to dedicated infrastructure, valuing the zero-setup database and instant deploy for early validation. Multiple non-profit organizations — including food banks and community shelters — use Replit's free Autoscale tier to host intake and scheduling apps that they built using Replit AI Agent with no technical staff, keeping operational costs near zero.
Common Pitfall: Replit's built-in Replit Database (key-value store) is convenient for prototyping but not suitable for complex relational data queries. If you find yourself storing JSON blobs and parsing them in code, it's time to switch to the PostgreSQL option before your codebase becomes hard to maintain.
Best Practice: Store all sensitive configuration (API keys, database passwords) in Replit Secrets from day one. Never hardcode them in source files even in a private Repl — if you ever share the Repl or push to GitHub, exposed secrets become a security incident.
Key Takeaways
- •Autoscale, Reserved VM, and Static deployment options cover different application needs
- •Built-in PostgreSQL and key-value database provide managed persistence without setup
- •Secrets management securely stores API keys and connection strings as environment variables
- •Custom domains with automatic SSL make Replit suitable for production applications
Progress is kept in this browser only.