Skip to main content

Upgrading Lambda

1. Upgrade all Remotion packages

Upgrade all packages to the newest version (@remotion/lambda, but also remotion, @remotion/cli etc.)

npx remotion upgrade

See npx remotion upgrade.

- "@remotion/bundler": "4.0.0" + "@remotion/bundler": "4.0.1"
- "@remotion/renderer": "4.0.0" + "@remotion/renderer": "4.0.1"
- "@remotion/lambda": "4.0.0" + "@remotion/lambda": "4.0.1"
- "remotion": "4.0.0" + "remotion": "4.0.1"

2. Deploy a new Lambda function

npx remotion lambda functions deploy

See npx remotion lambda functions deploy.

This deploys a new function with the latest version. You can keep old functions deployed if they are still in use in production.

3. Update the site

npx remotion lambda sites create src/index.ts --site-name=my-name

See npx remotion lambda sites create.

Pass --site-name with the name of an existing site to update it.
The URL will stay the same but older functions may not be able to render the updated site.

If you don't pass --site-name, a new site URL will be generated.
You'll need to update the serveUrl parameter in your renderMediaOnLambda() calls.

It is advised that the function, the site and the @remotion/lambda package calling the render are all on the same version. If the site is on a different version than the function, you may get a version mismatch warning – or if there was a protocol change, renders may fail.

4. Remove old functions

info

Only do this once the old function is no longer being used in production.

npx remotion lambda functions rm <function-name>

See npx remotion lambda functions rm.

Zero-downtime upgrades

If you already shipped Remotion Lambda to production, you can upgrade without incurring any downtime:

  1. Deploy the new function and create a new site – old functions and sites remain unaffected.
  2. Update the @remotion/lambda package version, function name and serveUrl in your application.
  3. Ship your application update. From this point, all new renders use the new function + site.
  4. Once no in-flight renders remain on the old version, remove the old function and site.

Useful commands

See also: Separating production and testing environments