{
  "id": "a99d6a20537dd20d89a2bc91",
  "source": "solid:signals",
  "type": "github-document",
  "title": "cloudflare",
  "content": "---\ntitle: Cloudflare\norder: 2\nmainNavExclude: true\nuse_cases: \u003e-\n  static site hosting, jamstack deployment, edge deployment, cdn hosting, web\n  publishing\ntags:\n  - cloudflare\n  - pages\n  - deployment\n  - wrangler\n  - hosting\n  - jamstack\nversion: '1.0'\ndescription: \u003e-\n  Deploy Solid apps to Cloudflare Pages for fast, global edge hosting with\n  built-in CDN and simple Git integration setup.\n---\n\n[Cloudflare Pages](https://pages.cloudflare.com/) is a JAMstack platform for frontend developers, where JAMstack stands for JavaScript, APIs, and Markup.\nFor additional details and features, you can [visit the Cloudflare website](https://pages.cloudflare.com/).\n\n## Using the Cloudflare's web interface\n\n1. Navigate to the [Cloudflare login page](https://dash.cloudflare.com/login) and log in or sign up.\n\n\u003cEraserLink\n\thref=\"https://app.eraser.io/workspace/w9y9PNVjwSqDCEPNTEoe?elements=UE1AFe5oESDQkepKNaMxtA\"\n\tpreview=\"https://app.eraser.io/workspace/w9y9PNVjwSqDCEPNTEoe/preview?elements=UE1AFe5oESDQkepKNaMxtA\u0026type=embed\"\n/\u003e\n\n2.  After logging in, find \"Pages\" in the left-hand navigation bar.\n    Add a new project by clicking \"Create a project,\" then choose \"Connect to Git.\"\n\n\u003cEraserLink\n\thref=\"https://app.eraser.io/workspace/w9y9PNVjwSqDCEPNTEoe?elements=XcbVyX2a69kSAP1m1220Ug\"\n\tpreview=\"https://app.eraser.io/workspace/w9y9PNVjwSqDCEPNTEoe/preview?elements=XcbVyX2a69kSAP1m1220Ug\u0026type=embed\"\n/\u003e\n\n3.  You'll have the option to install Cloudflare Pages on all your repositories or select ones.\n    Choose the repository that contains your Solid project.\n\n\u003cEraserLink\n\thref=\"https://app.eraser.io/workspace/w9y9PNVjwSqDCEPNTEoe?elements=SsbGUghc_Vwlvxefe1xAFg\"\n\tpreview=\"https://app.eraser.io/workspace/w9y9PNVjwSqDCEPNTEoe/preview?elements=SsbGUghc_Vwlvxefe1xAFg\u0026type=embed\"\n/\u003e\n\n4. Configure your build settings:\n\n- The project name will default to the repository name, but you can change it if you wish.\n- In the \"build command\" field, enter `npm run build` .\n- For the \"build output directory\" field, use `dist` .\n- Add an environment variable `NODE_VERSION` and set its value to the version of Node.js you're using.\n\n**Note:** This step is crucial because Cloudflare Pages uses a version of Node.js older than v13, which may not fully support Vite, the bundler used in Solid projects.\n\n\u003cEraserLink\n\thref=\"https://app.eraser.io/workspace/w9y9PNVjwSqDCEPNTEoe?elements=1HpIQUkxqNl9j3JlXIUvTg\"\n\tpreview=\"https://app.eraser.io/workspace/w9y9PNVjwSqDCEPNTEoe/preview?elements=1HpIQUkxqNl9j3JlXIUvTg\u0026type=embed\"\n/\u003e\n\n5. Once you've configured the settings, click \"Save and Deploy.\"\n   In a few minutes, your Solid project will be live on Cloudflare Pages, accessible via a URL formatted as `project_name.pages.dev`.\n\n## Using the Wrangler CLI\n\nWrangler is a command-line tool for building Cloudflare Workers.\nHere are the steps to deploy your Solid project using Wrangler.\n\n1. Use your package manager of choice to install the Wrangler command-line tool:\n\n```package-install-global\nwrangler\n```\n\n2. Open your terminal and run the following command to log in:\n\n```bash frame=\"none\"\nwrangler login\n```\n\n3. Build your project using the following command:\n\n```package-run\nbuild\n```\n\n4. Deploy using Wrangler:\n\n```bash\nwrangler pages deploy dist\n```\n\nAfter running these commands, your project should be live.\nWhile the terminal may provide a link, it's more reliable to check your Cloudflare Pages dashboard for the deployed URL, which usually follows the format `project-name.pages.dev`.",
  "url": "https://github.com/solidjs/solid-docs/blob/HEAD/src/routes/guides/deployment-options/cloudflare.mdx",
  "metadata": {
    "path": "src/routes/guides/deployment-options/cloudflare.mdx",
    "repo": "solidjs/solid-docs",
    "repo_url": "https://github.com/solidjs/solid-docs.git",
    "size": 3491,
    "source_type": "github"
  },
  "hash": "c0a8de6d56b19c0ebcadebd8aefe540f045c3ac94381aa137f993d078c79505e",
  "timestamp": "2026-02-23T11:43:00.187415937+01:00"
}