Jump to content

Plausible: Difference between revisions

From NixOS Wiki
Klinger (talk | contribs)
first version with link to NixOS manual
 
Onny (talk | contribs)
Inital page
 
Line 1: Line 1:
[https://plausible.io/ Plausible] is a privacy-friendly alternative to Google analytics.  
[https://plausible.io/ Plausible] is a privacy-friendly alternative to Google analytics.  


It is documented in the [https://nixos.org/manual/nixos/stable/#module-services-plausible NixOS manual].
== Setup ==
At first, a secret key is needed to be generated. This can be done with e.g.<syntaxhighlight lang="bash">
openssl rand -base64 64
</syntaxhighlight>After that, <code>plausible</code> can be deployed like this:<syntaxhighlight lang="nix">services.plausible = {
  enable = true;
  adminUser = {
    # activate is used to skip the email verification of the admin-user that's
    # automatically created by plausible. This is only supported if
    # postgresql is configured by the module. This is done by default, but
    # can be turned off with services.plausible.database.postgres.setup.
    activate = true;
    email = "admin@localhost";
    passwordFile = "/run/secrets/plausible-admin-pwd";
  };
  server = {
    baseUrl = "http://analytics.example.org";
    # secretKeybaseFile is a path to the file which contains the secret generated
    # with openssl as described above.
    secretKeybaseFile = "/run/secrets/plausible-secret-key-base";
  };
};</syntaxhighlight>After applying the configuration Plausible will be available at http://localhost:8000.
 
== Usage ==
 
=== Adding users ===
The easiest way is to temporarily enable registration with the setting<syntaxhighlight lang="nix">services.plausible = {
  server = {
    [...]
    disableRegistration = false;
  };
};</syntaxhighlight>Then go to http://localhost:8000/register to add additional users and sites.
 
== See also ==
 
* Documentation in the [https://nixos.org/manual/nixos/stable/#module-services-plausible NixOS manual].


[[Category:Web Applications]]
[[Category:Web Applications]]
[[Category:Server]]
[[Category:Server]]
[[Category:NixOS Manual]]
[[Category:NixOS Manual]]

Latest revision as of 14:50, 9 April 2025

Plausible is a privacy-friendly alternative to Google analytics.

Setup

At first, a secret key is needed to be generated. This can be done with e.g.

openssl rand -base64 64

After that, plausible can be deployed like this:

services.plausible = {
  enable = true;
  adminUser = {
    # activate is used to skip the email verification of the admin-user that's
    # automatically created by plausible. This is only supported if
    # postgresql is configured by the module. This is done by default, but
    # can be turned off with services.plausible.database.postgres.setup.
    activate = true;
    email = "admin@localhost";
    passwordFile = "/run/secrets/plausible-admin-pwd";
  };
  server = {
    baseUrl = "http://analytics.example.org";
    # secretKeybaseFile is a path to the file which contains the secret generated
    # with openssl as described above.
    secretKeybaseFile = "/run/secrets/plausible-secret-key-base";
  };
};

After applying the configuration Plausible will be available at http://localhost:8000.

Usage

Adding users

The easiest way is to temporarily enable registration with the setting

services.plausible = {
  server = {
    [...]
    disableRegistration = false;
  };
};

Then go to http://localhost:8000/register to add additional users and sites.

See also