AI coding tools have made it easy to build a working app in an afternoon. The question that follows is where to put it. For most people the choice comes down to Cloudflare Pages vs Netlify, or running your own server. We use all three: our own website runs on Cloudflare Workers with static assets, we use Netlify on other projects, and we still put certain workloads on a virtual private server (VPS).

This guide compares them on the things that actually decide the answer: whether your app is static or dynamic, how it runs server-side code, where data lives, how forms work, what it costs and how hard it is to leave.

First, a note on Cloudflare Pages and Workers

Cloudflare has two products that overlap. Pages started as a static site host with add-on functions. Workers started as a serverless code platform and now serves static assets directly as well. Cloudflare publishes a guide for migrating from Pages to Workers and notes that Workers has a broader feature set. Pages still works well for static sites, but for a new project that needs server-side code, we start on Workers with static assets. In this article, "Cloudflare" means either, and we call out differences where they matter.

Static vs dynamic: the first question

A static site is a set of files (HTML, CSS, JavaScript, images) that are the same for every visitor. Marketing sites, documentation and many dashboards that load data in the browser are static. Any of the three options hosts static sites well, and both Cloudflare and Netlify do it on generous free tiers.

A dynamic app runs code on a server for each request: it checks a login, reads a database, calls an API with a secret key, or processes a form. This is where the options diverge.

Most apps built with AI tools are mostly static with a few dynamic pieces: a contact form, an API call that must hide a key, a small database. Serverless functions handle that pattern well.

Serverless functions

Serverless functions are small pieces of code that run on demand. You do not manage a server; the platform runs your code when a request arrives and bills by usage.

  • Cloudflare Workers run on Cloudflare's network in many locations, start very quickly and are well suited to request handling, APIs and form processing. They use a JavaScript runtime based on web standards rather than full Node.js, though Node.js compatibility has improved. Pages has Pages Functions, which are built on Workers.
  • Netlify Functions run your code in a Node.js-style serverless environment, with Edge Functions available for code that should run closer to visitors. Background and scheduled functions cover longer jobs and timed tasks.
  • A VPS runs whatever you install: a long-running Node.js or Python app, background workers, cron jobs, anything. No platform limits on execution time or runtime, but you run it.

If your app needs a long-running process, websockets on your own terms, heavy computation, or software that expects a normal Linux machine, a VPS is often simpler. For request-and-response work, serverless is easier to operate.

Databases and storage

Data is where lock-in starts, so choose deliberately.

  • Cloudflare offers D1 (a SQL database based on SQLite), KV (a key-value store), R2 (object storage for files) and other services, all reachable from a Worker through bindings. Our contact form saves each submission to a D1 database before emailing it.
  • Netlify offers Netlify Blobs for storage and Netlify DB, a managed Postgres database provided through Neon. Netlify also connects easily to outside databases such as Supabase or Neon directly.
  • On a VPS you can install Postgres or MySQL yourself, which gives full control and full responsibility for backups, updates and security.

For many small apps, a hosted database from a separate provider, reached from your functions, is the most portable choice. You can change hosts later without moving the data.

Forms

Forms are a common first dynamic need, and the platforms handle them differently.

  • Netlify Forms is built in. Add a data-netlify="true" attribute to an HTML form and Netlify detects it at deploy time, collects submissions and shows them in the dashboard, with notification options and spam filtering. It is the fastest path for a simple form.
  • Cloudflare has no built-in form product, so you write a small Worker to receive the submission. That takes more setup but gives full control. Ours stores submissions in D1, sends the notification through Cloudflare Email Routing in the background so the visitor gets an instant response, and blocks spam with Turnstile, a honeypot field, a timing check and a rate limit. Our guide to Cloudflare Turnstile covers the spam side in detail.
  • On a VPS, the form posts to your own application code, and you handle storage, email delivery and spam yourself.

Cost

Pricing on all three changes, so treat this as a shape rather than a quote and check current pricing before committing.

  • Cloudflare Workers has a free plan with a daily request allowance, and a paid plan with a low monthly minimum (Cloudflare lists it at $5 per account at the time of writing) that includes a large monthly request allowance. Cloudflare's Workers pricing page states that requests to static assets are free and unlimited, which makes it very inexpensive for mostly static sites.
  • Netlify moved new accounts to credit-based plans in 2025. A free plan includes a monthly credit allowance, and paid plans add more. Production deploys, function compute, form submissions, bandwidth and web requests all draw on credits, while preview deploys do not. Small sites usually fit comfortably, but frequent production deploys or heavy traffic can use credits faster than people expect.
  • A VPS is a fixed monthly fee for a set amount of CPU, memory and disk, typically starting at a few dollars a month from providers such as DigitalOcean, Hetzner, Akamai (Linode) or AWS Lightsail. The bill is predictable, but your time maintaining it is the real cost.

Lock-in

Every option has some.

  • Cloudflare Workers code that uses D1, KV, R2 and other bindings is tied to Cloudflare. Plain web-standard request handling ports more easily.
  • Netlify Forms, Netlify-specific function configuration and Blobs are tied to Netlify. A Netlify DB database is standard Postgres, which helps.
  • A VPS has the least platform lock-in. A standard Linux app can move to another provider with little change.

Two habits reduce lock-in wherever you host: keep business logic separate from platform-specific code, and keep your data in a format and service you can export.

Operations and security

On Cloudflare and Netlify, the platform handles servers, operating system patches, TLS certificates, scaling and much of the DDoS protection. Both offer preview deployments so you can review a change before it goes live. We also run a separate staging deployment that sends a noindex header until launch.

On a VPS, all of that is yours: firewall, updates, certificates, backups, monitoring and recovery. That is fine for a team with the skills and time. For an executive shipping internal tools, it is usually the wrong trade. Our guide to Claude Code for executives covers staging, secrets and review in more detail.

Side by side

VPS Netlify Cloudflare (Workers/Pages)
Static sites Yes, you configure Excellent Excellent
Server-side code Anything Functions, edge functions Workers, Pages Functions
Database Install your own Netlify DB (Postgres), Blobs, or external D1, KV, R2, or external
Forms Build your own Built in Build with a Worker
Cost shape Fixed monthly Credits by usage Free tier, low paid minimum
Maintenance You Platform Platform
Lock-in Lowest Moderate Moderate

A simple decision guide

  1. Is the app static, or static with a contact form? Use Netlify if you want built-in forms with no code. Use Cloudflare if your DNS is already there or you want the lowest running cost.
  2. Does it need a few API endpoints, a small database or scheduled jobs? Either platform works. Cloudflare Workers is strong for fast, inexpensive request handling with D1; Netlify is strong if your framework and workflow already fit it.
  3. Does it need a long-running process, specialized software or full control of the machine? Use a VPS, and budget time for maintenance.
  4. Will it hold sensitive or regulated data? Decide where the data lives first, then choose hosting around it, and get a security review.

When in doubt, start on a managed platform. Moving from a managed platform to a VPS later is easier than living with an unmaintained server.

Where we help

We move websites and apps between hosts, set up DNS, staging and deployment pipelines, and build the forms and functions behind them. See our website hosting and migration service for how we plan a move without downtime.

Frequently asked questions

Cloudflare Pages vs Netlify: which is better for a static site?

Both are excellent for static sites. Netlify has a polished workflow and built-in forms. Cloudflare serves static assets free and without request limits on Workers, and fits well if your DNS is already on Cloudflare. For most small sites, either is a sound choice.

Should I use Cloudflare Pages or Workers for a new project?

For a purely static site, Pages is fine. For anything with server-side code, we start on Workers with static assets, since Cloudflare publishes a migration path from Pages to Workers and Workers has the broader feature set.

Is a VPS cheaper than Netlify or Cloudflare?

The monthly bill can be low and predictable, but you take on updates, security, backups and monitoring. For small apps, managed platforms are often free or close to it, which makes them cheaper once you count your time.

Can I move my app later if I change my mind?

Yes, especially if you keep business logic separate from platform-specific features and keep your data in an exportable service. Apps that rely heavily on one platform's forms, storage or database bindings take more work to move.

Where should I store data for an AI-built app?

For small apps, use the platform database (Cloudflare D1 or Netlify DB) if you plan to stay, or a separate hosted Postgres provider if portability matters more. Avoid storing important data only in files on a single server without backups.