Deploying
Vonage Cloud Runtime allows you to quickly create a running instance on the platform by deploying. Deploying bundles your source code with a configuration file, which creates a package. The package is then uploaded to the platform and becomes a running instance. When you are using a workspace on Code Hub, you can use the terminal to deploy your code once you have finished making changes to a project.
Configuration File
The configuration files gives information to the platform on how to debug and deploy your application. Here is an example configuration file:
- The project name is the unique namespace for your project which can contain many instances.
- The instance name is a unique identifier for your instance.
regionis where the instance will run.entrypointgives the Vonage Cloud Runtime platform information on how to start your application.build-scriptallows you to specify a script to run while the platform builds your application.
You can learn more about the options available to you in the configuration file guide.
Injected Environment Variables
When you deploy your project to Cloud Runtime (or use vcr debug), the platform will inject some environment variables for you along with the environment object from your configuration file.
Application Port
To get your application running on Cloud Runtime correctly, you need to make sure that you are running your application on the correct port. The port differs when using the Cloud Runtime Debugger and when deployed. You can use the VCR_PORT enviroment variable that gets injected for you by Cloud Runtime to ensure you are always using the correct port. Here is an example using express.js:
If your web server requries you to specify a host, set the host to 0.0.0.0.
Health Check Route
The Vonage Cloud Runtime platform expects a route, /_/health, to be available on your application which is used to check the health of your deployed application. The route should not be behind any authentication. Your application will be restarted if this route does not return a 200 status. If the route is missing it will cause your deployment to fail.
Here is an example of the route using express.js:
You can use this as an opportunity to perform some checks of your own, and have the platform restart your application for you automatically if it gets into a bad state by returning a non 200 status within 30 seconds.
How to Deploy
You can deploy using the Vonage Cloud Runtime CLI. To deploy, run:
If you get a "credentials not found error", run vcr app generate-keys to regenerate your Vonage application's credentials for Vonage Cloud Runtime.
By default, the deploy command will look for a configuration file called vcr.yml in the current directory. To use a different configuration file you can run:
For example, to deploy your current code with a configuration file called prod.yml you would run:
Deploying with a GitHub Action
If you want to integrate deploying into your GitHub workflow you can add a GitHub Action to deploy for you. The main steps of the Action are to checkout your code, install the Cloud Runtime CLI, then run the deploy command. Here is an example workflow which assumes that you are using a build script to handle the custom aspects of your project:
You will need to replace VONAGE_API_KEY and VCR_REGION with your API Key and region you will like to deploy to. This workflow is run manually but you can edit it to run when PRs are closed and so on. You can learn more about GitHub Actions on the Actions Documentation.
Troubleshooting Deployment
You may get a "credentials not found" error if the Vonage Cloud Runtime platform does not have access to your Vonage application's credentials. You can generate a new private key pair using the CLI:
View your Deployment
To take a deeper look at your project and deployments you can use the Vonage Cloud Runtime dashboard.

Clicking on your deployed instance will give you access to logs, events, and deployment history. For example, the history tab will show you the deployment history for this instance:

If you deploy more than one instance for your project they will all show on the dashboard:

This is a project named vapi, which has two configuration files. One configuration file has an instance named dev and the other has an instance named prod. This allows you to have multiple instances running the same code but with different environments.
Remove an Instance
If you would like to remove a deployed instance you can use the Vonage Cloud Runtime CLI's instance remove command:
So, to remove the dev instance in the above screenshot you would run:
You can also remove an instance using the instance ID:
WARNING: This is an irreversible action! Attached state and schedulers will also be permanently deleted.
IP Address Allowlist
If you would like to restrict access to your systems, the Vonage Cloud Runtime IP addresses for each region are:
EU West - aws.euw1
- 52.215.68.46
- 46.137.9.43
- 54.72.25.154
US West - aws.use1
- 54.87.47.119
- 3.224.186.73
- 35.153.45.51
APAC Southeast - aws.apse1
- 13.251.207.33
- 52.76.50.31
- 54.169.132.8