Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Having issues deploying a simple react app to an e2-micro

I'm in the most initial stages of testing out a staging server and to keep it 'frugal' I wanted to start without expending $ at this stage, so I went on to create the free-tiered e2-micro instance (w/30GB storage), I've installed node.js and cloned an initial barely-touched react application.

I'm not able to run react-scripts (`npm run build`) it just hangs with "Starting the development server...", never transpiles and cannot exit that procedure with ctrl-c,  The only thing I made changes to in the app and that may be detrimental would be adding the Materials UI package (would like to hear your thoughts on this)

What am I doing wrong? How can I stay free and run react on this compute engine?

0 1 1,135
1 REPLY 1

As shown in the article Where should I run my stuff? Choosing a Google Cloud compute option in section What is your use case?:

  • Use App Engine if you want to deploy and host a web-based application (HTTP/s) in a serverless platform. Examples: web applications, mobile app backends

Therefore, as you want to run a React application, I suggest deploying your application in an App Engine Standard instance, which is the best for your use case.

As shown in this Stack Overflow answer

There are 28 free instance-hours per day for frontend instances only when you are using one of the standard environments or runtimes (Python, Java, PHP and Go).

To deploy your application on App Engine Standard, you could follow this guide along with the official documentation.

For your question “How can I stay free and run react on this compute engine?”, in these Stack Overflow questions “Google cloud compute engine always free tier” and “Does the E2-Micro come under the GCE Free Tier?”, some caveats on using an e2-micro instance and keeping it in the free tier are discussed as follows:

  • 1 non-preemptible e2-micro VM instance per month in one of the following US regions:
    • Oregon: us-west1
    • Iowa: us-central1
    • South Carolina: us-east1
  • 30 GB-months standard persistent disk
  • 5 GB-month snapshot storage in the following regions:
    • Oregon: us-west1
    • Iowa: us-central1
    • South Carolina: us-east1
    • Taiwan: asia-east1
    • Belgium: europe-west1
  • 1 GB network egress from North America to all region destinations (excluding China and Australia) per month

Your Free Tier e2-micro instance limit is by time, not by instance. Each month, eligible use of all of your e2-micro instances is free until you have used a number of hours equal to the total hours in the current month. Usage calculations are combined across the supported regions.

Compute Engine free tier does not charge for an external IP address.

GPUs and TPUs are not included in the Free Tier offer. You are always charged for GPUs and TPUs that you add to VM instances.

The machine type e2-micro is part of the free tier. When creating the instance, it shows an estimated cost just to show how much it would cost. This doesn't mean you will be charged. The discount is applied once the VM instance is running, and it will be reflected on the billing reports.

You could also follow this guide to deploy a Node.js server using Google Cloud Compute Engine.