Put a website online with Cloudflare
Two simple ways for students to share a finished website: a permanent address in about 5 minutes (Option A), or a temporary link straight from their own computer for a quick look (Option B). No code needed for either.
Option A · A permanent address with Cloudflare Pages free plan available
For a finished website folder (index.html and its files). The result is a link like https://my-portfolio.pages.dev.
Before you start
- A free Cloudflare account (sign up with an email at dash.cloudflare.com).
- Your site as one folder (or a .zip of it) with
index.htmlat the top level. If the project has a build step, run it first and use the output folder (often calleddistorbuild). - Drag and drop limits: up to 1,000 files, and each file under 25 MiB.
- Sign in at dash.cloudflare.com and open Workers & Pages in the left menu.
- Click Create application, then Get started, then Drag and drop your files.
- Type a project name. It becomes your address:
my-portfoliogivesmy-portfolio.pages.dev. - Drag your folder or .zip into the upload box.
- Click Deploy site. When the upload finishes, click Save and Deploy, then open your project.
- Your site is live at
https://<project-name>.pages.dev. Share that link.
Update your site later: open the project, click Create a new deployment, choose Production, and upload the new folder.
If something goes wrong
- A file shows a red warning: it is too big (over 25 MiB). Remove or shrink it and upload the whole folder again.
- Blank page: make sure
index.htmlis at the top level of the folder, not inside another folder.
Good to know: a project created this way can't be switched to automatic Git deploys later; for that, create a new project from Git. Menu names in the Cloudflare dashboard may change slightly; if a name differs, look for the option to upload your files directly (Direct Upload).
Option B · A temporary link from your own computer (Quick Tunnel) testing only
If the website is already running on your own computer, Cloudflare can give it a temporary public https link, with no account and no domain. It is handy for showing someone a site that is still being built.
- Install
cloudflared. On macOS:brew install cloudflared. On Windows: download the latest release from GitHub (install page). - Start your site locally. The example below uses
http://localhost:8080. - In a terminal, run:
cloudflared tunnel --url http://localhost:8080
- Open the
trycloudflare.comlink thatcloudflaredprints, and share it.
Limits, as Cloudflare states them
- Quick Tunnels are for testing and development. For production, create a Cloudflare Tunnel (or use Option A).
- Anyone with the URL can access your local service. The URL stops working when you stop the
cloudflaredprocess. - Quick Tunnels have no uptime guarantee.
- Each Quick Tunnel supports up to 200 in-flight requests; additional requests return a 429 response.
- Quick Tunnels do not support Server-Sent Events (SSE).
- The hostname changes each time you create a Quick Tunnel.
Which one? Use Option B to show work in progress for a short time. Use Option A when the site is finished and you want a link that keeps working after the computer is switched off.
Want it done for you? The cf-publish-starter kit (free, open source, MIT) sets up both options: npm run publish for a Cloudflare Pages site and npm run share for a Quick Tunnel link. Its README has step-by-step instructions in Vietnamese and English.