Static vs dynamic websites: what they are and which you need
Kofi Agyem, Founder and CEO, CloudzyroPublished · 5 min read
On this page
What a static website is, what makes a site dynamic, the pros and cons of each, examples, and how the choice changes your hosting and costs.
1. The difference in one paragraph
A static website is a set of ready-made files (HTML, CSS, JavaScript and images) that the server sends to every visitor exactly as they are. A dynamic website builds pages on the server when they're requested, usually with code and a database, so each visitor can see something different. Static sites are faster, cheaper and simpler to host. Dynamic sites can handle logins, shopping carts and content that changes per person.
2. What is a static website?
A static website is stored as finished files. When someone visits /about, the server finds the file for that page and sends it. Nothing is calculated, no database is asked, and everyone gets the same file.
Static doesn't mean dull or old-fashioned. The page can be beautiful and interactive, because JavaScript runs in the visitor's browser. Many modern sites are static: they're written with tools such as Astro, Vite or React, and a build step turns the source into plain files before they go online.
Examples of sites that are usually static:
- Portfolios, landing pages and marketing sites
- Documentation and blogs made with a site generator
- Single-page apps built with React, Vue or Svelte that fetch data from an API
- Many sites built with AI tools such as Claude, Lovable or Bolt
3. What is a dynamic website?
A dynamic website runs a program on the server for each request. The program might read from a database, check who's logged in, and then put the page together before sending it. Two visitors can get different pages from the same address.
Examples of dynamic sites:
- WordPress, Joomla and Drupal sites (PHP and MySQL)
- Online shops with carts and accounts
- Web apps with logins and dashboards, such as a Next.js, Node.js, Laravel or Django app
- Sites with server-side search, forums or comments stored on the server
4. Static vs dynamic, side by side
- How pages are made: static sends ready-made files; dynamic builds each page when it's requested.
- Speed: static is very fast and easy to cache close to visitors. Dynamic depends on the code and database, and usually needs caching to match.
- Hosting: static needs only file serving, often free. Dynamic needs a server that runs code, such as PHP or Node.js.
- Security: static has very little to attack on the server. Dynamic has code, a database and often plugins that need updates.
- Content updates: static sites are rebuilt and redeployed when content changes. Dynamic sites change as soon as you edit them, often through an admin panel.
- Personalization: static sites personalize in the browser with JavaScript. Dynamic sites can personalize on the server.
- Busy days: static scales almost without effort. Dynamic needs enough CPU, memory and database capacity.
5. The middle ground
The line has blurred. Many sites are a mix:
- Static site plus services. A static site can still have a contact form, payments or a database by calling outside services from the browser. A React app with Supabase is static hosting with a dynamic backend somewhere else.
- Static generation in frameworks. Next.js, Astro and Nuxt can build some pages ahead of time and render others on the server. The output decides how you host it.
- Cached dynamic sites. A WordPress site with page caching sends saved copies to most visitors, so it behaves much like a static site until someone logs in.
The practical question isn't the label but this: after the build, does your site need a program running on the server? If not, it's static as far as hosting is concerned.
6. How to tell which one you have
- There's a
package.jsonwith abuildscript, and the output is a folder such asdistoroutfull of HTML: static, with a build step. - There's a
package.jsonwith astartscript that runs a server (Express, or Next.js with server rendering): dynamic, a Node.js app. - There are
.phpfiles, or it's WordPress: dynamic, PHP. - There's just an
index.htmland some CSS and JavaScript: static.
If an AI tool built your site, ask it: "Is this a static site, or does it need a server running?" It can usually tell you in one answer.
7. Which should you choose?
Choose static when your content is the same for everyone and changes when you decide to publish: portfolios, business sites, landing pages, docs, blogs. You get speed, low cost and less to keep secure.
Choose dynamic when the site has to react to the person or to data on the server: accounts, carts, dashboards, user content, or when non-technical editors need an admin panel such as WordPress.
A common mistake is choosing dynamic out of habit. A small business site doesn't need WordPress, a database and a stream of plugin updates if it changes twice a year. The opposite mistake is forcing an app with logins into a static setup and bolting on workarounds.
8. Hosting each kind
Static sites need a host that serves files over HTTPS, ideally behind a CDN. On Cloudzyro Sites & Apps, plain HTML goes online as it is, and projects with a build step (Vite, React, Astro) are built for you. The free Launch plan allows business use and includes 100 GB of traffic a month, and Cloudflare caches your static files. See HTML hosting.
Dynamic Node.js apps need a host that runs your server process. Sites & Apps runs them too, on Node 24 by default, with 512 MB of memory on Launch or 2 GB on Boost ($20 a month per site plus tax). Keep data in a database: sites have no permanent disk, so files written while running are reset on each deploy. See Node.js hosting and connecting Supabase.
Dynamic PHP sites such as WordPress run best on cPanel hosting with PHP and MySQL. Cloudzyro Web Hosting supports PHP 7.4 to 8.4, from $39.99 a year plus tax. See PHP hosting.
For the full process, from choosing a host to pointing your domain, read how to host a website. For what each option costs, see how much a website costs.