PHPackages                             craftcms/cloud - 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. craftcms/cloud

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

craftcms/cloud
==============

3.11.0(3w ago)556.7k↓20.1%[1 PRs](https://github.com/craftcms/cloud/pulls)8PHPCI passing

Since Aug 21Pushed 3w ago6 watchersCompare

[ Source](https://github.com/craftcms/cloud)[ Packagist](https://packagist.org/packages/craftcms/cloud)[ RSS](/packages/craftcms-cloud/feed)WikiDiscussions 3.x Synced 2w ago

READMEChangelog (10)Dependencies (101)Versions (335)Used By (8)

[![Craft Cloud icon](https://raw.githubusercontent.com/craftcms/.github/v3/profile/product-icons/craft-cloud.svg)](https://craftcms.com/cloud "Craft Cloud")

Craft Cloud Extension
=====================

[](#craft-cloud-extension)

Welcome to [**Craft Cloud**](https://craftcms.com/cloud)!

This repository contains source code for the `craftcms/cloud` Composer package, which is required to run a Craft project on our first-party hosting platform, Craft Cloud.

When installed, the extension automatically [bootstraps](https://www.yiiframework.com/doc/guide/2.0/en/runtime-bootstrapping) itself and makes necessary [application configuration](https://craftcms.com/docs/5.x/reference/config/app.html) changes for the detected environment:

- 🌩️ **Cloud:** There’s no infrastructure settings to worry about—database, queue, cache, and session configuration is handled for you.
- 💻 **Local development:** Craft runs normally, in your favorite [development environment](https://craftcms.com/docs/5.x/install.html).

✨ To learn more about Cloud, check out [our website](https://craftcms.com/cloud)—or dive right in with [Craft Console](https://console.craftcms.com/cloud). Interested in everything the extension does to get your app ready for Cloud? Read our [Cloud extension deep-dive](https://craftcms.com/knowledge-base/cloud-extension), in the knowledge base.

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

[](#installation)

The Cloud extension can be installed in any existing Craft 4.6+ project by running `php craft setup/cloud`. Craft will add the `craftcms/cloud` package and run the extension’s own setup wizard.

Tip

This process includes the creation of a [`craft-cloud.yaml` configuration file](https://craftcms.com/knowledge-base/cloud-config) which helps Cloud understand your project’s structure and determines which versions of PHP and Node your project will use during builds and at runtime.

When you [deploy](https://craftcms.com/knowledge-base/cloud-deployment) a project to Cloud, the `cloud/up` command will run, wrapping Craft’s built-in [`up` command](https://craftcms.com/docs/5.x/reference/cli.html#up) and adding the cache and session tables (if they’re not already present).

Filesystem
----------

[](#filesystem)

When setting up your project’s assets, use the provided **Craft Cloud** filesystem type. Read more about [managing assets in Cloud projects](https://craftcms.com/knowledge-base/cloud-assets).

Testing
-------

[](#testing)

The Codeception `unit` suite on `3.x` boots Craft and expects a local test database.

```
composer test:init
composer test:up
composer test
composer test:down
```

`composer test:init` will create `tests/.env` from `tests/.env.example` if it does not already exist. `composer test:up` uses that file when starting the MySQL service defined in `tests/docker-compose.yaml`.

For local compatibility work on `3.x`, it can be helpful to keep your main checkout on the default/latest Craft 5 dependency set and use a separate Git worktree for Craft 4 so each checkout can keep its own `vendor/`, `composer.lock`, and `tests/.env` state.

```
git worktree add ../cloud-3x-craft4 3.x

# In the Craft 4 worktree:
composer update "craftcms/cms:^4.6" "craftcms/flysystem:^1.0" --with-all-dependencies --no-audit

# In your main checkout:
composer update "craftcms/cms:^5" "craftcms/flysystem:^2.0" --with-all-dependencies
```

Developer Features
------------------

[](#developer-features)

### Signed HTTP Requests

[](#signed-http-requests)

Use the module’s request signer to sign a PSR-7 request with Cloud’s signing key before sending it to any destination that can verify HTTP message signatures.

```
use craft\cloud\Module;
use GuzzleHttp\Psr7\Request;

$signer = Module::getInstance()->getRequestSigner();

$signedRequest = $signer->sign(new Request('POST', 'https://example.test/webhook'));
```

External systems can create compatible signatures without this PHP package. See [httpsig.org](https://httpsig.org/) for more information about HTTP message signatures. For example, install [`http-message-sig`](https://www.npmjs.com/package/http-message-sig) in a Node-based build environment:

```
npm install http-message-sig
```

Then a build script, e.g. on Vercel, can sign a Craft GraphQL request:

```
import crypto from 'node:crypto';
import { signatureHeadersSync } from 'http-message-sig';

const method = 'POST';
const url = process.env.CRAFT_GRAPHQL_URL;

const body = JSON.stringify({
    query: `
        {
            entries(section: "blog") {
                title
                url
            }
        }
    `,
});

const headers = {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${process.env.CRAFT_GRAPHQL_TOKEN}`,
};

const signer = {
    keyid: 'hmac',
    alg: 'hmac-sha256',
    signSync(data) {
        return crypto
            .createHmac('sha256', process.env.CRAFT_CLOUD_SIGNING_KEY)
            .update(data)
            .digest();
    },
};

const created = new Date();
const signatureHeaders = signatureHeadersSync(
    { method, url, headers, body },
    {
        key: 'sig',
        signer,
        components: ['@method', '@target-uri'],
        created,
        expires: new Date(created.getTime() + 300_000),
    },
);

const response = await fetch(url, {
    method,
    headers: {
        ...headers,
        ...signatureHeaders,
    },
    body,
});

const responseBody = await response.json();
```

The `@target-uri` value must be the exact URL being requested, including any query string.

### Signed URLs

[](#signed-urls)

Use the module’s URL signer when you need a signed URL instead of a signed HTTP request.

```
use craft\cloud\Module;

$signer = Module::getInstance()->getUrlSigner();

$signedUrl = $signer->sign('https://example.test/downloads/report.pdf?version=latest');
$isValid = $signer->verify($signedUrl);
```

URL signatures cover the URL’s path and query string, so changing either invalidates the signature.

### Template Helpers

[](#template-helpers)

#### `cloud.artifactUrl()`

[](#cloudartifacturl)

Generates a URL to a resource that was uploaded to the CDN during the build and deployment process.

```
{# Output a script tag with a build-specific URL: #}

{# You can also use the extension-provided alias: #}
{% js '@artifactBaseUrl/dist/js/app.js' %}
```

Read more about [how to use artifact URLs](https://craftcms.com/knowledge-base/cloud-builds#artifact-uRLs).

#### `cloud.isCraftCloud`

[](#cloudiscraftcloud)

`true` when the app detects it is running on Cloud infrastructure, `false` otherwise.

```
{% if cloud.isCraftCloud %}
  Welcome to Cloud!
{% endif %}
```

### Aliases

[](#aliases)

The following aliases are available, in addition to [those provided by Craft](https://craftcms.com/docs/5.x/configure.html#aliases).

#### `@web`

[](#web)

On Cloud, the `@web` alias is guaranteed to be the correct environment URL for each HTTP context, whether that be a [preview domain](https://craftcms.com/knowledge-base/cloud-domains#preview-domains) or [custom domain](https://craftcms.com/knowledge-base/cloud-domains#adding-a-domain).

#### `@artifactBaseUrl`

[](#artifactbaseurl)

Equivalent to [`cloud.artifactUrl()`](#artifactUrl), this allows [Project Config](https://craftcms.com/docs/5.x/system/project-config.html) settings to take advantage of dynamic, build-specific CDN URLs.

Configuration
-------------

[](#configuration)

Most configuration (to Craft and the extension itself) is handled directly by Cloud infrastructure, through [environment overrides](https://craftcms.com/docs/5.x/configure.html#environment-overrides). These options are provided strictly for reference, and have limited utility outside the platform.

OptionTypeDescription`artifactBaseUrl``string|null`Directly set a fully-qualified URL to build artifacts.`s3ClientOptions``array`Additional settings to pass to the `Aws\S3\S3Client` instance when accessing storage APIs.`cdnBaseUrl``string`Used when building URLs to [assets](#filesystem) and other build [artifacts](#artifacturl).`gatewayBaseUrl``string`Used when making gateway API requests.`sqsUrl``string`Determines how Craft communicates with the underlying queue provider.`projectId``string`UUID of the current project.`environmentId``string`UUID of the current [environment](https://craftcms.com/knowledge-base/cloud-environments).`buildId``string`UUID of the current [build](https://craftcms.com/knowledge-base/cloud-builds).`accessKey``string`AWS access key, used for communicating with storage APIs.`accessSecret``string`AWS access secret, used in conjunction with the `accessKey`.`accessToken``string`AWS access token.`redisUrl``string`Connection string for the environment’s Redis instance.`signingKey``string`A secret value used to protect transform URLs and sign HTTP requests.`useAssetBundleCdn``boolean`Whether or not to enable the CDN for asset bundles.`previewDomain``string|null`Set when accessing an environment from its [preview domain](https://craftcms.com/knowledge-base/cloud-domains#preview-domains).`useQueue``boolean`Whether or not to use Cloud’s SQS-backed queue driver.`region``string`The app region, chosen when creating the project.`useAssetCdn``boolean`Whether or not to enable the CDN for uploaded assets.`useArtifactCdn``boolean`Whether or not to enable the CDN for build artifacts and asset bundles.`staticCacheDuration``int`The default duration, in seconds, to statically cache requests.Tip

These options can also be set via environment overrides beginning with `CRAFT_CLOUD_`.

### Static cache

[](#static-cache)

The `StaticCache::EVENT_BEFORE_PURGE` event fires immediately before each tag purge, including the collected end-of-request batch. Listeners can modify its `tags` or cancel the purge.

When a saved element purge proceeds, its non-null site URL is included in tag-based gateway API requests as the optional `fetchUrls` field. URLs are deduplicated, and the gateway asynchronously fetches them after a successful purge to repopulate the cache. Drafts, revisions, deletions, and canceled purges do not send URLs.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance95

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community28

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 93.2% 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 ~4 days

Total

263

Last Release

25d ago

Major Versions

1.79.0 → 2.23.02026-03-20

2.23.0 → 3.0.02026-03-23

1.x-dev → 2.x-dev2026-03-26

2.23.1 → 3.0.32026-03-26

3.1.0 → 5.x-dev2026-05-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ccdf8b493035de2343c55bd889513e3af5c04d5823482a2b186ad16adb1c3e3?d=identicon)[brandonkelly](/maintainers/brandonkelly)

---

Top Contributors

[![timkelty](https://avatars.githubusercontent.com/u/18329?v=4)](https://github.com/timkelty "timkelty (951 commits)")[![deleugpn](https://avatars.githubusercontent.com/u/9533181?v=4)](https://github.com/deleugpn "deleugpn (21 commits)")[![AugustMiller](https://avatars.githubusercontent.com/u/1895522?v=4)](https://github.com/AugustMiller "AugustMiller (15 commits)")[![angrybrad](https://avatars.githubusercontent.com/u/61869?v=4)](https://github.com/angrybrad "angrybrad (14 commits)")[![jasonmccallister](https://avatars.githubusercontent.com/u/5354908?v=4)](https://github.com/jasonmccallister "jasonmccallister (10 commits)")[![bencroker](https://avatars.githubusercontent.com/u/57572400?v=4)](https://github.com/bencroker "bencroker (3 commits)")[![brianjhanson](https://avatars.githubusercontent.com/u/1843073?v=4)](https://github.com/brianjhanson "brianjhanson (2 commits)")[![jamesmacwhite](https://avatars.githubusercontent.com/u/8067792?v=4)](https://github.com/jamesmacwhite "jamesmacwhite (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (1 commits)")[![brandonkelly](https://avatars.githubusercontent.com/u/47792?v=4)](https://github.com/brandonkelly "brandonkelly (1 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/craftcms-cloud/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.9k556.2M21.5k](/packages/laravel-framework)[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

11.3k4.0k](/packages/leantime-leantime)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[azuracast/azuracast

The AzuraCast self-hosted web radio station management suite.

4.0k27.9k](/packages/azuracast-azuracast)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

762297.9k53](/packages/civicrm-civicrm-core)

PHPackages © 2026

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