<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sriramajeyam S on Medium]]></title>
        <description><![CDATA[Stories by Sriramajeyam S on Medium]]></description>
        <link>https://medium.com/@yesoreyeram?source=rss-6bd993bd8c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*8MHYU4x_Q6IzT9Sv.jpg</url>
            <title>Stories by Sriramajeyam S on Medium</title>
            <link>https://medium.com/@yesoreyeram?source=rss-6bd993bd8c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 08:17:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yesoreyeram/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hosting ExpressJS website in Google Cloud Compute Engine]]></title>
            <link>https://medium.com/@yesoreyeram/hosting-expressjs-website-in-google-cloud-compute-engine-c09a3647d052?source=rss-6bd993bd8c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c09a3647d052</guid>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[google-cloud]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Sriramajeyam S]]></dc:creator>
            <pubDate>Sat, 17 Jun 2017 22:27:49 GMT</pubDate>
            <atom:updated>2017-06-17T22:30:40.527Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post, we are going to learn about running a nodejs application using ExpressJS and hosted in Google cloud compute engine.</p><h3>Google Cloud Account</h3><p>First thing we need to get a google cloud account. You can create a google cloud account for <a href="https://console.cloud.google.com/freetrial">free</a> and later if you want to upgrade, you can pay for it.</p><p><strong>Note:</strong> For google cloud compute engine, we will be using micro instance which is offered by google cloud always free tier. So don’t worry about the cost. If you need a production ready high end server, you can upgrade any time.</p><h3>Setting a Google Cloud Project and Virtual machine</h3><p>Once we have the google cloud account, we can start creating our project by navigating <a href="https://console.cloud.google.com/projectcreate">projects menu</a> in the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*9-SlTxNqRiLTEEeWfl2aHQ.png" /><figcaption>Google Cloud Project Creation</figcaption></figure><p>Once we create our project, Navigate to Compute Engine section which is used to manage our virtual servers. Then enable the compute engine API for your project if prompted. Then “Create Instance” of a compute engine</p><p>For our tutorial, we will be using the following setup</p><p><strong>Name </strong>: demo-server ( any name of your choice )</p><p><strong>Region </strong>: Any region in US</p><p><strong>Instance Type </strong>: micro instance with 10GB HDD</p><p><strong>OS </strong>: Ubuntu 16.04</p><p><strong>Scope </strong>: default Scope</p><p><strong>Firewall </strong>: Allow HTTP traffic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*J_paiAo1fDGi3cQulfAy-A.png" /></figure><p>Also in the network settings, you can create static external IP address for free. If you opt for ephemeral IP address, our IP address will keep changing when we restart our system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*n58mnebCS5JbO7T_PYShpQ.png" /></figure><p>Once the instance is created, Note <strong>down your external IP address</strong> which we use to navigate our website. Then we can login to the server using the ssh button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*W5liN4dXxwjj2jyLD5DtZw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*v2M_rk3pSXFg2jg51aNoMA.png" /></figure><p>Once we have logged into the system, we have to update the system by executing the following command.</p><blockquote>sudo apt-get update</blockquote><h3><strong>Setting up NodeJS ExpressJS</strong></h3><p>Now we are going to setup nodejs using the ubuntu apt package manager.</p><pre>curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -<br>sudo apt-get install -y nodejs</pre><p>More detailed installation steps available in <a href="https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions">NodeJS official site.</a> You can verify the installation using “node -v” and “npm -v” commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*SmZHNvY_zerd384FvAqRyg.png" /></figure><p>Next we can create our express application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*6MbHX5aZ4ka70lu3vDqmJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*kw-JqSvCyhqBAgs-eydOgg.png" /></figure><p>For demo, we are creating a very simple app which is listening on port 3000</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*mH7vdZhByw4eAxJSc2VNlw.png" /></figure><p>Now we can execute our program using the following command</p><blockquote>node index.js &amp;</blockquote><p><strong>Note:</strong> Note the &amp; command at the end. This will help us to run our node app in the background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*Ng2hZpOKkZ85p9V49HB6lw.png" /></figure><p>we can verify our app using the curl command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*K9i0ie64K23o6IxiHxZQeg.png" /></figure><p>Yeaa…. Our site is now working… WAIT.. still it is not publicly accessible. Lets do it.</p><h3><strong>Setting up firewall rules</strong></h3><p>Since we are running our app in port 3000, we need to open the firewall rule using google cloud console. Navigate to network section for cloud console and the <a href="https://console.cloud.google.com/networking/firewalls/add">firewall rules</a> section. Use the following settings to create your firewall rule</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*CEsIgh9m4DP4cPLBxPK4DA.png" /></figure><p>Once our firewall is open, then we can navigate our site using the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*hv5IWFO5P_uEVQUAZ9S6Kw.png" /></figure><p>Hoooray.. We have hosted our site in google cloud successfully. In another tutorial, we will see how to map this application against a domain name.</p><p>Happy Coding :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c09a3647d052" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>