How to Integrate Prerender With Lovable Hosted Websites Using Cloudflare Workers Custom Domains
This guide helps you enable Prerender for a Lovable-hosted website while keeping your site on Lovable. It is designed for non-technical users and avoids common Cloudflare errors by using Cloudflare Workers Custom Domains as the “front door”.
What to Expect
This integration takes ~45 minutes. Prerender connects to your Lovable site through Cloudflare. It sits in front of your domain and intercepts requests from bots before they reach your site. Without Cloudflare managing your domain's DNS, there is no way for Prerender to slot into the request flow.
How it Works
|
Browser |
|
Cloudflare |
|
Prerender |
|
Lovable |
|
User or bot visits your domain |
→ |
Routes the request |
→ |
Intercepts bot requests, serves pre-rendered HTML |
→ |
Hosts your site, continues working as normal |
Nothing changes about how you use Lovable. You're only adding Cloudflare as the front door.
Before you start
You will need:
-
Your Lovable hosted URL (example:
yourapp.lovable.app) -
Your custom domain (example:
yourapp.com) -
Your Prerender token (available in your Prerender account)
- Cloudflare account with your custom domain added (see setup instructions below)
Don't have Cloudflare set up?
Complete the Cloudflare setup first, then come back here and continue with the steps below. Here’s what the process involves:
- Create a free Cloudflare account: https://dash.cloudflare.com/sign-up
- Add your root domain (example:
yourapp.com) - Review your DNS records
- Log in to your domain registrar and replace the nameservers with Cloudflare's nameservers. The change propagation can take a few minutes up to a couple of hours, but you don't need to wait — continue to the next steps. Your custom domain may be temporarily unreachable during this time, but your site remains accessible via your Lovable hosted URL (
yourapp.lovable.app).
Follow the detailed Cloudflare guide here.
Step 1: Important: Remove the custom domain from Lovable
Disconnect your custom domain from Lovable. If your domain is connected inside both Lovable and Cloudflare, the two services create a “redirect loop”, and your site becomes unreachable. Only one service can be the “front door” at a time. In this setup, that’s Cloudflare.
-
Open your Lovable project
-
Go to Domains
-
Remove the custom domain (example:
yourapp.com,www.yourapp.com)
You can still use your custom domain publicly. Cloudflare will handle it and route requests to Lovable.
Step 2: Remove A record from Cloudflare
The existing records conflict with the Cloudflare Worker mapping you'll create and need to be removed first.
- Go to Domains and click on your domain
- In the left sidebar, click DNS → Records
- Delete all A records where the Name is
wwworyourapp.com
Step 3: Create a Cloudflare Worker
-
Log in to Cloudflare
-
Go to Compute → Workers & Pages

-
Click Create application

-
Choose Start with Hello World!

-
Name it something like
lovable-prerender -
Click Deploy
Step 4: Add your Prerender token to the Worker
-
Open your Worker
-
Go to Settings
-
Find Variables and Secrets
-
Add a Secret:
-
Name:
PRERENDER_TOKEN -
Type: Plaintext
-
Value: (paste your Prerender token)

-
- Add the Lovable Upstream as a secret
- Name: LOVABLE_UPSTREAM
- Type: Plaintext
- Value: Lovable hosted address (example:
https://yourapp.lovable.app)
-
Deploy
Step 5: Attach your custom domain(s) to the Worker (Custom Domain)
This is the key step that makes your domain work reliably through Cloudflare. By attaching your domain directly to the worker, you avoid common errors like Error 1014 and Error 1000.
-
In your Worker, open Settings
-
Click +Add next to Domains & Routes

- Select Custom domain

-
Enter your domain (add as many custom domains as you need, including www)

-
Cloudflare will automatically create the needed DNS/certificate setup
When done, Cloudflare DNS will show a special Worker mapping for your domain.
Step 6: Paste the Worker code
-
In Cloudflare, open Compute → Workers & Pages → Your Worker
-
Click Edit code
-
Replace everything with the code on this link.
-
Save and deploy
Final Check: Verify Prerender Is Working
Option 1: Simulate a Googlebot visit in Chrome
To confirm Prerender is working, you’ll simulate a Googlebot visit in Chrome and check the response headers for x-prerender-request-id. If this header is present, Prerender is serving pre-rendered HTML to bots and your integration is complete.
For the full step-by-step verification process, see: Verify Your Prerender Integration
Option 2: Verify Integration within your Prerender Account
Navigate to the Verify Integration step in your Prerender account and submit your domain for verification.
You’re all set!
Prerender will serve pre-rendered HTML to bots, while real users continue getting your Lovable site.
Support
If you encounter any issues with this integration, please contact our support team for assistance.