---
title: "Installation — Plausible for Laravel | Roundly"
description: "Install via Composer, set three env variables and verify the connection with one Artisan command."
url: https://roundly-consulting.com/open-source/docs/plausible-for-laravel/installation
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Plausible for Laravel](https://roundly-consulting.com/open-source/docs/plausible-for-laravel.md)

# Installation

Require the package with Composer. The service provider and the Plausible facade alias are auto-discovered, and the four Roundly companion packages it builds on are installed automatically:

```bash
composer require roundly-consulting/plausible-for-laravel
```

Add your instance URL, API key and — optionally — a default site to .env. The key is for the Stats and Sites APIs; capturing events needs only the URL. That is all the configuration most apps need:

```bash
PLAUSIBLE_URL=https://plausible.io
PLAUSIBLE_API_KEY=your-api-key
PLAUSIBLE_SITE=my-site.com
```

The config file is optional — every key is env-backed. Publish it only to override defaults:

```bash
php artisan vendor:publish --tag="plausible-config"
```

To customise the tracking-script markup, publish the view — Plausible::script(), @plausibleScript and <x-plausible-script> all render it:

```bash
php artisan vendor:publish --tag="plausible-views"
```

There are no migrations — the package stores nothing in your database.

## Verify the connection

Once the env is set, check configuration and connectivity in one command. It fails when the URL or key is missing, the instance is unreachable, or the key is refused — add --site= to verify a Stats API key against that site:

```bash
php artisan plausible:health
```

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/plausible-for-laravel.md)
