<?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"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://blog.giridharnasam.com</link><generator>RSS for Node</generator><lastBuildDate>Fri, 05 Jun 2026 20:56:48 GMT</lastBuildDate><atom:link href="https://blog.giridharnasam.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Deploying Your Frontend with AWS S3 and CloudFront: A Step-by-Step Guide.]]></title><description><![CDATA[Developing an aesthetically pleasing frontend that attracts a significant number of users is the initial step in the development process. Equally important is ensuring that it is accessible, allowing users to enjoy the application fully.
There are ma...]]></description><link>https://blog.giridharnasam.com/deploying-your-frontend-with-aws-s3-and-cloudfront-a-step-by-step-guide</link><guid isPermaLink="true">https://blog.giridharnasam.com/deploying-your-frontend-with-aws-s3-and-cloudfront-a-step-by-step-guide</guid><category><![CDATA[deployment]]></category><category><![CDATA[React]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[software development]]></category><category><![CDATA[AWS]]></category><dc:creator><![CDATA[Giridhar Nasam]]></dc:creator><pubDate>Sun, 08 Dec 2024 11:39:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1733657532855/8a1511b9-d0e4-4b94-bcb4-35bbb772c099.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Developing an aesthetically pleasing frontend that attracts a significant number of users is the initial step in the development process. Equally important is ensuring that it is accessible, allowing users to enjoy the application fully.</p>
<p>There are many platforms available for deploying applications, such as AWS, Azure, and GCP. Each platform comes with its own set of advantages, disadvantages, and learning curve. For this blog post, I'll focus on AWS.</p>
<p>In particular, I'll be demonstrating how to deploy a React application using AWS S3 (Simple Storage Service) and AWS CloudFront.</p>
<p>If you would like to follow along with this blog, ensure that you build your React project and keep it handy. If you are not familiar with creating a build for React, simply use the commands below in your React project.</p>
<pre><code class="lang-bash">npm run build
<span class="hljs-comment"># or</span>
yarn build
<span class="hljs-comment"># or</span>
pnpm build
</code></pre>
<p>If you don't have a React project, don't worry—I've got you covered. You can pull the repository I'm demonstrating in this blog.</p>
<pre><code class="lang-bash"><span class="hljs-comment">#clone the repo</span>
git <span class="hljs-built_in">clone</span> https://github.com/giripatel/deployment-frontend.git
<span class="hljs-comment">#point your terminal</span>
<span class="hljs-built_in">cd</span> deployment-frontend
</code></pre>
<p>Before diving into the process, let's first understand what <strong>Object Storage</strong> and <strong>CDN</strong> are.</p>
<h3 id="heading-object-storage">Object Storage</h3>
<p>An <strong>Object Storage</strong> is a type of data storage architecture designed to manage and store data as objects, rather than as files in a hierarchical file system or as blocks in a block storage system. Object storage is often used in cloud computing environments and is particularly suited for storing large amounts of unstructured data, such as images, videos, documents, backups, and log files.</p>
<h3 id="heading-cdn-content-delivery-network">CDN (Content Delivery Network)</h3>
<p>A content delivery network (CDN) is <strong>a geographically distributed group of servers that caches content close to end users</strong>. A CDN allows for the quick transfer of assets needed for loading Internet content, including HTML pages, JavaScript files, stylesheets, images, and videos.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Each step includes a screenshot, which may make the blog appear longer and more image-heavy.</div>
</div>

<h2 id="heading-deployment-process">Deployment Process</h2>
<ol>
<li><p>Object Store Setup</p>
</li>
<li><p>CDN Configuration</p>
</li>
</ol>
<h3 id="heading-object-store-setup">Object Store Setup</h3>
<ol>
<li><p>Log in to your AWS account.</p>
</li>
<li><p>Search for 'S3' in the search box and select it from the results.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727009451026/a228be7d-60e7-418c-ac76-b2d031d94f3a.png" alt class="image--center mx-auto" /></p>
<p> Click on ‘Create bucket’.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727009600720/24fde38f-e2b7-4c9e-810e-18eda1d27ba0.png" alt class="image--center mx-auto" /></p>
<p> Select 'General Purpose' and provide a name for the bucket.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727009812040/b462285c-9130-4516-9a21-e251af9bbd61.png" alt class="image--center mx-auto" /></p>
<p> Scroll to the bottom and click ‘Create Bucket’.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727009887081/6788c55e-7934-4aef-8b9a-ea441c4ac696.png" alt class="image--center mx-auto" /></p>
<p> Choose the zone closest to you to ensure low latency.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727010295706/edb94c57-649d-4f32-85f6-4d7ea429af48.png" alt class="image--center mx-auto" /></p>
<p> Select the newly created bucket to proceed with further configurations.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727010684772/5a758e05-49ac-4728-b1a5-38e9e22c41b7.png" alt class="image--center mx-auto" /></p>
<p> You will be redirected to the Upload page. Make sure to have your build folder ready.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727011947435/6837c14b-943c-49f4-9028-b23257a3d780.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Drag and drop the build you created earlier in the blog. Alternatively, you can push the build to S3 programmatically. AWS provides an S3 package that simplifies this process.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727010748093/a3dd4628-d5a1-45c2-817b-d60eb6b4c740.png" alt class="image--center mx-auto" /></p>
<p>Scroll to the bottom of the page and click Upload.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733655457103/982908ca-85d9-4ece-8bad-6fa738d0e850.png" alt class="image--right mx-auto mr-0" /></p>
</li>
</ol>
<h3 id="heading-cloudfront-setup">CloudFront Setup</h3>
<ol>
<li><p>Type 'CloudFront' in the search box and select the highlighted option shown in the screenshot.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727010865331/bff96955-b9d0-4843-b40f-f3d562183bb4.png" alt class="image--center mx-auto" /></p>
<p> Click on ‘Create a CloudFront distribution’.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727010945822/558bdecb-921b-4bb2-8cb6-867718ffd0ce.png" alt class="image--center mx-auto" /></p>
<p> Select the recently created S3 bucket in the 'Origin Domain' field.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727011027449/597f5344-3a94-4842-9a48-55e342f2658a.png" alt class="image--center mx-auto" /></p>
<p> Choose 'Origin Access Control Settings,' then click on 'Create New OAC.'</p>
<h3 id="heading-what-is-oac">What is OAC?</h3>
<p> Origin Access Control (OAC) is a feature in CloudFront that allows you to restrict direct access to content stored in your origin, such as an Amazon S3 bucket or a web server. This ensures that users can only access the content through the CDN distribution, preventing direct access via the origin URL.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727011179654/dc2be1ba-22a9-4e12-b01a-4c718784a0eb.png" alt class="image--center mx-auto" /></p>
<p> Select the S3 bucket you created earlier, if it is not already selected. Choose 'Sign Requests' and click 'Create'.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727011236222/8f0e1891-b0d0-40d8-aff3-4b36f3c80975.png" alt class="image--center mx-auto" /></p>
<p> Scroll down a bit and choose ‘Enable security protections’.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727011338241/88bc9422-b2aa-4704-8e17-39fd8d0d7eea.png" alt class="image--center mx-auto" /></p>
<p> Type 'index.html' in the 'Default Root Object' field. This file will be returned to users who visit the website at the '/' path.</p>
</li>
<li><p>Click on “Create distribution” to complete the creation of CloudFront.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727011535801/1cf8c191-0866-4977-8e54-59ee22ddc868.png" alt class="image--center mx-auto" /></p>
<p> Click on 'Copy Policy' in the third popup. This will copy a policy to be used for S3 bucket permissions. Make sure to keep it safe and easily accessible.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733640195112/b6253427-7240-4305-b89e-1b6eef13169f.png" alt class="image--right mx-auto mr-0" /></p>
</li>
<li><p>The CloudFront distribution has been successfully created. The 'Distribution Domain Name' is the URL used to access the website you have created.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733643075359/77788fcf-1c41-42ea-aff0-31e8ac3e67f5.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>If you attempt to access the website, the browser will respond as shown below.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733642105659/9b72c25a-4b54-41c0-abf0-ffcb429b0b30.png" alt class="image--center mx-auto" /></p>
<p>To resolve this, open the S3 bucket configuration mentioned in the above “Object Store Setup” (Step 7) and select 'Permissions.'</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727012488211/3255420a-e3fc-4e08-8bcf-3dceb69e14e4.png" alt class="image--center mx-auto" /></p>
<p>Click on 'Edit.' This will open a text area where you can paste the policy copied in the previous step.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733640573912/ec09055a-c3b7-401f-adc7-91483bbd46f1.png" alt class="image--center mx-auto" /></p>
<p>Paste the Policy in the text area and click ‘Save’.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733640440217/b4b26551-7b62-4a07-b236-a8b6b80d4866.png" alt class="image--center mx-auto" /></p>
<p>Try to access the same URL that we tried before, You should now be able to access the webpage.</p>
<p>Congratulations 🎉 we are almost there.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727012395946/973ba30b-69cd-45ec-a940-0ddc29e550a4.png" alt class="image--center mx-auto" /></p>
<p>Now, try accessing another page of your application.</p>
<p>If you are following the same React project used in this blog post, navigate to <code>&lt;Your URL&gt;/info</code> in your browser.</p>
<p>If you encounter the same error as shown below, we'll need to make some changes to the CloudFront configurations.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733642552888/973528b4-6522-4d9d-862b-ea670ca9e185.png" alt class="image--center mx-auto" /></p>
<p>Open the CloudFront distribution and click on ‘Error pages’.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733642941334/75c85293-ee10-4293-b04e-0372c9d7c8c1.png" alt class="image--center mx-auto" /></p>
<p>Select the HTTP error code as ‘403: Forbidden’ and choose the ‘Customize error response’ as ‘Yes’.</p>
<p>In the ‘Response page path’ type ‘/index.html’ and the response code as ‘200 OK’.</p>
<p>The reason for the error is that CloudFront is attempting to locate the <strong>'/info'</strong> file in S3, which does not exist.</p>
<p>To make sure all requests are routed to ‘index.html’ we have to configure it in ‘Error pages’.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727011824541/57f81871-83e4-4791-8f7f-f16cc8b6c821.png" alt class="image--center mx-auto" /></p>
<p>If you try accessing the route or page (in my case, <strong>'/info'</strong>) in the URL, you'll see the response below. This confirms that we are successfully redirecting all requests to <strong>'/index.html'</strong>.</p>
</li>
</ol>
<ul>
<li><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733642447068/20b2fed9-9966-449e-9c82-ed0eaffa8539.png" alt class="image--center mx-auto" /></li>
</ul>
<p><img src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExbmpzbXRienlocHZsNGp5MDk1NHJhemo2Mzg2cXk0bmQ1ZG5zOTAxOSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/4HBrbkrFh7Lla1JFwF/giphy.gif" alt class="image--center mx-auto" /></p>
<p><strong>What more can you do?</strong></p>
<ul>
<li>Add a custom domain.</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Why Deployment Matters: Understanding the Nuances and How to Take Your Code Live]]></title><description><![CDATA[Why Deployment?
Have you ever thought about building an application and making it available to everyone on the internet?
First, you pick a programming language whether it’s JavaScript, Java, Rust, or Python, whatever gets the job done. You’ll likely ...]]></description><link>https://blog.giridharnasam.com/why-deployment-matters-understanding-the-nuances-and-how-to-take-your-code-live</link><guid isPermaLink="true">https://blog.giridharnasam.com/why-deployment-matters-understanding-the-nuances-and-how-to-take-your-code-live</guid><category><![CDATA[deployment]]></category><category><![CDATA[General Programming]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[software development]]></category><dc:creator><![CDATA[Giridhar Nasam]]></dc:creator><pubDate>Thu, 19 Sep 2024 17:33:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1726683897146/f7433111-183d-4a88-b862-0e7da5334103.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-why-deployment">Why Deployment?</h3>
<p>Have you ever thought about building an application and making it available to everyone on the internet?</p>
<p>First, you pick a programming language whether it’s JavaScript, Java, Rust, or Python, whatever gets the job done. You’ll likely start by building your backend, maybe with Node.js for JavaScript or Spring Boot if you’re into Java.</p>
<p>Next comes the frontend. You might create using raw HTML, CSS and JavaScript else dive into React or Angular (I’d personally go with React 😌). Why not Angular? Well, that’s a whole debate for another blog post!</p>
<p>So, now you’ve built a beautiful frontend and a powerful backend. But what's next?</p>
<p>You need to make it accessible to everyone online. That’s where deployment comes in—it’s the process of making your application available on the internet so others can interact with it.</p>
<h3 id="heading-deployment-process"><strong>Deployment Process</strong></h3>
<p>The deployment process is generally divided into two categories (let's ignore server-side rendering (SSR) for now):</p>
<ol>
<li><p>Backend Deployment</p>
</li>
<li><p>Frontend Deployment</p>
</li>
</ol>
<p>You might wonder, <em>why there isn’t the same process for both.</em></p>
<p>Let’s explore this with an example: <strong>LinkedIn</strong>.</p>
<p>When you visit LinkedIn, the website’s frontend looks the same for everyone. But the content like connections and posts varies from user to user. My connections and posts are different from yours, right?</p>
<p>So, while we can cache static frontend pages to serve everyone quickly, the backend needs to handle dynamic content hence it gives unique responses to each user. This means caching the backend isn’t always practical because the data (like posts or connections) changes frequently based on who's logged in.</p>
<p>Frontend</p>
<p>Given these differences, we deploy the frontend and backend in different ways:</p>
<ul>
<li><p><strong>Frontend Deployment:</strong> For the frontend, we use object stores and Content Delivery Networks (CDNs) to serve static content efficiently.</p>
<p>  <img src="https://imagekit.io/blog/content/images/2020/06/CDN_server_user.png" alt /></p>
</li>
<li><p><strong>Backend Deployment:</strong> For the backend, we typically use Virtual Machines (VMs) to handle requests and deliver unique responses for each user.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726761872930/c5400140-01f8-4096-8db2-bd73e9eccba5.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
<h3 id="heading-conclusion">Conclusion</h3>
<p>Now that you understand the differences between Frontend and Backend deployment, it's time to dive deeper into deployment specifics. If you are ready to explore a step-by-step guide for backend deployment, check out the below post where we cover everything from setting up your environment to handling real-time requests.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://blog.giridharnasam.com/backend-deployment-with-ec2?showSharer=true#heading-code-deployment">https://blog.giridharnasam.com/backend-deployment-with-ec2?showSharer=true#heading-code-deployment</a></div>
]]></content:encoded></item><item><title><![CDATA[Backend Deployment: A Guide to Using AWS EC2 for Node.js Projects]]></title><description><![CDATA[Deploying the backend is a crucial part of an application to expose the APIs and Sockets onto the internet.
There are many platforms available for deploying applications, such as AWS, Azure, GCP, and Vultr. Each platform comes with its own set of adv...]]></description><link>https://blog.giridharnasam.com/backend-deployment-with-ec2</link><guid isPermaLink="true">https://blog.giridharnasam.com/backend-deployment-with-ec2</guid><category><![CDATA[deployment]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Giridhar Nasam]]></dc:creator><pubDate>Thu, 19 Sep 2024 17:19:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1726687381881/ab83f302-7eb7-42c7-a602-aa65e324b9e5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Deploying the backend is a crucial part of an application to expose the APIs and Sockets onto the internet.</p>
<p>There are many platforms available for deploying applications, such as AWS, Azure, GCP, and Vultr. Each platform comes with its own set of advantages, disadvantages, and learning curve. For this blog post, I'll focus on AWS.</p>
<p>In particular, I'll be demonstrating how to deploy a Node.js project using AWS EC2, which is a type of Virtual Machine (VM) provided by AWS. The project is hosted on GitHub, and if you’d like to follow along with the deployment process, please proceed with the steps below. Otherwise, feel free to explore the blog post for general insights on backend deployment.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Each step includes a screenshot, which may make the blog appear longer and more image-heavy.</div>
</div>

<h2 id="heading-deployment-process">Deployment Process</h2>
<p>The deployment process is divided into 2 parts</p>
<ol>
<li><p>Server setup</p>
</li>
<li><p>Code Deployment</p>
</li>
</ol>
<h3 id="heading-server-setup">Server Setup</h3>
<ol>
<li><p>Login to your AWS account.</p>
</li>
<li><p>Search for EC2 in the search box and select EC2 (Elastic Cloud Compute).</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726586267461/3096ee25-9bf3-4723-9468-97555e0816bf.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Click on “Launch Instance”.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726586447090/6a54641d-ebf3-468f-bcd6-0136952832e6.png" alt class="image--right mx-auto mr-0" /></p>
<p> Choose a name for your instance. It can be anything, but make sure it's something you can easily identify if you have multiple instances.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726586604546/60892bc8-9be6-4334-a3bf-dac52e22c4c5.png" alt class="image--center mx-auto" /></p>
<p> Select “Ubuntu” as the operating system.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726586658638/5fff4329-8ccb-4c2b-a9af-bf00c98e79c5.png" alt class="image--center mx-auto" /></p>
<p> Choose the instance size based on your requirements. For this demo, I will use the 't2.micro' instance.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726586684420/b16b6bf3-ee22-4b2c-8f38-5b253639a6c3.png" alt class="image--center mx-auto" /></p>
<p> Click on “Create new key pair”.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726586713026/66f4112a-233c-4d8f-abde-caad1ced19cd.png" alt class="image--center mx-auto" /></p>
<p> Create a key pair with a name of your choice. Clicking 'Create Key Pair' will generate a key value pair and download it to your device. Ensure you store the private key securely, as it will be required to access the instance you're about to create.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726587150847/790a46a4-38f6-42a8-a322-6109e02dfa8d.png" alt class="image--center mx-auto" /></p>
<p> Allow SHH, HTTPS, and HTTP traffic, from anywhere(0.0.0.0/0). Clicking on Launch instance will create an Instance. <strong>Keep the IP address of the server handy</strong>.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726586892232/d53c3204-94b6-465f-91c7-1a8c31d450be.png" alt class="image--center mx-auto" /></p>
<p>With these steps, we've successfully created the server. Before deploying, we'll need to configure additional settings to access our API after deployment.</p>
</li>
<li><p>If you can't find the highlighted launch wizard, simply click on the instance you just created and then select 'Launch Wizard'.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726586938581/ba4bb2ec-0029-4f37-9a03-450f05ae6bbd.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>To allow traffic to access our application on port 3000 from any location, modify the inbound rules by adding the highlighted rule and then click 'Add Rule'.</p>
<p>Why port 3000?<br />In this example, the application is configured to listen for incoming requests on port 3000, which is commonly used for web applications, particularly in development environments.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726587012980/58ef9d91-f83f-4d0f-aaa0-0b0926a5d5c7.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<blockquote>
<p>We've successfully completed the server setup! Now, let’s dive into deploying the code.</p>
</blockquote>
<h3 id="heading-code-deployment">Code Deployment</h3>
<ol>
<li><p>Open your terminal and navigate to the directory where your <code>&lt;file name&gt;.pem</code> file (key) is stored. Then, use the following commands to SSH into the server we created.</p>
<pre><code class="lang-bash"> chmod 700 &lt;file name&gt;.pem <span class="hljs-comment"># change the permissions</span>
 ssh -i &lt;file name&gt;.pem ubuntu@&lt;ip of the server&gt; <span class="hljs-comment"># replace with your server IP</span>
</code></pre>
<p> The SSH session might look something like this, though it varies depending on your OS.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726596519203/e4798749-383f-4e19-9ddb-360bdd051cf9.png" alt class="image--center mx-auto" /></p>
<p> The application we are using as an example is written in Node.js. To run this application, Node.js must be installed on the server. Use the following commands to install Node.js.</p>
<pre><code class="lang-bash"> curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash <span class="hljs-comment">#install nvm</span>
 <span class="hljs-built_in">source</span> ~/.bashrc <span class="hljs-comment">#reread bashrc</span>
 nvm install --lts <span class="hljs-comment">#install lts version of node js</span>
 node --version <span class="hljs-comment">#check node version</span>
</code></pre>
</li>
<li><p>Clone the example application repository. To run the application, install the necessary packages and start it using the following commands.</p>
<pre><code class="lang-bash"> git <span class="hljs-built_in">clone</span> https://github.com/giripatel/deployment-backend.git <span class="hljs-comment"># clone repo</span>
 <span class="hljs-built_in">cd</span> deployment-backend
 npm install <span class="hljs-comment"># install packages</span>
 node index.js
</code></pre>
</li>
<li><p>Use the server’s IP address and Port 3000, as the URL in your browser’s search bar or in Postman to access the API.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1726598002203/390e6b6f-4f10-4f2e-a5c9-28d2456a479f.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<p><img src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExNzFtbWFsOTB5ZjB2d2JiOHN6Z3dscTh1NWdneHR2eGF0OTBpdW1kMCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/slOhiKAVFgwr6/giphy.gif" alt class="image--center mx-auto" /></p>
<p><strong>What more can you do?</strong></p>
<ul>
<li><p>Add an SSL certificate to secure the site and remove the "Not secure" warning.</p>
</li>
<li><p>Configure DNS for the server's IP address to use a custom domain.</p>
</li>
<li><p>Set up a reverse proxy to eliminate the port number from the URL.</p>
</li>
</ul>
]]></content:encoded></item></channel></rss>