Replit deployment keeps sleeping: pick the deploy type that stays awake
By AI App Medic · Updated · Replit · Deploy · Hosting
The Repl runs while you are in the editor. You publish it, share the URL, and later a friend reports a long spinner, a timeout, or a bot that stopped responding overnight. This is usually not your Express or Flask code "randomly crashing". Replit has several ways to publish, and they do not all stay running.
The four deployment types
In the Publishing tool, open Adjust settings and look at Deployment type. Replit's current types are:
- Autoscale (the default for most web apps). Replit adds machines when you are busy and can scale to zero when idle. You pay for the time requests are served. A quiet app will go idle. The next request has to wait for a start, which can look like "it went to sleep".
- Reserved VM. One dedicated machine that does not sleep, billed as a fixed monthly cost. This is the type Replit recommends for bots, background work, and always-on APIs.
- Static. Files on a CDN, no backend process. Fine for a landing page. Not compatible with Replit apps built by Agent, which expect a server. If you published a full-stack app as Static, features that need a server will not run at all.
- Scheduled. Runs a command on a cron, then stops. There is no public website URL. Use it for backups or reminders, not for the app itself.
If you never changed the setting, you are almost certainly on Autoscale. That is the right default for many websites. It is the wrong default for a Discord bot, a webhook endpoint that must answer Stripe or Telegram in a few seconds, a socket that should stay open, or a job that runs in a loop with no incoming traffic.
Step 1: prove it is idle, not a crash
- Open the published app's logs in Replit around the time it "disappeared". A process that exits with an exception is a crash: fix the stack trace (out of memory, missing env var, unhandled promise). A quiet log and a slow first request after a gap is idle scaling.
- Hit the health path or home page twice. If the first request is slow or fails and the second is fine, you are looking at a cold start.
- Confirm the deployment type in Adjust settings, including machine power. A tiny machine can also die under load and look similar, but it usually leaves errors in the log.
Also check that you are opening the published URL, not the ephemeral editor preview, and that a custom domain still points at the current deployment.
Step 2: pick the type that matches the work
Stay on Autoscale if this is a user-facing site or API, traffic comes in bursts, and a short wait on the first visitor after a quiet period is acceptable. You can raise machine power or the maximum number of servers if it is slow under load rather than asleep.
Move to Reserved VM if any of these are true:
- A chat bot or gateway must stay connected to a third party.
- A webhook issuer will not retry long enough to cover a cold start.
- You run background work that is not triggered by an HTTP request.
- You have already tried Autoscale and the wake-up time is breaking real use.
Use Static only for a site with no server. Use Scheduled for periodic tasks, perhaps alongside a web deployment, not as a replacement for one.
Step 3: change the type cleanly
You cannot always flip the type on a live deployment in place. The safe path is:
- Note the custom domain, secrets, run command, and port you already use.
- Unpublish or shut down the current deployment (the exact control is in the Publishing UI). Expect a short outage.
- Publish again, open Advanced / Adjust settings, and choose Reserved VM (or the type you want). Set the run command and port to what the app already used.
- Reconnect the custom domain and confirm secrets are present on the new deployment.
- Leave the URL idle for half an hour, then request it once. A Reserved VM should still respond quickly. An Autoscale deploy may be slow on that first hit; that is expected.
Reserved VM costs more than a sleeping Autoscale app. If the price is not worth it, another option is to host the always-on piece somewhere else (a small VPS, or a platform with a paid always-on tier) and keep the website on Autoscale or a static host.
Things that are not a deploy type problem
- The Repl in the editor sleeps when you leave. That does not decide how a published deployment behaves. Publish it, then judge the public URL.
- A crash loop. If the process starts, exits, and starts again, fix the exception. A bigger machine will not help a missing API key.
- A firewall or allowed-host setting that rejects the published domain after you added a custom URL.
- Hitting the development preview after a publish. Share the deployment URL.
Once the public URL stays up for a quiet hour, you are done. If you are leaving Replit hosting altogether, treat it as a normal Node or Python deploy on the new host and copy env values carefully, the same way you would when moving a Lovable app off its built-in host.
FAQ
Why did it work in the Replit editor but not on the public URL?
The editor keeps your Repl awake while you are connected. A published Autoscale deployment can drop to zero servers when nobody is hitting it, so the next visitor waits for a cold start or sees a timeout.
Is Reserved VM the only way to stop it sleeping?
For a process that must run all the time, yes, Reserved VM is the type Replit documents as a dedicated machine that never sleeps. Autoscale is cheaper when traffic is bursty and a short wake-up is acceptable. Scheduled deployments run a command on a timetable and then stop; they are not a website.
Can I just ping the app every few minutes?
An external ping can reduce cold starts on some setups, but it is a workaround, it can still fail, and it may cost you request time on Autoscale. If uptime matters, change the deployment type or host somewhere that is always on.
Related guides
- Migrate a Lovable app off Lovable hosting without breaking auth or the database
- Lovable app slow first load: find the huge bundle and cut it down
- Cursor app Vercel build failed: fix the error that npm run dev never showed
- Bolt.new deploy failed (or broken) on Netlify: read the log and fix the real error
- Lovable app shows a blank white page after deploy: causes and fixes