> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel Cloud Hibernation (auto-sleep)

> How Laravel Cloud's auto-hibernation feature works, how to enable it, its limitations, and how Path Blocking prevents unwanted wake-ups.

## What is Hibernation?

**Hibernation (auto-sleep)** on Laravel Cloud is a legacy feature that puts an environment into a suspended state when it hasn't received an HTTP request for a certain period.
On today's new Flex compute, the faster **Scale to Zero** is used as its successor.

Legacy Flex Hibernation stops compute billing during sleep, but it typically takes 5–20 seconds to wake up after receiving an HTTP request. The new Scale to Zero shortens startup to **under 500ms**, and even during sleep the environment automatically wakes for scheduled tasks and queue processing.

<Warning>
  If you're new to Laravel Cloud, it's safer to plan around **Scale to Zero** rather than Hibernation. For the full picture including Managed Queues and the new pricing plans, see [Laravel Cloud — a full look at the Laravel-native PaaS](/en/blog/laravel-cloud).
</Warning>

```mermaid theme={null}
sequenceDiagram
    participant User as User
    participant Cloud as Laravel Cloud
    participant App as App

    User->>Cloud: No requests (timeout)
    Cloud->>App: Transition to suspended<br>(billing stops)
    User->>Cloud: HTTP request
    Cloud->>App: Wake up in 5-20s
    App-->>User: Response
```

## What Scale to Zero changed

With Scale to Zero on the new Flex compute, many of the pain points of the old Hibernation are largely resolved.

| Item                 | Old Hibernation                          | New Scale to Zero                                          |
| -------------------- | ---------------------------------------- | ---------------------------------------------------------- |
| HTTP request wake-up | 5–20 seconds                             | Under 500ms                                                |
| Scheduled Tasks      | Doesn't run while suspended              | Auto-wakes and runs even while sleeping                    |
| Queue processing     | Doesn't run while suspended              | Auto-wakes even while sleeping. Managed Queues recommended |
| Recommended use      | Cost savings on legacy Flex environments | Today's standard configuration                             |

<Info>
  With the old Hibernation, task schedules and queues did not run while suspended. Scale to Zero resolves this—queue processing in particular can continue safely with Managed Queues even while the App cluster is asleep.
</Info>

## Enabling old Hibernation

<Steps>
  <Step title="Open the App compute cluster">
    On the environment's infrastructure canvas dashboard, click the App compute cluster.
  </Step>

  <Step title="Enable Hibernation">
    Toggle **Hibernation** on.
  </Step>

  <Step title="Save and redeploy">
    Click **Save and Redeploy** to apply changes.

    <Warning>
      Changing the setting alone doesn't take effect. Save and Redeploy is required.
    </Warning>
  </Step>
</Steps>

<Tip>
  To enable this on a current environment, use the App compute cluster's **Scale to Zero** toggle. The limitations below primarily assume the old Hibernation / Legacy Flex.
</Tip>

## Limitations while old Hibernation is suspended

While Hibernation is enabled and the environment is suspended, the following functions do not work.

| Function                    | Behavior while suspended          |
| --------------------------- | --------------------------------- |
| HTTP request handling       | Stopped (processed after wake-up) |
| Task Scheduler              | Does not run                      |
| Queue Worker                | Does not run                      |
| Custom background processes | Do not run                        |

<Info>
  When it wakes from suspension, these processes automatically resume. However, scheduled jobs that "should have run" during the sleep period are not executed retroactively.
</Info>

Additionally, Hibernation has these constraints:

* Only **Flex compute** can hibernate. Hibernation cannot be enabled on Pro compute.
* Hibernation is applied **per environment**. When the App cluster hibernates, all Worker clusters in the same environment also hibernate.

## Causes of unwanted wake-ups

The environment automatically wakes on any HTTP request, but unintended requests can also cause wake-ups.

* **Bots and crawlers** — Search engines, security scanners, and other bots crawl pages automatically
* **Slack or Teams link previews** — Messaging apps hit links to fetch thumbnails
* **WordPress scans** — Automated scans looking for WordPress installations hit paths like `/wp-admin`
* **Attacks looking for `.php` files** — Automated scans that directly probe for PHP files

Laravel Cloud's `*.laravel.cloud` domains are given an `X-Robots-Tag: noindex, nofollow` header so search engines don't index them, but once the domain is discovered you can't fully prevent this. The `noindex` header is not added to custom domains.

<Tip>
  Using a more complex domain name reduces the risk of bots discovering your vanity domain.
</Tip>

## Preventing unwanted wake-ups with Path Blocking

**Path Blocking** blocks requests to certain extensions or paths without processing them, keeping the environment suspended. It prevents WordPress scans and attacks targeting PHP files from causing unwanted wake-ups.

The extensions and paths blocked by default are:

**Blocked extensions:**

```
.php, .php3, .php4, .php5, .php6, .php7, .php8,
.phtml, .pht, .phps, .env, .git
```

**Blocked paths:**

```
/wp-admin, /wp-content, /wp-includes, /wp-json
```

These requests receive a response without waking the app, even while the environment is suspended.

<Info>
  Normal Laravel routing doesn't use requests with a `.php` extension, so blocking them doesn't affect your app.
</Info>

## Where old Hibernation fits and doesn't fit

<Columns cols={2}>
  <Card title="Good fits" icon="check">
    * **Staging and development environments** — no need for 24/7 uptime; significant cost savings
    * **Personal blogs and portfolios** — low-traffic use cases
    * **Demo and trial apps** — waking up on demand is enough
    * **Low-frequency internal tools** — limited usage windows
  </Card>

  <Card title="Poor fits" icon="xmark">
    * **Uses task scheduling** — `schedule:run` doesn't execute while suspended
    * **Regular queued jobs required** — queues stop while suspended
    * **Production where startup latency isn't acceptable** — 5–20 seconds to wake
    * **WebSocket-based apps** — connections may not persist and hibernation may be delayed
  </Card>
</Columns>

<Warning>
  If you use the task scheduler to run periodic jobs (email delivery, data aggregation, etc.), those jobs won't run while Hibernation is active. In such cases, either turn Hibernation off or design an external scheduler (such as GitHub Actions) that sends requests to keep the environment awake.
</Warning>

<Info>
  The new Scale to Zero relaxes these constraints. Scheduled Tasks run automatically even while sleeping, and queue processing with Managed Queues isn't affected by the App cluster's suspension.
</Info>

## Summary

Hibernation is still useful for cost reduction on Legacy Flex, but Scale to Zero is more practical today.

* Billed only for active time on Legacy Flex. Auto-suspends after a timeout.
* Old Hibernation wake-up time is 5–20 seconds.
* The new Scale to Zero starts up in under 500ms.
* With Scale to Zero, Scheduled Tasks and Managed Queues work even while sleeping.
* Path Blocking prevents unwanted wake-ups from bots.
* Only Flex compute is supported.

## Related pages

<Columns cols={2}>
  <Card title="Scheduling" icon="calendar" href="/en/scheduling">
    See Task Scheduler configuration and behavior on Laravel Cloud.
  </Card>

  <Card title="Queues" icon="list" href="/en/queues">
    See Queue Worker configuration and operations on Laravel Cloud.
  </Card>

  <Card title="Laravel Cloud overview" icon="cloud" href="/en/blog/laravel-cloud">
    Managed Queues, Scale to Zero, and the new pricing plans in one place.
  </Card>
</Columns>


## Related topics

- [Laravel Cloud — a full look at the Laravel-native PaaS](/en/blog/laravel-cloud.md)
- [laravel/symfony-on-cloud — run Symfony apps on Laravel Cloud](/en/blog/symfony-on-cloud-introduction.md)
- [May 2026 Laravel updates](/en/blog/changelog/202605.md)
- [Deployment](/en/deployment.md)
- [Cloud Sessions](/en/packages/laravel-copilot-sdk/cloud-sessions.md)
