New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

aerni/cloudflared

A Laravel package to create and manage Cloudflare Tunnels for local development
73,969 87

Larablocks Analysis

aerni/cloudflared works with Laravel 12 and 13 (latest release v2.1.1, Apr 21, 2026).

Laravel 11 in earlier releases.

Recommendation checks

Solid choice

Solid choice: maintained and up to date, meets 3 of 4 checks; below the bar for Recommended on use.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Apr 21, 2026)
  • 28,893 downloads a month (at least 10,000)
  • 87 GitHub stars (needs 100)

State

Maintained
  • Last stable release: Apr 21, 2026.
  • 3 releases in the last 12 months.
  • First released: Nov 12, 2025.
  • Monthly downloads: 28,893.
  • 1 open issue on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 30, 2026.

Install
composer require aerni/cloudflared
Latest Version:v2.1.1
PHP:^8.3
Laravel:12 · 13
Older releases:11
License:MIT
Last Updated:Nov 25, 2026
Links: GitHub  ·  Packagist
Maintainer: aerni

Cloudflared for Laravel

A simple package to create and manage Cloudflare Tunnels for your Laravel projects. Cloudflare Tunnels give you instant public access to your local development environment, similar to Expose or ngrok, but powered by Cloudflare. Perfect for testing webhooks and sharing work-in-progress.

Pair it with Cloudflared for Vite to get seamless tunneled access to both your Laravel app and Vite's dev server, making it effortless to debug your frontend on real devices like your iPhone.

Prerequisites

  1. Install cloudflared
  2. Run cloudflared tunnel login to authenticate the desired domain
  3. Install Laravel Herd

Installation

Install the package using Composer:

composer require aerni/cloudflared

Keep APP_URL set to your local Herd URL (e.g. http://myapp.test). Do not set it to the public tunnel hostname. That would make cloudflared forward traffic to itself. While the tunnel is running, the package automatically rewrites URL generation to the public Cloudflare URL in web requests, queue workers, and scheduled commands. You never need to edit .env whether the tunnel is active or not.

Basic Usage

Creating a tunnel

Create a tunnel for your project with a single command. This will create a Cloudflare tunnel, configure DNS records, set up a Herd link, and save the configuration to .cloudflared.yaml in your project root.

php artisan cloudflared:install

Note: Run this command again to modify the existing installation. Change the subdomain, create or repair DNS records, or delete and recreate the tunnel.

Running the tunnel

Start the tunnel to make your local site publicly accessible.

php artisan cloudflared:run

Deleting the tunnel

Remove the tunnel, DNS records, and configuration when you no longer need it.

php artisan cloudflared:uninstall

Good to know

Trusted proxies

Signed URL validation and HTTPS detection through the tunnel rely on Laravel honoring X-Forwarded-Proto from Cloudflare. This is the same TrustProxies setup you'd use behind any TLS-terminating proxy. Most production apps already have this configured.

Long-running queue workers

The URL rewrite is captured once when the worker boots. Restart long-running workers after starting or stopping the tunnel so new URLs pick up the change.

Config caching

Make sure your config isn't cached while the tunnel is up. The rewrite runs during bootstrap, so the tunnel URL would get serialized into the cached config and pin there. Clear your config cache if this happens.

License

This package is open-sourced software licensed under the MIT license.

Credits

Developed by Michael Aerni

Support

For issues and questions, please use the GitHub Issues page.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

431,187,642 4,660

Version History

Version Released PHP Laravel License
v2.1.1 ^8.3 ^12.0 || ^13.0 MIT
v2.1.0 ^8.3 ^12.0 || ^13.0 MIT
v2.0.0 ^8.2 ^12.0 || ^13.0 MIT
v1.1.0 ^8.2 ^11.0 || ^12.0 MIT
v1.0.0 ^8.2 ^11.0 || ^12.0 MIT