Deployment · 2026
N8n VPS Deployment
Hosting Automation Agents 24/7 on Azure Cloud with Cloudflare Tunnel
A cost-efficient, 24/7 cloud deployment of N8N automation agents on an Azure VPS, optimised with swap space, on-demand start-stop, and Cloudflare Tunnel — built to run reliably without unnecessary hosting costs.

After building my N8N agents — you can refer to the Enquiry Answering Agent and Email Summarizer Agent in this same source — I realised I needed to deploy them somewhere they could run 24/7. I wanted to be able to publish them, access them, use them, and even demonstrate them in college anytime, without having to manually turn on my laptop and run them locally every single time. So I started researching how to host them properly on the cloud.
It took some research, a few failed attempts, but I finally managed to get everything hosted on an Azure B2 VPS. Being a student, Azure gave me a genuinely good deal to start with cloud computing — $100 in credits, no credit card required, and 750 hours of VPS usage. Early on, I struggled with the VPS getting deadlocked because of deployment logs piling up and consuming memory. I fixed this by allocating part of the SSD as additional memory, known as creating a "Swap Space," and by limiting how much memory the logs were allowed to use.
Once things were stable, I started deallocating the VPS whenever I was sure I wouldn't need it for a while — so it would shut down completely, without removing any of my setup. This meant I could simply turn the VPS back on with one click whenever needed, which saved me a good amount on VPS pricing, leaving me to pay only for the SSD and the public IP. I also learnt how to use Cloudflare Tunnel, which let me remove the need for a public IP altogether, while also handling SSL (HTTPS) for me automatically. So now, I only pay for the SSD when the VPS is turned off, and I start it up only when I know I'll need the automation running for the next few days or longer.