We might want to quickly deploy our code to make sure it works or just want to have a server to play around with for free.
Certainly, you can!
As a student, I wanted to know and use services for free and forever. Thats the background of this post and the previous post (go check if you haven't read it)
But how do we get that?
Google Cloud provides us to use free tier compute engine.
Without further, let's go!
First time know about this, I certainly say "this is for me".
Go to GCP then signup/in.
If you are new, you can get $300 credit by use free trial (click on 'Get started for free' or here)
Go to Compute Engine
Enable Compute Engine API here if not enabled
Setup billing, need a credit card but dont worry you won't get charged.
Create VM, instance
Make sure you create in free tier locations (
us-east1) with machine type
standard persistent diskup to 30GB, as stated here.
Also, make sure allow HTTP and HTTPS.
Connect via SSH
Let's quickly try our new server by creating an express app.
Connect via SSH
Update package Linux
sudo apt update
sudo apt install nodejs
sudo apt install npm
Quick start create express app here
npm install -g [email protected]
express /tmp/foo && cd /tmp/foo
Before we start, we have to change port server
sudo pico bin/www
3000or go to line (CTRL + SHIFT + _) 15 and change into
Exit (CTRL + X).
sudo npm start
Navigate to Compute Engine and click external IP.
You'll find something like this:
P.S. This is for testing only, make sure to correct deploy your app.
Deploy project on the server and play around with.
NOTE: The server running for free, but Google might charge if you are over the free usage limit. Also, Google may change their terms for "forever" (read: Google Photos)
IMPORTANT: You may be charged because of Network Egress to China and Australia.
Any issue? Reach me at [email protected]