> ## Documentation Index
> Fetch the complete documentation index at: https://cloud.laravel.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Build add-ons

> Install software that Laravel Cloud's base images don't include, such as FFmpeg, Chromium for Puppeteer, or LibreOffice.

## Introduction

Laravel Cloud builds your application on a [base image](https://cloud.laravel.com/docs/base-images.md) for its runtime. Build add-ons install software those images don't include, such as FFmpeg, Chromium for Puppeteer, or LibreOffice. Cloud installs your environment's add-ons into its image each time it builds a deployment, so the software is available to your web instances, workers, and commands.

## Adding an add-on

You select add-ons for each environment:

**1. Open the environment's settings**

Navigate to your environment's **Settings > General** page and find the **Build configuration** section.

**2. Select your add-ons**

Open the **Add-ons** selector and choose the add-ons your application needs. The selector lists the add-ons your organization's plan includes that support your environment's language.

**3. Save and redeploy**

Save your changes and deploy the environment. Cloud installs add-ons into a freshly built image, so a change takes effect only after you redeploy.

The first deployment that includes a new add-on may take longer than usual while Cloud builds and caches the updated image. Later deployments use the cached image.

After the deployment finishes, you may check that an add-on is installed from your environment's [**Commands** tab](https://cloud.laravel.com/docs/environments.md#commands). For example, run `ffmpeg -version` to check FFmpeg, or `php -m` to list loaded PHP extensions.

Plain HTML sites don't support add-ons. For static site generators, add-ons are available during the build, but they don't carry over to the image that serves your site.

## Available add-ons

Add-ons are free. Each plan includes the add-ons of the plans before it. For example, the Business plan includes every Starter and Growth add-on. To use an add-on your plan doesn't include, [change your plan](https://cloud.laravel.com/docs/pricing.md#plans).

Add-ons that support all languages work with PHP-FPM, Octane, Node.js, Bun, Deno, Go, Python, Ruby, and Rust.

### Starter

| Add-on | What it installs | Languages |
| - | - | - |
| **ImageMagick** | The `imagick` PHP extension, so your PHP code can call ImageMagick. The PHP base images already include the ImageMagick command-line tools. | PHP |
| **GnuPG** | GnuPG and the `gnupg` PHP extension, for encryption, decryption, and signing | PHP |

### Growth

| Add-on | What it installs | Languages |
| - | - | - |
| **Puppeteer** | Chromium, with the browser libraries and fonts that Puppeteer needs. Your application still declares its own Puppeteer package. | All |
| **FFmpeg** | FFmpeg, with additional codecs | All |
| **wkhtmltopdf** | wkhtmltopdf, with Xvfb and DejaVu fonts | All |
| **LibreOffice** | Headless LibreOffice Writer, common document fonts, qpdf, and the MuPDF command-line tools | All |
| **MuPDF** | MuPDF and its `mutool` command | All |
| **qpdf** | qpdf | All |
| **c2patool** | c2patool, for signing, verifying, and inspecting Content Credentials (C2PA) manifests | All |
| **Valkey Glide** | The [Valkey GLIDE](https://github.com/valkey-io/valkey-glide-php) PHP client, as the `valkey_glide` extension | PHP |

### Business

| Add-on | What it installs | Languages |
| - | - | - |
| **Datadog** | The Datadog PHP tracer, with profiling and App and API Protection enabled, and the Datadog trace agent. See [configuring Datadog](#configuring-datadog-for-php). | PHP |
| **Kafka** | The `rdkafka` PHP extension and librdkafka | PHP |
| **Oracle DB** | The `oci8` and `pdo_oci` PHP extensions, Oracle Instant Client, and SQL\*Plus | PHP |

### Enterprise

| Add-on | What it installs | Languages |
| - | - | - |
| **ClamAV** | The ClamAV antivirus daemon (`clamd`) and `freshclam`, for scanning uploads. Cloud runs both alongside your application and keeps its virus signatures up to date. `clamd` uses about 1 GB of memory on each instance. | All |

### Changing plans

If you move to a plan that doesn't include an add-on one of your environments uses, Cloud keeps installing that add-on in the environment's deployments. The next time you save that environment's **General** settings, for any change, Cloud removes the add-ons your new plan doesn't include, and later deployments build without them. Before you downgrade, make sure your application doesn't depend on those add-ons.

## Configuring Datadog for PHP

Once you add the Datadog add-on to your environment, you must configure it before your application sends traces to Datadog. You have two options:

* Send traces to a remote Datadog trace agent that you host and manage yourself.
* Run a local Datadog trace agent inside each of your application's instances.

Create the configuration files using your environment's build commands. If you run a local agent, also configure it as a background process. After changing your configuration, redeploy the environment for the changes to take effect.

> [!NOTE]
>
> The local trace agent does not currently work with [managed queues](https://cloud.laravel.com/docs/queues.md). If your environment uses managed queues, send traces to a remote agent instead.

### Sending traces to a remote agent

Datadog's trace agent may run on infrastructure that you host outside of Laravel Cloud. Laravel Cloud connects to it from [stable egress IP addresses](https://cloud.laravel.com/docs/network.md#ip-addresses), so you may restrict access to the agent using IP allowlists. Private Cloud environments connect from the dedicated egress IP addresses Laravel provided during onboarding instead.

PHP loads its Datadog configuration when the process starts, so the best place for it is a `php.ini` file. Add the following to your build commands, updating `datadog.trace.agent_url` with the protocol, hostname, and port of your remote agent:

```bash theme={"theme":{"light":"min-light","dark":"material-theme-palenight"}}
cat > /usr/local/etc/php/conf.d/99-datadog.ini <<'EOF'
datadog.trace.agent_url = https://your-hostname.tld:8126
datadog.trace.agent_connect_timeout = 2000
datadog.trace.agent_timeout = 5000
datadog.service = foo-bar-api
datadog.env = staging
datadog.trace.sample_rate = 1.0
datadog.trace.enabled = On
EOF
```

### Running a local trace agent

Alternatively, you may run the trace agent locally within each application instance. This approach requires three steps: configuring PHP, configuring the trace agent, and running the agent as a background process.

**1. Configure PHP**

Add a `php.ini` file through your build commands, as you would for a remote agent. Point `datadog.trace.agent_url` at `localhost`, or remove the setting entirely to use the default:

```bash theme={"theme":{"light":"min-light","dark":"material-theme-palenight"}}
cat > /usr/local/etc/php/conf.d/99-datadog.ini <<'EOF'
datadog.trace.agent_url = http://localhost:8126
datadog.trace.agent_connect_timeout = 2000
datadog.trace.agent_timeout = 5000
datadog.service = foo-bar-api
datadog.env = staging
datadog.trace.sample_rate = 1.0
datadog.trace.enabled = On
EOF
```

**2. Configure the trace agent**

Add your Datadog API key to the environment as a custom environment variable or linked secret, such as `DD_API_KEY`. Then update your build commands to write the trace agent's configuration file:

```bash theme={"theme":{"light":"min-light","dark":"material-theme-palenight"}}
cat > /opt/datadog-agent/etc/datadog.yaml <<'EOF'
log_level: "warn"
remote_configuration:
  enabled: false
EOF

echo "api_key: $DD_API_KEY" >> /opt/datadog-agent/etc/datadog.yaml
```

Adjust the variable name if you used something other than `DD_API_KEY`.

**3. Run the trace agent**

On each App or Worker compute cluster that runs your application, configure a custom background process with the `datadog-trace-agent` command.

### Adding further configuration

You may add any additional Datadog settings to either file: the `99-datadog.ini` file for PHP configuration and the `datadog.yaml` file for the trace agent. To see the PHP options available for the `.ini` file, run `php --info | grep datadog` from the environment's **Commands** tab. To find environment variables that help identify your application within Datadog, run `printenv | grep LARAVEL_CLOUD`.

> [!TIP]
>
> If you would prefer application monitoring built for Laravel without managing agents or external configuration, take a look at [Laravel Nightwatch](https://laravel.com/nightwatch).
