Deploying Cloud Functions

Building and Testing Locally

Cloud Functions execute in a managed Node.js runtime environment so you can build and test your functions locally just using a standard Node.js runtime along with your favorite development tools.

To make testing and debugging easy, you can also use a local emulator to run and debug your functions locally.


You can deploy Cloud Functions from your local machine (via a Google Cloud Storage bucket) or from your GitHub or Bitbucket source repository (via Cloud Source Repositories). For details, see:

When deploying, Cloud Functions will look for a file named index.js or function.js. If you've provided a package.json file that contains a "main" entry, then Cloud Functions will look for the specified file instead.

Note: The first time you deploy a function it may take several minutes as we need to provision the underlying infrastructure to support your functions. Subsequent deployments will be much faster.

Deploy using the console

If you prefer to use the GCP Console UI, you can also create and deploy functions from the Cloud Functions page in the GCP Console.

Deploy using the gcloud command-line tool

For the complete reference for the gcloud beta deploy command-line tool, see gcloud beta functions deploy.

Next steps

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Functions Documentation