<?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[Here’s how I run multiple backends 24x7 for free from my own machine.]]></title><description><![CDATA[Here’s how I run multiple backends 24x7 for free from my own machine.]]></description><link>https://rhythmdoshi.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>Here’s how I run multiple backends 24x7 for free from my own machine.</title><link>https://rhythmdoshi.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 14:39:58 GMT</lastBuildDate><atom:link href="https://rhythmdoshi.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Here’s how I run multiple backends 24x7 for free from my own machine.]]></title><description><![CDATA[As a backend or full stack developer, you might have come through the phase where you have no free hosting services, aws needs a credit card, railway is only free for 30 days, render puts your api’s t]]></description><link>https://rhythmdoshi.hashnode.dev/here-s-how-i-run-multiple-backends-24x7-for-free-from-my-own-machine</link><guid isPermaLink="true">https://rhythmdoshi.hashnode.dev/here-s-how-i-run-multiple-backends-24x7-for-free-from-my-own-machine</guid><category><![CDATA[technology]]></category><category><![CDATA[tech ]]></category><category><![CDATA[webhosting]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Bash]]></category><category><![CDATA[SEO]]></category><category><![CDATA[cloudflare]]></category><category><![CDATA[SelfHosting]]></category><dc:creator><![CDATA[Rhythm Doshi]]></dc:creator><pubDate>Sun, 29 Mar 2026 13:26:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/69c8d90a7816e434a0069509/92d41d2a-c01d-42b5-a413-263f911704ec.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As a backend or full stack developer, you might have come through the phase where you have no free hosting services, aws needs a credit card, railway is only free for 30 days, render puts your api’s to sleep, and what not.</p>
<p>As a student I was stuck as I could not buy subscriptions and there was no good platform to host my backend projects, free hosting platforms are convenient, but they come with limitations -<br />— backend goes to sleep<br />— limited trial usage<br />— credit card requirements<br />Then, I looked at my literally 12 year old PC, sitting in dust and it gave me a realization — Your backend doesn’t need Render, Railway, or even a credit card for AWS. All you need is an old PC/Laptop.</p>
<p>Now I run multiple backends 24/7 on a headless server, completely free, and yes, “secure”. Here’s how I did it.</p>
<h2><strong>In this blog, you’ll learn:</strong></h2>
<p>How to host your backend on your own PC/Laptop</p>
<ul>
<li><p>How to expose it publicly using Cloudflare Tunnel</p>
</li>
<li><p>How to keep it running 24/7</p>
</li>
<li><p>How to handle real issues like power cuts and network delays</p>
</li>
</ul>
<blockquote>
<p><em>Works for windows, linux and macOS as well.</em></p>
</blockquote>
<h2><strong>How This Works</strong></h2>
<p>Before getting into the implementation, let’s understand how this setup actually works.</p>
<p>My frontend is hosted on Vercel, just like a typical setup.</p>
<p>Instead of deploying my node.js backend to a cloud platform, I run it locally on my PC, securely. To make it accessible over the internet, I use Cloudflare Tunnel.</p>
<p>Cloudflare acts as a bridge between the public internet and my local machine, allowing secure access without needing port forwarding or a public IP.</p>
<p>The flow looks like this:</p>
<p>Frontend (Vercel)<br />↓<br />Cloudflare DNS<br />↓<br />Cloudflare Tunnel<br />↓<br />My PC/Laptop (localhost)<br />↓<br />Node.js backend (managed by PM2)</p>
<h2><strong>Setting This Up</strong></h2>
<p>Let’s get into how you can set this up yourself.</p>
<p>The idea is simple. Your backend will run locally on your PC/Laptop, and instead of exposing it using port forwarding, we’ll use Cloudflare Tunnel to make it securely accessible over the internet.</p>
<p>To make everything stable and always running even in case of power cuts or network errors, we’ll also use PM2 to manage our backend processes.</p>
<h2><strong>Step 1. Running your backend locally</strong></h2>
<p>First, make sure your backend is working properly on your local machine.</p>
<p>For example, if you’re using Express, your server should be accessible at:</p>
<p><a href="http://localhost:3000">http://localhost:3000</a></p>
<p>If it doesn’t work locally, it definitely won’t work when exposed publicly, so make sure everything is running fine at this stage.</p>
<h2><strong>Step 2. Keeping it alive using PM2</strong></h2>
<p>Now, instead of running your backend with node, we use PM2.</p>
<p>PM2 is a process manager that keeps your app running even if it crashes or the system restarts.</p>
<p>Start your app using:</p>
<pre><code class="language-shell">pm2 start app.js - name my-backend
# Once everything is running, save the process list:
pm2 save
</code></pre>
<p>This ensures your backend automatically restarts whenever your PC/Laptop reboots. Also, make sure to remove any passwords or set a script to auto log-in.</p>
<h2><strong>Step 3. Exposing it using a Cloudflare Tunnel</strong></h2>
<p>Now comes the most important part, making your local backend accessible over the internet.</p>
<p>Instead of opening ports or dealing with your router settings, we use Cloudflare Tunnel.</p>
<p>This allows you to securely expose your local server to a public domain.</p>
<p>Then, After installing cloudflared, log in to your Cloudflare account:</p>
<pre><code class="language-shell">cloudflared tunnel login
# Then create a tunnel:
cloudflared tunnel create home-server
</code></pre>
<h2><strong>Step 4. Configuring the Tunnel</strong></h2>
<p>Next, you need to create a configuration file that tells Cloudflare where your backend is running.</p>
<p>In your config file, you map your domain to your local server.</p>
<p>For example, your domain can point to:</p>
<p><a href="http://localhost:3000">http://localhost:3000</a></p>
<h2><strong>Step 5. Connecting your Domain</strong></h2>
<p>If you have a domain, go to the DNS page of Cloudflare website and add your domain and DNS in their, and connect your DNS with your frontend platform(Vercel, Netlify etc).</p>
<h2><strong>Step 6. Connecting your Frontend</strong></h2>
<p>If you have a frontend hosted on platforms like Vercel, you just need to update your API URL.</p>
<p>Instead of calling localhost, you use your public domain:</p>
<p><a href="https://api.yoursite.com">https://api.yoursite.com</a></p>
<h2><strong>Step 7. Making it completely unbreakable and up 24x7</strong></h2>
<p>At this point, everything works, but not reliably.</p>
<blockquote>
<p><em>I faced a major issue here.</em></p>
</blockquote>
<p>After a power cut, my PC would restart, but the tunnel wouldn’t reconnect properly, especially because my WiFi took some time to come back online.</p>
<p>So even though my backend was running, it wasn’t accessible.</p>
<p>To fix this, I replaced the default tunnel service with a <em><strong>simple retry script</strong></em>.</p>
<p><em>This script keeps trying to reconnect the tunnel until the internet is available.</em></p>
<p>This made the system much more reliable, even with unstable power and network conditions.</p>
<p><strong>Keep the PC/Laptop powered on at all times, you can even disconnect the screen and all your peripherals as well.</strong></p>
<h3>Problems I ran into</h3>
<ol>
<li><p><strong>Backend worked locally but not online</strong> - This usually happens because the backend is not properly exposed or the tunnel is not configured correctly.</p>
</li>
<li><p><strong>Auto-login issues on Windows -</strong> To make this setup truly automatic, I needed the PC to log in on its own after a restart. I configured auto-login correctly with the password, the system booted directly into the desktop.</p>
</li>
</ol>
<blockquote>
<p><em><strong>This way, I currently run 5 backend servers on an old pc.</strong></em></p>
</blockquote>
<h3>Conclusion</h3>
<p>This setup started as an experiment, but it turned into something much more useful.</p>
<p>It may not replace cloud hosting for large applications, but for personal use, it’s more than enough.</p>
<p>Sometimes, the simplest solutions are the most effective.</p>
]]></content:encoded></item></channel></rss>