5

I really like to deploy apps on Vercel. I do however wonder how one is supposed to deal with all the preview deployments that inevitably will get created.

Are you supposed to delete them yourself? Is there a way to automate deletion of preview deployments after a certain amount of time?

Fabian Bosler
  • 2,310
  • 2
  • 29
  • 49

2 Answers2

2

There is no need to delete preview deployments because they are not indexed by search engines.

If you want to make sure no one outside your organization can access preview deployments, you can enable password protection for your project.

styfle
  • 22,361
  • 27
  • 86
  • 128
  • 5
    would still like to be able to control when they are deleted :) – Fabian Bosler May 04 '21 at 13:26
  • 2
    Totally agree here, @FabianBosler. Were you able to figure out in the end? – antonwilhelm Nov 04 '21 at 17:33
  • 2
    If you're working with a database, however, I'd be worried that an old deployment might function in a way that destroys data or inserts/updates records improperly according to the latest spec (more of a problem for NoSQL); anyone on your team could open up an old deployment and cause issues. I wonder if there's a general Vercel-recommended way to deal with that... – TJ Mazeika Jun 03 '22 at 21:41
  • @styfle I just realized that one of our apps has hundred (maybe thousands) of preview deployments. I don't think we are getting billed for all this but wouldn't it make sense for Vercel to allow the configuration of a retention policy? – Nicolas Bouvrette Jul 26 '22 at 17:06
  • 2
    Thanks for the answer, but "no need" is wrong. e.g. what if you commit a version of your app that has a glaring security vulnerability, then that is going to exist on the internet FOREVER. Even though it's pretty unlikely someone will guess the url and then exploit the vulnerability it still makes me uncomfortable. – Gus Bus Aug 30 '22 at 12:08
1

You can use this in CLI:

vercel rm <APP> --safe
Shawphy
  • 19
  • 1