Directory
Netlify will access the functions directory during every build, preparing and deploying each supported code file as a function. The default directory is YOUR_BASE_DIRECTORY/netlify/functions
. You can customize the directory using the Netlify UI or file-based configuration.
In the Netlify UI, go to Site settings > Functions and enter a path to the directory in your repository where you want to store your functions.

Alternatively, add the following to netlify.toml
for file-based configuration.
Settings in netlify.toml
override settings in the Netlify UI.
For both methods, the path is relative to the site’s base directory in your repository. To help keep your site secure, make sure your functions directory is outside of your publish directory so that your source files aren’t deployed as part of your site.
Bundle
For granular control over which files are bundled in your executable function artifacts, use the netlify.toml
properties external_node_modules
and included_files
. Visit the file-based configuration doc for details.
Node.js version for runtime
For all Node.js functions deployed on or after May 15, 2023, the default functions runtime is based on the Node.js version used for the build. The Node.js version used for the build must meet the following conditions to be inherited by the functions runtime:
- Must be a valid AWS Lambda runtime for Node.js.
- Must be Node.js version 16 or newer. This condition makes it so that if your site build is using an older version, your functions runtime is not unexpectedly downgraded from the old static default of Node.js 16.
If the build uses a version of Node.js that does not meet these conditions, then the functions runtime uses a fallback default version of Node.js 18.
You can override the default to any valid AWS Lambda runtime for Node.js by completing the following steps.
In the Netlify UI, set the environment variable AWS_LAMBDA_JS_RUNTIME
to the desired version. For example, to use Node.js 16 for all future functions deployed, set the variable value to nodejs16.x
.
Redeploy your site to apply the new runtime version.
Note that this environment variable must be set using the Netlify UI, CLI, or API, and not with a Netlify configuration file (netlify.toml
).
Directory
Netlify will access the functions directory during every build, preparing and deploying each supported code file as a function. The default directory is YOUR_BASE_DIRECTORY/netlify/functions
. You can customize the directory using the Netlify UI or file-based configuration.
In the Netlify UI, go to Site settings > Functions and enter a path to the directory in your repository where you want to store your functions.

Alternatively, add the following to netlify.toml
for file-based configuration.
Settings in netlify.toml
override settings in the Netlify UI.
For both methods, the path is relative to the site’s base directory in your repository. To help keep your site secure, make sure your functions directory is outside of your publish directory so that your source files aren’t deployed as part of your site.
Bundle
To optimize bundling time and artifact size, you can have Netlify use esbuild for bundling your JavaScript functions. Enable this opt-in beta feature in netlify.toml
.
For granular control over which files are bundled in your executable function artifacts, use the netlify.toml
properties external_node_modules
and included_files
. Visit the file-based configuration doc for details.
Node.js version for runtime
For all Node.js functions deployed on or after May 15, 2023, the default functions runtime is based on the Node.js version used for the build. The Node.js version used for the build must meet the following conditions to be inherited by the functions runtime:
- Must be a valid AWS Lambda runtime for Node.js.
- Must be Node.js version 16 or newer. This condition makes it so that if your site build is using an older version, your functions runtime is not unexpectedly downgraded from the old static default of Node.js 16.
If the build uses a version of Node.js that does not meet these conditions, then the functions runtime uses a fallback default version of Node.js 18.
You can override the default to any valid AWS Lambda runtime for Node.js by completing the following steps.
In the Netlify UI, set the environment variable AWS_LAMBDA_JS_RUNTIME
to the desired version. For example, to use Node.js 16 for all future functions deployed, set the variable value to nodejs16.x
.
Redeploy your site to apply the new runtime version.
Note that this environment variable must be set using the Netlify UI, CLI, or API, and not with a Netlify configuration file (netlify.toml
).
Directory
Netlify will access the functions directory during every build, preparing and deploying each supported code file as a function. The default directory is YOUR_BASE_DIRECTORY/netlify/functions
. You can customize the directory using the Netlify UI or file-based configuration.
In the Netlify UI, go to Site settings > Functions and enter a path to the directory in your repository where you want to store your functions.

Alternatively, add the following to netlify.toml
for file-based configuration.
Settings in netlify.toml
override settings in the Netlify UI.
For both methods, the path is relative to the site’s base directory in your repository. To help keep your site secure, make sure your functions directory is outside of your publish directory so that your source files aren’t deployed as part of your site.
Go version for builds
The Go version used in the deployment pipeline is determined by your site’s build image.
To modify the Go version used for your builds, change the build image for your site at Site settings > Build & deploy > Continuous Deployment > Build image selection.