Deploy, Convert & Scale

How to Deploy a Replit App to Production (Custom Domain, Secrets)

Replit lets you build a full-stack app with Replit Agent and publish it from the same workspace using Replit Deployments. Production readiness comes down to picking the right deployment type, connecting a custom domain, keeping credentials in Secrets, separating development and production data, making public pages crawlable and adding monitoring.

neooutput editorial team 4 min read Auf Deutsch lesen

Choose the right Replit deployment type

Replit offers several deployment types, and choosing correctly matters more for cost and reliability than any other setting.

Autoscale deployments scale instances up and down with traffic (including down to zero when idle), which suits most web apps and APIs with variable traffic. Reserved VM deployments keep a machine running continuously, which suits bots, websockets, long-running workers and apps that cannot tolerate cold starts. Static deployments serve frontend-only sites cheaply. Scheduled deployments run jobs on a timetable. Check the current options and pricing in Replit's documentation, as they evolve.

If users ask for an app on their phones, a deployed Replit web app can be the base. WebViewGold converts it into native iOS and Android apps without code, with configurable push notifications, an offline screen and deep links. Pick a deployment type without cold starts for that case, because a slow first load feels much worse inside an app, and remember that Apple's guideline 4.2 requires native value beyond the website itself.

  • Autoscale: web apps and APIs with bursty traffic.
  • Reserved VM: always-on servers, bots, websockets, background workers.
  • Static: pure frontend builds.
  • Scheduled: cron-style jobs such as reports or syncs.

Build and run commands

Make sure the deployment uses an explicit production build and run command, not the development server the Agent used while building.

Development servers with hot reload are slower and sometimes expose debug information. In the deployment configuration, set the build step (for example npm run build) and a production start command, bind to the port Replit expects and test it in a fresh deployment. Ask Replit Agent to add a /health route you can use for monitoring.

Also confirm that the app reads configuration from environment variables rather than from values Agent hard-coded during development, for example a database URL, a base URL for links in emails or a feature flag. A quick search for localhost and replit.dev addresses in the code finds most of these before they cause broken links in production.

Custom domain

You link a custom domain in the deployment settings and add the DNS records Replit provides, typically an A record and a TXT verification record.

After verification, Replit serves the app over HTTPS on your domain. Decide on apex versus www and redirect consistently. Then update everything that hard-codes the replit.app address: OAuth callback URLs, Stripe webhooks, email templates and CORS rules.

  1. Open the deployment's settings and add your domain.
  2. Create the A and TXT records at your registrar exactly as shown.
  3. Wait for verification and HTTPS to become active.
  4. Update callbacks, webhooks and absolute URLs to the new domain.
  5. Test sign-up, login and payments end to end.

Secrets and production data

Store every API key and credential in Replit Secrets and make sure deployments use production values while development uses separate ones.

Secrets are exposed to your code as environment variables, so read them with process.env or os.environ and never print them in logs. Keep development and production databases separate so Agent experiments cannot damage live data; Replit has added tooling for separating development and production databases, and you should verify your app actually uses it. Be careful when Agent runs migrations or seed scripts, and keep regular backups or exports of production data.

SEO for Replit-hosted apps

If Agent built a React frontend rendered in the browser, public pages need server rendering, prerendering or a separate static site to be reliably indexed.

For content pages, ask Agent to render HTML on the server (for example with Express templates or a framework with SSR) or to prerender at build time. Add unique titles and meta descriptions, a sitemap.xml, robots.txt and Open Graph tags, and serve proper 404 status codes. Use an Autoscale or Reserved VM deployment for server-rendered pages and a Static deployment for a marketing site if that is all you need.

Monitoring and logs

Use the deployment's logs and metrics, then add external uptime checks and error tracking for alerts.

Replit shows deployment logs and resource usage, which is enough for debugging but not for paging someone at night. Add an uptime monitor on the health route, an error tracker in client and server code and alerts on error spikes. Watch usage-based costs in the first weeks; an Autoscale app hit by bots can scale more than you expect, so add rate limiting and bot protection.

Frequently asked questions

Which Replit deployment should I use for a web app?

Autoscale suits most web apps with variable traffic. Use Reserved VM if you need an always-on process, websockets or no cold starts, and Static for frontend-only sites.

How do I add a custom domain to Replit?

Open the deployment settings, add the domain and create the DNS records Replit shows, usually an A and a TXT record. HTTPS is provisioned after verification.

Where should I store API keys on Replit?

In Replit Secrets, which are exposed as environment variables. Never hard-code keys in source files, and use different values for development and production.

Can I keep using Replit Agent after launch?

Yes, but test Agent's changes against development data and a staging deployment first, and redeploy production only after the important flows pass.

All insights