Mar 30, 2026
2 min read

Step 5: Deploy the application and sync secrets to Cloudflare

Step 5: Deploy the application and sync secrets to Cloudflare
Ensure your production environment stays secure and in sync.

Local development is working. Now it's time to get those secrets into Cloudflare so your deployed Worker can use them.

Unlike local development, where secrets come from a file, production Workers read secrets stored in Cloudflare's infrastructure. That simply means you need to upload your secrets to Cloudflare before deploying. While Doppler doesn't have a native sync integration with Cloudflare Workers, you can pipe secrets directly using the CLIs.

First, make sure the Wrangler CLI is authenticated with Cloudflare:

Complete the OAuth flow in your browser. After successful authentication, return to your terminal and verify that everything is set up correctly by running:

This confirms which account you're currently authenticated as. Once verified, sync your production secrets from Doppler to Cloudflare:

This command first fetches all production secrets from Doppler in JSON format using the prd configuration. The output is then piped through jq to extract only the computed secret values, removing Doppler-specific metadata. Finally, wrangler secret bulk reads the cleaned JSON from standard input and uploads each secret to Cloudflare in a single batch.

As the process runs, you'll see a confirmation message for each secret as it's uploaded:

Terminal screenshot showing successful secrets upload to Cloudflare
Terminal screenshot showing successful secrets upload to Cloudflare

Deploy your worker

With secrets in place, deploy your Worker by running:

After deployment completes, you'll see the URL for your Worker:

Test the production endpoint:

You should see "environment": "production" and all secrets reporting as "configured".

You've now completed the core workflow. Secrets are centrally managed in Doppler, local development always pulls the latest values, and production uses its own isolated set of credentials.

While this manual process works, running these commands on every deploy is tedious and error-prone. The next step automates the entire workflow.