DEV Community

Preeti Islur
Preeti Islur

Posted on

Deploying a .NET Core API for Free in 2026: Railway vs Render vs Fly.io vs Cloudflare Tunnel

Why this comparison

When I started building Sa, a car comparison platform for the Indian market, I had a working .NET Core Web API with MongoDB running locally — Makes and Models endpoints, Swagger docs, all good. Then came the question every side-project developer eventually hits: where do I deploy this for free?

Azure and AWS have free tiers, but they come with credit card requirements, complex IAM setup, and cold-start behavior that isn't beginner-friendly for a side project you're iterating on daily. So I evaluated four alternatives that are actually built for indie developers.

The options

  1. Railway

Railway offers a straightforward deploy-from-GitHub experience with a genuinely free starter tier. For a .NET Core API + MongoDB setup, it handles builds via Nixpacks or a Dockerfile without much configuration.

Pros: Fast setup, clean UI, good logs, straightforward environment variable management. Cons: Free tier has usage limits (hours/month) that can run out faster than expected if your API stays warm.

  1. Render

Render's free web service tier is popular for small APIs. It supports Docker deployments directly, which works well for a .NET Core app with a custom Dockerfile.

Pros: Reliable, simple YAML-based config, good docs for containerized .NET apps. Cons: Free tier services spin down after inactivity — the first request after idle can take 30-60 seconds, which matters if you're demoing the API live.

  1. Fly.io

Fly.io deploys apps as lightweight VMs close to users, which appealed to me for eventually serving India-based traffic with lower latency.

Pros: Good performance once warm, supports persistent volumes, CLI-first workflow that's scriptable. Cons: Slightly steeper learning curve — you're working with fly.toml and flyctl rather than a pure dashboard experience. Free allowances have also gotten stricter over time, so double-check current limits before committing.

  1. Cloudflare Tunnel

This is a different approach entirely — instead of hosting the API on a cloud platform, Cloudflare Tunnel exposes an API running on your own machine or a home server to the internet securely, without opening ports.

Pros: Free, no cold starts if your machine is always on, full control over the runtime environment. Cons: Only as reliable as your own uptime — not suitable for anything beyond early development/demo purposes.

What I chose and why

For active development with a MongoDB Atlas backend, the tradeoff came down to cold-start tolerance vs. setup complexity. If you're building an API that needs to feel responsive during demos or early user testing, spin-down delays on free tiers are the biggest hidden cost — worth testing with a simple health-check endpoint before committing to a platform.

Takeaway

There's no universally "best" free option — it depends on whether you prioritize zero cold-starts, ease of setup, or long-term scalability path. For a project still in active development, I'd recommend starting with whichever platform gets you deployed fastest, then re-evaluating once you have real usage patterns to optimize against.

Top comments (0)