Alpha Tech Logo

Alpha Tech

SOFTWARE SYSTEMS COMPANY
Server Persistence Tools Picture

May 12, 2025 • Hassam Fathe Muhammad

Solving Server Persistence in IoT Projects with VM, NGINX & Certbot — My Alpha Connect Hub Journey

One of the most effective improvements I made to Alpha Connect Hub — my IoT monitoring and logging platform — was ensuring a consistent and long-running server session for uninterrupted data collection.

Many developers write solid backend code for real-time data exchange using WebSockets and REST APIs. But the problem arises not in the code — but in the server. If the server goes idle (like it often does on CaaS platforms such as Render or Railway), it may shut down due to inactivity, disrupting real-time data flow. This is unacceptable in production-grade IoT apps.

🧠 Enter Virtual Machines

To ensure consistent server uptime and flexibility, I switched to virtual machines (VMs). I chose AWS EC2 instances, giving me full control over my server's lifecycle and uptime. This was my entry into the DevOps domain.

Here's what the setup involved:

🎓 From University Assignment to DevOps Deployment

Initially, Alpha Connect Hub was a semester assignment running on a Google Cloud VM. But I faced a major limitation: cross-origin cookie handling. When your frontend is on Vercel or Netlify and backend on another domain, you can't easily set cookies or sessions.

The solution? Deploy the backend on a subdomain of your primary domain, and ensure everything communicates over HTTPS-to-HTTPS.

🌐 Why a Domain Matters

Since Node.js servers by default serve HTTP, you need SSL/TLS encryption to communicate securely — especially for WebSockets. To make this work:

This was the moment I realized how much **post-configuration**, **networking**, and **infrastructure** knowledge is required to turn a working prototype into a production-grade IoT system.

🐧 Falling in Love with Linux & Servers

Running Ubuntu-based VMs, writing NGINX configs, handling SSL certs — these tasks pulled me deeper into the world of operating systems and infrastructure. I started loving the power and control it gave me over my deployments.

This wasn't just a code deployment. It was a mindset shift — from being a developer to becoming a builder who owns the whole stack.

If you're working on IoT, chat apps, real-time dashboards, or anything state-sensitive — understand that your code is just one part. The machine that runs it matters just as much.

#IoT #AlphaConnectHub #ServerPersistence #AWS #Certbot #NGINX #VM #FullStackDev #DevOps #AlphaTech