[Support Guide] What’s the easiest way to create a temporary “maintenance page” for my site?

Last Reviewed by Netlify Support Staff: December 2022

So you need to take your site offline for maintenance. Netlify enables a great workflow for this! We suggest using a either a manual deploy (aka Drag and drop) or a special maintenance branch in your repository so you don’t have to do any heavy lifts like remove all files from your normal production branch in case you use our continuous deployment system.

To use either of those paths, you’ll start by creating some static HTML that displays your maintenance message. You can of course use graphics and other asset types, but you don't need more than this: <html>Our site is down for maintenance</html> in a single index.html file deployed at the root of your site. Note that this will temporarily REMOVE FROM SERVICE all the rest of the files and redirects on your normal deploy until you later re-publish a production deploy again, so if you have mission critical things like a manifest, or redirects that should still be active despite maintenance, you must include them with this deploy! You might want to put a catch-all redirect in place too, something like /* /index.html 302 that will make all pages show the maintenance message.

To deploy manually:

  1. Put all of that content into a folder, let’s call it maintenance.
  2. Drag that folder to your deploy listings on the site you want to put under maintenance. This will publish the maintenance page as a new deploy.
  3. After previewing the content, use the button to publish this deploy.

To deploy via Git:

  1. Instead create a branch called e.g. maintenance with the content you wish to have live in it.
  2. Update your Build & Deploy settings to also build this maintenance branch. You can add it to the list of allowed branches if you don’t already allow all branches to be built.
  3. Next, successfully deploy this branch (it will be a Branch Deploy).
  4. After previewing the content, use the button to publish this deploy.

Following up from either method:

  1. When maintenance is done, navigate to the previous production deploy from your deploys listing and choose to publish it again with the button there. No need to change code - you just choose the old deploy to republish by selecting the deploy, and on its logs page, use the “publish deploy” button to roll back to this deploy.
  2. Future deploys via your normal channel (whether that is Git commits, CLI, API, or drag and drop) will work as usual going forward.

One of the easiest “maintenance” workflows ever!


@fool It is still publishing on my main production branch instead. Please would you expound on point 3 & 4. I’m following this - to deploy via git. I’ve added the maintenance branch in my deploy settings (deploy context) and deployed the brunch (step 3). Thanks

You would need to:

  • create a different branch in git
  • create the maintenance page on that branch
  • see the branch deploy logs in our deploys listing, in our UI
  • publish that deploy with the “publish this deploy” button there
  • then use the “lock publishing to this deploy” button
  • then other commits will not be published at your production URL until you unlock.

Great, thanks! This sorted me out :slight_smile:

1 Like