---
title: "Replit deployment keeps crashing or going to sleep"
description: "Replit deployments crash from missing secrets, wrong ports or slow startup, and Autoscale sleeps by design. How to check the logs and fix each cause."
url: https://whocanfixmyapp.com/problems/replit-deployment-crashing-or-sleeping
---

[Home](https://whocanfixmyapp.com/) / [Problems](https://whocanfixmyapp.com/problems) / [Deploy and go live](https://whocanfixmyapp.com/problems#deploy-and-go-live)

# Replit deployment keeps crashing or going to sleep

VC-20 · Replit · Updated October 2026 · By [Nathaniel Kelley](https://whocanfixmyapp.com/authors/nathaniel-kelley)

Quick verdict

Partly fixable yourself. Logs, secrets and deployment type, under two hours.

- **How serious**: High
- **Fix it yourself?**: Partly, some steps need a developer
- **Typical cost**: €99–$990 for a single fix ([prices](https://whocanfixmyapp.com/pricing))
- **Top rated for Replit**: [Afterbuild Labs](https://whocanfixmyapp.com/companies/afterbuild-labs) · **10.0**/10

**What you see.** Your published Replit app returns 502 errors, restarts on its own, or takes seconds to wake after a quiet spell.

## Why it happens

Replit runs your published app on a different machine from the editor. Three settings do not carry over. Secrets set in the editor are separate from deployment secrets, so a missing production key makes the app crash on start or fail at login. The server must listen on `0.0.0.0` and the `PORT` the platform gives it, not localhost. And Replit sends a health request before marking the app live, so a homepage that takes more than five seconds fails the publish.

Sleeping is often not a bug. The default **Autoscale** type scales to zero when idle and the first request afterward is a cold start that takes a few seconds. Autoscale deployments also restart by design, and a `SIGTERM` in the logs is normal. A real crash shows `Exit code 1`, and a 502 usually means the process died. Apps that need websockets, background jobs or an always-on server belong on **Reserved VM**, described as one dedicated server that never sleeps.

## Fix it yourself

1. Open the **Publishing** pane and the **Logs** tab. Find `Exit code 1` and read the lines just before it. Ignore `SIGTERM` lines.
2. Compare every key in the editor **Secrets** pane with the deployment secrets in the Publishing pane. Add the missing ones, then click **Publish** so they take effect.
3. Ask Agent to make the server read `process.env.PORT` and bind to `0.0.0.0`. Hard-coded ports and localhost fail when published.
4. If the app wakes slowly and you need it always on, switch the deployment type to **Reserved VM**. If it only serves a web app with occasional traffic, Autoscale cold starts are expected.
5. Move anything the app writes to disk into the database. Replit says the published filesystem resets on every publish and files do not persist.
6. If the publish fails at the end, make the homepage respond in under five seconds by deferring heavy startup work.

## When to get an engineer

Hire when the crash is an unhandled error inside the code, when memory runs out under real traffic, or when the app needs a split between a web server and a background worker. Send the engineer the deployment logs around the first error, the deployment type and your secrets list without values. A single fix is €99–$990, about 2 days. Ongoing care at $100–$5,000 a month adds monitoring so crashes reach you first. See [our Replit guide](https://whocanfixmyapp.com/guides/replit).

## Top-rated companies for Replit apps

Ranked by our score: published prices, scope of work, AI tools named, timing and a low-risk first step. [How we score](https://whocanfixmyapp.com/methodology#score).

- 1 · [Afterbuild Labs](https://whocanfixmyapp.com/companies/afterbuild-labs) · **10.0**/10 · Best for: A check before launch · Free first step · from $49
- 2 · [Redlab](https://whocanfixmyapp.com/companies/redlab) · **10.0**/10 · Best for: A full rescue by one team that keeps building · Free first step · from $490
- 3 · [Vibe Code Rescue (Lev Arakelyan)](https://whocanfixmyapp.com/companies/vibe-code-rescue-lev-arakelyan) · **9.0**/10 · Best for: A one-off check and a cleanup · From $299

[All 49 Replit companies, ranked](https://whocanfixmyapp.com/best/replit-developers)

## Check these

OPS-03 · High

Errors reach you before users do

Add error monitoring and uptime alerts. If you learn about outages from customers, this is missing.

OPS-04 · Medium

Secrets live in the host's environment settings

Keys belong in environment variables on the server, not in the repository or in front-end code.

OPS-02 · High

Testing and real users use separate databases

Experiments and AI agents should never run against production data.

COST-03 · Medium

Key pages load fast on a phone

Run PageSpeed Insights on the home page and the main app screen, on mobile.

## Questions

### Is a slow first request a problem?

On Autoscale it is expected. Replit says the first request after scaling to zero can take a few seconds and calls it a normal cold start. Use Reserved VM if you cannot accept that.

### Why do my development secrets not work in production?

Replit stores development and deployment secrets separately, and changing one does not update the other. Add each key in the Publishing pane and publish again.

Sources: [Replit: Troubleshoot publishing](https://docs.replit.com/cloud-services/deployments/troubleshooting); [Replit: Deployment types](https://docs.replit.com/features/publishing/deployment-types); [Replit: Deployment and publishing help](https://docs.replit.com/help/deployment-and-publishing); [Replit: Networking and app errors](https://docs.replit.com/help/networking-and-app-errors).

**Replit guide**

What Replit builds, where it breaks and how to check it: [Replit app rescue: Replit Agent projects in production](https://whocanfixmyapp.com/guides/replit).

**Same category**

- [Lovable app not working: what breaks between preview and production](https://whocanfixmyapp.com/problems/lovable-app-not-working)
- [Base44 app not loading or stuck on Thinking: what it usually means](https://whocanfixmyapp.com/problems/base44-app-not-loading)
- [v0 app needs a backend and deployment: what to add before real users](https://whocanfixmyapp.com/problems/v0-app-needs-a-backend)
- [Claude Code or Cursor app works on localhost, breaks in production](https://whocanfixmyapp.com/problems/claude-code-works-on-localhost-breaks-in-production)
- [Lovable publish fails with a build error](https://whocanfixmyapp.com/problems/lovable-publish-failed-build-error)
- [Lovable custom domain stuck on Verifying or Setting up](https://whocanfixmyapp.com/problems/lovable-custom-domain-stuck-verifying)

[All deploy and go live problems](https://whocanfixmyapp.com/problems#deploy-and-go-live)

**Run every check**

The [production checklist](https://whocanfixmyapp.com/checklist) has all 24 checks with a verdict.
