LogoLogo
Getting StartedDevelopersDeployment GuideGet Help
  • Quick Links
  • Welcome to Form.io
    • Getting Started With Form.io
    • Launch a Form
    • Overview of Form.io
  • Developer Tool Ecosystem
    • PDF Solution
    • Enterprise Form Builder
    • Form View Pro
    • The Security Module
    • Accessibility Compliance Module
    • Developer License
    • SQL Connector - Deprecated
    • Integration Libraries
    • Form.io CLI Tool
  • User Guide
    • Introduction
    • Form.io Developer Portal
    • Teams
    • Projects
      • Project UI
      • Project Settings
      • Stages
      • Multi-Tenancy
    • Resources
      • ResourceJS
    • Forms
      • Form Creation
      • Form Types
      • PDF Forms
      • Embedding a Form
      • Form Revisions
      • Form Settings
    • Form Building
      • Form Builder UI
      • Form Components
        • Component Settings
        • Basic Components
          • Resource as Select Component Data Source
        • Advanced Components
        • Layout Components
        • Data Components
        • Premium Components
          • Nested Forms
        • Custom Components
      • Logic & Conditions
      • Existing Resource Fields
      • Actions
    • Submissions
      • Accessing Submissions
      • Importing Submissions
    • Form.io eSignature - Coming Soon
    • Form.io Reporting Module
    • PDF Template Designer
    • Form View Pro
    • Form Manager
    • Enterprise Form Builder Module
  • Developer Guide
    • Introduction
      • Application Development
      • API Documentation
    • Form Development
      • Form Renderer
      • Form Builder
      • Form Embedding
      • Form Evaluations
      • Form Templates
      • Custom Components
      • Translations
    • JavaScript Development
      • JavaScript SDK
      • JavaScript Frameworks
      • JavaScript Utilities
    • Authentication and Authorization
      • SAML
      • OAuth
      • LDAP
      • Resource Based Authentication
      • Email Authentication
      • Two-Factor Authentication
    • Roles and Permissions
      • Field Match-Based Access
      • Field-Based Resource Access
      • Group Permissions
    • Integrations
      • Email Integrations
      • File Storage
      • Google Developer Console
      • eSign Integrations
      • Relational Databases
    • Modules
    • Fetch Plugin API
    • CSS Frameworks
    • Offline Mode
    • Audit Logging
  • Deployments
    • Self-Hosted Deployment
      • Local Deployment
        • Local File Storage
      • Kubernetes
      • Cloud Deployment
        • AWS Deployment
          • AWS Lambda
          • Form.io/AWS Elastic Beanstalk End-To-End Encrypted Deployment
        • Azure Deployment
          • Azure App Service
            • Azure MSSQL Connector - Deprecated
          • Azure Virtual Machine
          • Azure Kubernetes Service
          • Set up the DB
        • GCP Deployment
          • GCP Cloud Run
      • On-Premise Deployment
      • Enterprise Server
      • PDF Server
    • Deployment Configurations
      • DNS Configuration
      • Load Balancer Configuration
    • Licenses
      • License Management
      • Library Licenses
    • Portal Base Project
      • Portal SSO
      • Portal Translations
    • Maintenance and Migration
      • Changes to Premium Libraries
  • FAQ
    • FAQ
    • Tutorials & Workflows
      • Password Reset
      • Dynamic Select Filtering
      • Approval Workflow
      • SSO Email Token
      • Embedding A Video
      • Data Source Validation
      • Select Data Source Options
      • Nested Form Workflows
        • Nested Wizard Forms
      • Save as Draft
      • Role-Based Conditions
      • Custom Component
      • Dynamic Radio and Select Box Values
      • Override CKEDITOR
    • Errors
    • Examples
    • License Utilization Checks
  • Contact Us
Powered by GitBook
On this page
  • GCP Project
  • MongoDB Atlas
  • Creating a MongoDB Atlas Project
  • Create a Cluster
  • Connect to FormioCluster
  • Create Database
  • Google Cloud File Storage
  • GCP Cloud Run
  • Enterprise Server Deployment
  • PDF Server Deployment
  • Access Deployment

Was this helpful?

  1. Deployments
  2. Self-Hosted Deployment
  3. Cloud Deployment
  4. GCP Deployment

GCP Cloud Run

This tutorial will walks through the steps to create an example Form.io deployment environment on GCP Cloud Run. This tutorial assumes prior knowledge of Form.io and GCP Cloud Run.

PreviousGCP DeploymentNextOn-Premise Deployment

Last updated 2 months ago

Was this helpful?

GCP Project

GCP projects serve as a "container" to organize and manage GCP services and applications.

  1. Navigate to the .

  2. Log in or Create an account.

  3. Click the Project dropdown and select Create New Project.

  1. Input a Project name for your project.

  2. Select (or create) an Organization.

  3. Click the Create button.

MongoDB Atlas

Creating a MongoDB Atlas Project

  1. Within the GCP Project, search and select MongoDB Atlas.

  1. Click the Manage On Provider button, which will open cloud.mongodb.com in a new tab.

  1. Log in or create a MongoDB account.

  2. Select MongoDB Atlas from the Cloud Service options. If there is no organization, a new organization should be created.

  3. Give the Organization a name and select a Cloud Service.

  4. Add Members to the organization and click the Create Organization button.

  1. Within the Organization, click the New Project button.

  1. Select MongoDB Atlas from the Cloud Service options.

  2. Give the MongoDB Project a Name.

  3. Add any additional users to MongoDB Project through Add members.

  4. Click the Create Project button.

Create a Cluster

A MongoDB Atlas cluster is a collection of MongoDB servers that work together to store and manage Form.io data.

  1. Click the +Create cluster button within the MongoDB Overview page.

  1. Select the desired Cluster Template. For this example, the M0 option will be selected.

  2. Give the Cluster a name.

  3. Select Google Cloud as the Provider.

  4. Click the Create Deployment button.

Connect to FormioCluster

Complete the following steps to connect the cluster to all required IP addresses and configure the database users.

Set up connection security

  1. By default, the current IP address should be added. Click the Network Access button to add any additional IP addresses. This example is set to allow any IP address to connect to the database E.g. 0.0.0.0

  1. Set the Username and Password for any users that will have access to the project.

  2. Click Create Database User.

  3. Click the Choose a connection method button.

Choose a connection method

  1. Select Drivers as the connection option.

  1. Ensure Node.js is selected for the Driver option.

  2. Copy the connection string. This string will be used later as an environment variable within GCP.

The MongoDB Cluster may take some time to build before a Connection String can be copied.

  1. Click Done to finalize the database.

Create Database

Create a database to connect to the cluster by completing the following steps:

  1. Navigate to the Cluster tab.

  2. Click the Browse Collections for the cluster.

  1. Click Add My Own Data button to create database.

  2. Set a Database Name, Collection Name, then click Create.

Take note of the Database Name. It will be required in the connection string for GCP deployments. MongoDB Atlas will create a database by default called testif a Database is not created manually.

Google Cloud File Storage

Create a Google File Storage bucket to store file uploads and PDFs:

  1. Select the GCP Project.

  2. Search and select Cloud Storage within the search bar.

  1. Click +Create to create a bucket.

  1. Set a name for the Bucket

  2. Click the Create button

  1. Check the Enforce public access setting.

  2. Click Confirm.

  1. Within the bucket settings, click the Settings button on the left-hand side bar.

  2. Select the Interoperability tab.

  1. Scroll down to the Access keys for your user account section and click Create a Key.

  2. Record the Access key and Secret somewhere safe. They will be needed later.

GCP Cloud Run

Set up a GCP Cloud Run to deploy and run the containerized Form.io application in a serverless environment.

  1. Select your GCP Project.

  2. Search and select Cloud Run within the search bar.

You may need to enable the Cloud Run Admin API. If so, click Enable.

  1. Ensure Cloud Run is enabled.

Enterprise Server Deployment

  1. Within GCP Cloud Run, click the Create Service button. This will display the service configuration screen.

  1. Enter the formio-enterprise.io Docker container image URL within the Container image URL setting field: docker.io/formio/formio-enterprise:9.3.0

  1. Set a Service Name.

  2. Set the Authentication method.

  1. Set the Service Autoscaling number, the minimum recommendation is 1.

  1. Open the Container(s), Volumes, Networking, Security tab.

  2. Set the Container Port to 3000.

  1. Within the Container(s), Volumes, Networking, Security settings, click the Variables and Secrets tab.

  2. Click the +Add Variable button.

  1. Enter the following environment variables:

MONGO

The MongoDB connection string to connect to your remote database. This is the value we copied in the cluster deployment step. Ensure the correct MongoDB username, password, and database name is included in the string.

mongodb+srv://mongouser:mypassword@formiocluster.apgbu.mongodb.net/formio?retryWrites=true&w=majority&appName=FormioCluster

LICENSE_KEY

<—YOUR LICENSE—>

DEBUG

Application Logging Settings.

*.*

PORTAL_ENABLED

Used to enable the Self-Hosted Portal.

1

ADMIN_EMAIL

An admin account you would like to use as the first Admin user authenticating into the deployed environment.

admin@example.com

ADMIN_PASS

A password for the first Admin user.

CHANGEME

DB_SECRET

A secure secret that you will pick that is used to encrypt the project settings.

CHANGEME

JWT_SECRET

A secure secret that you will pick that is used to establish secure JWT tokens.

CHANGEME

PDF_SERVER

The endpoint of the GCP PDF Server deployment (created in the next section).

https://pdf-server-1234.us-central1.run.app

Add the PDF_SERVER variable after completing the PDF deployment in GCP in the following section.

  1. Scroll down and set the Maximum number of instances. For this example, the instance number will be set to 3.

  1. Click the Create button. The screen should proceed to a progress screen showing the service being deployed. Once completed, the service will be deployed and will show a green checkmark.

PDF Server Deployment

  1. Within GCP Cloud Run, click +Deploy Service, and select Service. This will display the service configuration screen.

  2. Enter the Form.io pdf-server Docker container image URL in the URL settings field: docker.io/formio/pdf-server:5.6.0

  3. Input a Service Name.

  4. Set the Authentication method.

  1. Set the Service Autoscaling number. The minimum suggested setting is 1.

  1. Open the Container(s), Volumes, Networking, Security tab.

  2. Set the Container Port.

  1. Within the Container(s), Volumes, Networking, Security settings, click the Variables and Secrets tab.

  2. Click the +Add Variable button

  1. Enter the following Environment Variables:

    • The application sets the FORMIO_S3_PORT variable to 9000 by default. In this example, where FORMIO_S3_SERVER is set to https://storage.googleapis.com, the FORMIO_S3_PORT environment variable should be left empty

Setting
Description
Example

MONGO

The MongoDB connection string to connect to your remote database. This is the value we copied before.

mongodb+srv://user:mypassword@formiocluster.apgbu.mongodb.net/formio?retryWrites=true&w=majority&appName=FormioCluster

LICENSE_KEY

The license key for your deployment. You will get this when you upgrade a project to Enterprise.

<—YOUR LICENSE—>

DEBUG

*.*

FORMIO_S3_SERVER

Storage URI of the File Storage bucket.

https://storage.googleapis.com

FORMIO_S3_BUCKET

Name of the Google bucket.

mybucket-name

FORMIO_S3_KEY

The Access Key of the Google Cloud storage bucket, found within the Interoperability tab.

ABCD1234

FORMIO_S3_SECRET

The Secret of the Google Cloud storage bucket, found within the Interoperability tab.

abc+123+def+L+ghiJKLmno

FORMIO_S3_REGION

Region of the bucket.

us-central1

FORMIO_S3_PORT

  1. Scroll down and set the Maximum number of instances. For this example, the instance number will be set to 3.

  1. Click the Create button.

The screen should navigate to a progress screen showing the service being deployed. Once completed, the service will be deployed and will show a green checkmark.

  1. Copy the PDF Server URL

  1. Within the GCP Cloud Run, add the following environment variable to the Enterprise API Deployment

Environment Variable
Description
Value

PDF_SERVER

The GCP PDF Server deployment endpoint

https://pdf-server-1234.us-central1.run.app

Access Deployment

The Cloud Run service provides a URL to access the Form.io deployment

  1. Select your Google Cloud Project

  2. Search and select Cloud Run within the search bar

  3. Click on the Form.io Enterprise Server service

  1. Click the URL link next to the service name

  1. Login using the username and password specified in the environment variables

  1. Create a Project.

Before a deployment can be created, a database is required to store the Form.io deployment data. is a NoSQL database solution that will be used in this example within the GCP project to store projects, forms, and submissions.

Navigate to the .

Navigate to the .

For this tutorial, the container tag being utilized is the formio-enterprise docker image tag 9.3.0. for a list of available formio-enterprise server version tags . For the latest version, replace the version number with latest docker.io/formio/formio-enterprise:latest

For the MONGO variable, copy and paste the connection string from the step. Update this string to include the database name of the MongoDB Cluster; in this example, the database name is formio. MongoDB Atlas will create a database by default called testif a Database was not created in the . Verify the database name by navigating to the MongoDB Cluster and viewing the Collections (see screenshot below)

The for your deployment. You will get this when you upgrade a project to Enterprise.

For this example, the container tag being utilized is the pdf-server docker image tag 5.6.0. for a list of available pdf-server version tags For the latest PDF version, replace with docker.io/formio/pdf-server:latest

For the MONGO variable, copy and paste the connection string from the step. Update this string to include the name of the MongoDB Atlas database used by the cluster; in this example, the database name is formio. MongoDB Atlas will create a database by default called testif a database was not created manually in the . Verify the database name by navigating to the MongoDB Cluster and viewing the Collections (see screenshot below)

For the FORMIO_S3 variables, enter the credentials from the

Under Billing select the Instance-based option (This is a puppeteer requirement. )

Navigate to the

For more information on next steps, visit the guide

MongoDB Atlas
GCP Console
GCP Console
Click Here
Click Here
Find out more here
GCP Console
Getting Started
database configuration
previous steps
database configuration
previous steps
Google Storage Step
GCP Console
license key