Welcome to Cloudflare
Explore guides and tutorials to start building on Cloudflare's platform
Build with Cloudflare
Run Workerexport default { async fetch(request) { const html = `<!DOCTYPE html> <body> <h1>Hello World</h1> <p>This markup was generated by a Cloudflare Worker.</p> </body>`;
return new Response(html, { headers: { "content-type": "text/html;charset=UTF-8", }, }); },
};
Run Workerexport default { async fetch(request) { const data = { hello: "world", };
return Response.json(data); },
};
Run Workerexport default { async fetch(request) { /** * Replace `remote` with the host you wish to send requests to */ const remote = "https://example.com";
return await fetch(remote, request); },
};
Run Workerexport default { async fetch(request) { const destinationURL = "https://example.com"; const statusCode = 301; return Response.redirect(destinationURL, statusCode); },
};
Run Workerexport default { async fetch(request) { async function MethodNotAllowed(request) { return new Response(`Method ${request.method} not allowed.`, { status: 405, headers: { Allow: "GET", }, }); } // Only GET requests work with this proxy. if (request.method !== "GET") return MethodNotAllowed(request); return fetch(`https://example.com`); },
};
Developer Platform
The Cloudflare Developer Platform provides a serverless execution environment that allows you to create entirely new applications or augment existing ones without configuring or maintaining infrastructure.
Create API Tokens
If you are going to be using the Cloudflare API, you first need an API token to authenticate your requests.
View Workers Examples
Review fully functional sample scripts to get started with Workers.
Install the WARP Client
The Cloudflare WARP client allows individuals and organizations to have a faster, more secure, and more private experience online.
Set up a tunnel
Cloudflare Tunnel provides you with a secure way to connect your resources to Cloudflare without a publicly routable IP address.
Zero Trust
Cloudflare Zero Trust replaces legacy security perimeters with our global network, making the Internet faster and safer for teams around the world.
Other docs you might also like
Install an Origin CA certificate
Use Origin Certificate Authority (CA) certificates to encrypt traffic between Cloudflare and your origin web server and reduce origin bandwidth consumption.
Change your nameservers
Make Cloudflare your primary DNS provider by updating your authoritative nameservers at your domain registrar.
SSL/TLS Encryption mode
Your domain's SSL/TLS encryption mode controls how Cloudflare connects to your origin web server and how SSL certificates presented by your origin will be validated.
Create IP access rules
Use IP Access rules to allowlist, block, and challenge traffic based on the visitor’s IP address, country, or Autonomous System Number (ASN).
Community
The Cloudflare community is a place for Cloudflare users to share ideas, answers, code and compare notes.
DiscordTwitterCommunity Forum Open source
Cloudflare contributes to the open-source ecosystem in a variety of ways, including:
GitHub ProjectsSponsorship ProjectsStyle Guide