Introduction
Cloudflare Pages is a Jamstack web hosting platform that combines the simplicity of static site deployment with the power of edge computing. Built on Cloudflare's global network of over 300 data centers, Pages delivers exceptional performance by serving content from edge locations worldwide, ensuring low-latency access for users regardless of their geographic location.
The platform integrates seamlessly with Cloudflare's ecosystem of security services, including DDoS protection, SSL/TLS encryption, and Web Application Firewall capabilities, making it an attractive choice for organizations prioritizing both performance and security. For teams building modern web applications, our web development services can help you leverage edge-first architectures to achieve superior performance and user experience.
Everything you need to deploy and manage modern web applications
Flexible Deployment
Deploy via Git integration, direct upload, or C3 CLI tool
Pages Functions
Serverless edge functions for dynamic backend logic
Smart Builds
Support for 30+ frameworks with configurable build pipelines
Preview Environments
Automatic preview URLs for every branch and pull request
Custom Domains
Free SSL certificates and DNS configuration
Edge Security
DDoS protection and WAF integration automatically enabled
Deployment
Cloudflare Pages offers three primary deployment pathways, each designed to accommodate different development workflows and organizational requirements.
Git Integration
The most common deployment method connects Pages directly to GitHub, GitLab, or Bitbucket repositories. When configured, Pages automatically triggers deployments upon each commit to designated branches, creating a continuous deployment pipeline without requiring external CI/CD infrastructure. The integration supports branch-based deployment controls, allowing teams to configure which branches deploy to production and which deploy to preview environments.
Configuration occurs through the Cloudflare dashboard or via configuration files within the repository. The dashboard provides a visual interface for connecting repositories, selecting branches, and configuring build settings. For teams preferring infrastructure-as-code practices, Pages respects configuration defined in wrangler.toml or pages.toml files, enabling version-controlled deployment settings that integrate with existing development workflows.
Direct Upload
For organizations requiring deployment without Git integration or those operating within restricted network environments, Pages supports direct upload of prebuilt assets. This method utilizes the Wrangler CLI to upload compiled artifacts directly to Cloudflare's network, bypassing the Git-based deployment pipeline entirely.
The direct upload workflow begins with local project compilation using the team's existing build process. Once assets are generated in a designated output directory, Wrangler handles the upload, associating the deployment with a Pages project and creating a production deployment. This approach proves particularly valuable for CI/CD pipelines where build and deployment occur in separate stages or where artifacts require validation before deployment.
C3 CLI Tool
The Create Cloudflare Client (C3) CLI accelerates project initialization by scaffolding Pages-compatible projects for popular frameworks. Rather than manually configuring build settings, developers can execute C3 commands that generate pre-configured projects optimized for Pages deployment.
C3 supports initialization of projects using frameworks including Next.js, Nuxt, Astro, SvelteKit, and dozens of others. The tool automatically configures build commands, output directories, and environment variables appropriate for each framework, reducing setup time and eliminating configuration errors. For teams standardizing on Pages, C3 provides a consistent starting point that accelerates onboarding of new projects and team members.
Functions
Pages Functions extend the platform beyond static hosting, enabling serverless execution of dynamic code at the edge. Built on the same underlying technology as Cloudflare Workers, Functions execute in Cloudflare's edge environment, processing requests without requiring dedicated servers or container management.
Serverless Edge Execution
Functions execute in JavaScript, TypeScript, or WebAssembly, with request handling occurring in Cloudflare's global network rather than origin servers. This architecture eliminates cold start delays common in traditional serverless platforms, as edge functions remain hot and ready to respond immediately upon request arrival. The execution environment provides access to standard Web APIs including Fetch, Request, and Response interfaces, enabling familiar HTTP programming patterns.
Function code resides in a functions directory within the project, with files mapped to routes through file-based routing conventions. A functions/api/hello.ts file automatically handles requests to the /api/hello path, with the framework handling request routing, method matching, and response formatting. This convention-over-configuration approach reduces boilerplate while maintaining clear organization for larger function collections.
Middleware and Bindings
Functions support middleware patterns that enable request preprocessing, authentication, logging, and response modification across multiple routes. Middleware functions execute before route handlers, allowing centralized logic implementation without code duplication. This pattern proves particularly valuable for cross-cutting concerns like authentication verification, request logging, or A/B testing implementation.
Bindings provide secure access to external resources including KV namespaces, Durable Objects, Cloudflare R2 storage buckets, and Cloudflare D1 databases. These bindings abstract credential management, eliminating hardcoded secrets while providing consistent interfaces for resource interaction. Function code references bindings by name, with Cloudflare resolving the actual connection at deployment time based on project configuration. Organizations looking to build intelligent, automated workflows can explore our AI automation services that leverage edge computing capabilities.
Builds
The build system transforms source code and assets into production-ready artifacts optimized for edge delivery. Pages supports virtually any build process through configurable build commands and environment variables, accommodating both conventional frameworks and custom compilation workflows.
Framework Support
Pages maintains first-class support for over 30 frontend frameworks and static site generators. Popular choices including React, Vue, Svelte, Next.js, Nuxt, Astro, and Hugo all deploy successfully with minimal configuration. The platform detects common frameworks automatically, applying recommended build settings without manual intervention.
For frameworks without automatic detection, developers specify build commands and output directories explicitly. The build command executes within a containerized environment with access to common build tools and package managers. Output directories containing compiled assets are uploaded to Cloudflare's network and served from edge locations globally.
Build Configuration
Build behavior is controlled through project settings in the dashboard or through configuration files. Key settings include the build command to execute, the output directory containing compiled assets, and environment variables passed to the build process. For monorepos or projects requiring multiple build stages, custom commands orchestrate complex build workflows.
Build caching accelerates subsequent deployments by reusing artifacts from previous builds. Dependency caches for npm, pnpm, and yarn packages persist between builds, reducing installation time for projects with many dependencies. Teams can configure cache behavior through settings, enabling optimization for specific project structures and build patterns.
Preview
Preview deployments provide isolated, shareable environments for every code change, enabling efficient code review and stakeholder feedback collection. Each push to a branch or pull request automatically generates a unique preview URL, allowing reviewers to interact with changes in a production-equivalent environment before merging.
Branch-Based Previews
Every branch pushed to the connected repository receives a dedicated preview deployment with a unique URL. The preview environment mirrors production configuration, including Functions, environment variables, and cache settings. This consistency ensures that reviewers see accurate representations of how changes will behave in production, eliminating the gap between review environments and live deployments.
Preview URLs follow a predictable pattern incorporating the branch name or pull request number, making them easily identifiable and shareable. The dashboard provides overview of all active preview deployments, enabling quick access to specific environments and comparison between versions. Teams can configure which branches receive preview deployments, potentially excluding long-lived branches to reduce resource consumption.
Pull Request Integration
Pull requests automatically receive preview deployments, with status checks indicating deployment completion and URL availability. Reviewers access the preview directly from the pull request interface, reducing friction in the feedback process. For teams using continuous integration, preview URLs can trigger automated testing against the deployed environment, validating behavior in a production-like context.
Preview deployments remain active until the branch is merged or closed, providing persistent access throughout the review process. This approach differs from ephemeral preview environments that delete immediately after status updates, enabling extended review periods and stakeholder demonstrations without re-deployment.
Custom Domains
Custom domain configuration enables Pages deployments to serve content under organization-owned domains, supporting both apex domains and subdomains with automatic SSL certificate provisioning.
DNS Configuration
Domains connect to Pages through DNS records pointing to Cloudflare's edge network. CNAME records map subdomains to the Pages-generated domain, while A records directly connect apex domains. The dashboard provides specific DNS targets for each project, with guidance for common DNS provider configurations. Cloudflare's own DNS service simplifies configuration for organizations already using the platform, enabling one-click domain addition for domains within the same account.
Multiple domains can serve the same Pages project, supporting domain migration scenarios and multi-brand deployments. Each domain receives independent SSL certificates, with automatic renewal before expiration. The platform handles certificate provisioning through Let's Encrypt, eliminating manual certificate management and associated security risks from expired certificates.
SSL/TLS Security
All Pages deployments include SSL/TLS encryption by default, with certificates provisioned automatically for custom domains. The platform supports flexible SSL configurations including flexible, full, and full-strict modes, accommodating various security requirements and certificate management strategies. HTTP automatically redirects to HTTPS, ensuring encrypted connections for all visitors.
Beyond basic encryption, Pages inherits Cloudflare's broader security features including DDoS protection, bot management, and Web Application Firewall capabilities. Organizations with existing Cloudflare subscriptions can apply additional security configurations at the domain level, creating defense-in-depth approaches to application protection. This integration eliminates the need for separate security services while providing enterprise-grade protection. Fast, secure delivery through edge networks also supports search engine optimization goals, as page speed and security are key ranking factors.