Putting a Laravel site in maintenance mode is a one-command job: run php artisan down from your project folder and every visitor sees a maintenance page instead of your site. The safe part is everything around that command — a backup, a way for yourself to get through, and a tested way back up. Skip those steps and a two-minute update can leave your site stuck offline.
We do this before every update we ship, and the routine below is the one we actually use. It takes five minutes, and it has saved us from the two classic mistakes: locking ourselves out of our own site, and forgetting the site is still down hours later.
What does maintenance mode actually do?
When maintenance mode is on, Laravel stops serving your site and answers every request with a 503 status and a maintenance page. Visitors see a short message instead of your pages, and search engines see a 503, which tells them the outage is temporary. That matters, because a 503 says "come back later" while a 500 says "something is broken".
Laravel writes a small file, storage/framework/down, to record that the site is down. As long as that file exists, the site stays in maintenance mode. Bringing the site back up deletes the file. That is the whole mechanism, and knowing it is useful: if the artisan command ever fails, you know exactly which file to check.
What should you do before you switch maintenance mode on?
A two-minute job still deserves two minutes of preparation. Work through this list before you run the command:
- Take a backup of the database and the files you are about to change.
- Write down the exact commands you will run, including the one that brings the site back up.
- Check you can reach the server — SSH, terminal or your host's file manager — because you will need it to bring the site back.
- Tell anyone else who works on the site, so nobody panics when it goes down.
- Pick a quiet time, and keep the maintenance window short.
The backup is the one people skip, and it is the one that matters most. Maintenance mode protects visitors from seeing a half-updated site, but it does nothing to protect you from a bad update. If the update breaks something, the backup is your way back.
How do you put a Laravel site in maintenance mode?
Open a terminal in your project folder — the folder that contains the artisan file — and run:
php artisan down
Then visit the site in a private browser window. You should see the maintenance page. If you still see the normal site, you are probably in the wrong folder, or the site you are visiting is served from a different folder than the one you ran the command in. On cPanel, that mix-up is common: the live project folder and an old copy elsewhere can look identical.
You can customise the page visitors see. The --render option lets you point maintenance mode at one of your own views, for example php artisan down --render="errors::503", and --retry=60 adds a Retry-After header telling browsers and search engines to come back in 60 seconds. One warning from our own experience: artisan down --render pre-renders the view and stores it, so editing the blade file afterwards changes nothing until you run the command again to refresh it.
| Command | What it does |
|---|---|
| php artisan down | Puts the site in maintenance mode |
| php artisan down --secret="..." | Maintenance mode with a bypass link for you |
| php artisan up | Brings the site back online |
How do you let yourself through while the site is down?
You will usually want to test the update yourself while visitors still see the maintenance page. Laravel has a built-in way: the --secret option.
php artisan down --secret="your-secret-here"
After running that, visit yoursite.com/your-secret-here once in your browser. Laravel sets a cookie, and from then on your browser bypasses maintenance mode while everyone else still sees the maintenance page. Use a secret that is long and random, not your site name, and do not share the link.
If you skip the secret and run plain php artisan down, you lock yourself out too — you will see the same maintenance page as everyone else, and you cannot test anything until the site is back up. That is fine for a quick update, but for anything you need to check first, the secret is the way to do it.
How do you bring the site back up?
From the same project folder, run:
php artisan up
Then visit the site in a private window and click through the pages you changed. Do not trust the homepage alone — open the page you actually updated, log in if the update touched authentication, and check the log at storage/logs/laravel.log for fresh errors.
If the site does not come back, check whether the file storage/framework/down still exists. If it does, delete it directly through your file manager or terminal — that is the manual way to end maintenance mode, and it works when the artisan command cannot run for some reason.
What if the site stays down after you bring it back?
First, confirm the site is actually out of maintenance mode and not showing a different error. A 503 means maintenance mode is still on. A 500 means the site is up but something in the update broke, and the fix is in the log file, not in the maintenance command.
The usual causes after an update are a cached config that still points at the old setup, a missing step in the update such as a database migration, or file permissions that changed during the upload. Run php artisan config:clear and php artisan cache:clear, check the log, and if the update itself is the problem, restore the backup you took before you started. That is what it is for.
And if you ever find the site still in maintenance mode hours later, it is almost always because the person who put it down forgot the php artisan up step, or ran it in the wrong folder. The file check above — does storage/framework/down still exist — settles it in seconds.
Maintenance mode is a small tool, but it is the difference between a professional update and a public mess. Used properly, your visitors see a clean holding page for a few minutes while you work in peace. If an update goes wrong, our 9 common errors after install guide and the 500 error checklist cover the usual fixes. The cPanel installation guide walks through a fresh setup from scratch. Every product on the full catalogue ships with full unencrypted source code and an installation guide, and the FAQs answer the setup questions we hear most.