PHPackages                             aerni/cloudflared - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. aerni/cloudflared

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

aerni/cloudflared
=================

A Laravel package to create and manage Cloudflare Tunnels for local development

v2.1.1(2mo ago)879.5k—3.1%5[1 issues](https://github.com/aerni/laravel-cloudflared/issues)MITPHPPHP ^8.3CI passing

Since Nov 12Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/aerni/laravel-cloudflared)[ Packagist](https://packagist.org/packages/aerni/cloudflared)[ Docs](https://github.com/aerni/laravel-cloudflared)[ RSS](/packages/aerni-cloudflared/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (5)Dependencies (9)Versions (6)Used By (0)

Cloudflared for Laravel
=======================

[](#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](https://github.com/aerni/vite-plugin-laravel-cloudflared) 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
-------------

[](#prerequisites)

1. Install [cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads)
2. Run `cloudflared tunnel login` to authenticate the desired domain
3. Install [Laravel Herd](https://herd.laravel.com)

Installation
------------

[](#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
-----------

[](#basic-usage)

### Creating a tunnel

[](#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

[](#running-the-tunnel)

Start the tunnel to make your local site publicly accessible.

```
php artisan cloudflared:run
```

### Deleting the tunnel

[](#deleting-the-tunnel)

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

```
php artisan cloudflared:uninstall
```

Good to know
------------

[](#good-to-know)

### Trusted proxies

[](#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](https://laravel.com/docs/requests#configuring-trusted-proxies) you'd use behind any TLS-terminating proxy. Most production apps already have this configured.

### Long-running queue workers

[](#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

[](#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
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

Credits
-------

[](#credits)

Developed by [Michael Aerni](https://michaelaerni.ch)

Support
-------

[](#support)

For issues and questions, please use the [GitHub Issues](https://github.com/aerni/laravel-cloudflared/issues) page.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance85

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~40 days

Total

5

Last Release

73d ago

Major Versions

v1.1.0 → v2.0.02026-03-25

PHP version history (2 changes)v1.0.0PHP ^8.2

v2.1.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23167701?v=4)[Michael Aerni](/maintainers/aerni)[@aerni](https://github.com/aerni)

---

Top Contributors

[![aerni](https://avatars.githubusercontent.com/u/23167701?v=4)](https://github.com/aerni "aerni (57 commits)")[![zacwebb](https://avatars.githubusercontent.com/u/12571897?v=4)](https://github.com/zacwebb "zacwebb (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/aerni-cloudflared/health.svg)

```
[![Health](https://phpackages.com/badges/aerni-cloudflared/health.svg)](https://phpackages.com/packages/aerni-cloudflared)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
