# Maintenance Mode

> Show visitors a maintenance page on every domain while you migrate, fix or upgrade an app, and keep it up through deploys until you turn it off.

**Maintenance mode** puts a maintenance page in front of your app. Every domain the app serves, including its Potions subdomain and any multi-tenant domains, answers with the page instead of the app until you turn it off.

## Turning It On

On the app's **Settings** tab, in the **Maintenance mode** section, click **Turn on** and confirm. Potions rewrites the app's Caddy files on its server, and on its load balancer and cluster nodes if it has them, and the page is live within seconds. **Turn off** puts the app back the same way. The app's **Overview** shows a banner while maintenance mode is on.

If a server can't be reached, nothing changes: Potions puts the previous setting back and tells you what failed.

## What Visitors See

A short page that says the site is down for maintenance, without promising when it will be back. It reloads itself every minute, so visitors see the app again without refreshing. It is served with:

- **HTTP 503** and a `Retry-After` header, which search engines treat as temporary downtime rather than a missing site.
- `Cache-Control: no-store`, so browsers and CDNs don't keep showing the page after you lift it.

`/robots.txt` answers **404** instead of the page. Google stops crawling a whole site whose `robots.txt` returns 503, so this keeps your crawl going while the pages themselves say "come back later".

## What Keeps Working

- **Your app keeps running**, and so do its background jobs and scheduled tasks. If they shouldn't, stop the app from the **Service** section above it as well.
- **Deploys and rollbacks work behind the page.** Every Caddy file Potions writes keeps the page up, so you can deploy a fix or run a migration, then turn maintenance mode off when you're ready. Potions' deploy health checks talk to the app directly, so they aren't affected.
- **Uptime checks pause** while it's on, so the downtime you asked for doesn't count against the app or send alerts. They resume when you turn it off.
- **New certificates still issue** for multi-tenant apps with dynamic custom domains: the certificate check reaches the app as usual.

Changing maintenance mode waits for a running deploy to finish.

## Good to Know

- Pages that are already open in a browser, such as LiveView pages, don't switch to the maintenance page. They try to reconnect and show the page once they're reloaded.
- During a [database move](/docs/database-servers), Potions shows the same page on its own and removes it when the move finishes. If you had maintenance mode on, it stays on afterwards.
