Independent testing Updated April 2026 387 self-hosting guides 5 VPS providers tested

guide

How to Self-Host Plausible on a VPS (Complete Guide)

A complete guide to self-hosting Plausible on a VPS: install, configure, and secure Plausible step by step, with recommended specs and common gotchas.

How to Self-Host Plausible on a VPS (Complete Guide)

Plausible is a lightweight and open-source web analytics tool that respects user privacy. Self-hosting Plausible on a Virtual Private Server (VPS) allows you to maintain full control over your data while benefiting from powerful analytics. In this guide, weโ€™ll walk through the steps to set up Plausible using Docker on your chosen VPS provider.

Prerequisites

Before you begin, ensure you have:

  1. A VPS: Choose a provider from the options below which are affordable and developer-friendly:

    ProviderPriceFeatures
    Contabo VPS5.99 EUR/moHigh storage options
    Hetzner Cloud4.15 EUR/moFlexible and fast performance
    DigitalOcean6 USD/moEasy to scale services
    Vultr6 USD/moGlobal availability
    Linode (Akamai Cloud)5 USD/moGreat community support
  2. A domain name: Ensure you have registered a domain name that you own.

  3. Basic knowledge of terminal commands and Docker.

  4. An appropriate Docker environment installed on your VPS.

Step 1: Setting Up Your VPS

  1. Access Your VPS: Use SSH to connect to your VPS.

    ssh root@your-vps-ip
  2. Update Your System: Always make sure your server is updated.

    apt update && apt upgrade -y
  3. Install Docker: If Docker is not installed, run the following commands:

    apt install apt-transport-https ca-certificates curl software-properties-common -y
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
    add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    apt update
    apt install docker-ce -y
  4. Install Docker Compose: You will also need Docker Compose to manage the Docker containers.

    curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    chmod +x /usr/local/bin/docker-compose

Step 2: Configure Plausible Analytics

  1. Create a Directory for Plausible: Organize your files with a dedicated directory.

    mkdir ~/plausible
    cd ~/plausible
  2. Create a Docker Compose File: Use your favorite text editor to create docker-compose.yml.

    version: '3'
    
    services:
      plausible:
        image: plausible/analytics:latest
        environment:
          - DATABASE_URL=postgres://plausible:plausible@db/plausible
          - SECRET_KEY=your-secret-key
          - PLAUSIBLE_PUBLIC_HOST=your-domain.com
        ports:
          - "8000:8000"
        depends_on:
          - db
    
      db:
        image: postgres:13
        environment:
          - POSTGRES_USER=plausible
          - POSTGRES_PASSWORD=plausible
          - POSTGRES_DB=plausible
        volumes:
          - db_data:/var/lib/postgresql/data
    
    volumes:
      db_data:
  3. Modify the Environment Variables: Ensure you replace your-secret-key with a secure random string and your-domain.com with your actual domain.

Step 3: Running Plausible

  1. Start the Services: Run the following command to launch Plausible.

    docker-compose up -d
  2. Access Plausible: Open your web browser and navigate to http://your-domain.com:8000. If everything is configured correctly, you should see the Plausible login page.

  3. Frontend Configuration: Follow the Plausible documentation to add your domain and start tracking analytics.

Step 4: Securing Your Installation

  1. Set Up HTTPS: Itโ€™s advisable to run your analytics over HTTPS. You can obtain a free SSL certificate using Letโ€™s Encrypt. Hereโ€™s a quick guide:

    apt install certbot
    certbot certonly --standalone -d your-domain.com
  2. Configure Nginx as a Reverse Proxy: If you want to serve Plausible on standard ports and add SSL.

    server {
        listen 80;
        server_name your-domain.com;
        return 301 https://$host$request_uri;
    }
    
    server {
        listen 443 ssl;
        server_name your-domain.com;
    
        ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
    
        location / {
            proxy_pass http://localhost:8000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }

FAQs

1. What is Plausible and why should I self-host it?

Plausible is an open-source web analytics tool designed to provide a simple and privacy-focused alternative to Google Analytics. By self-hosting, you control your data and ensure that usersโ€™ privacy is respected, adhering to GDPR and other privacy regulations. Additionally, you avoid vendor lock-in and can tailor the service to meet your specific needs.

2. Which VPS provider is best for self-hosting Plausible?

Choosing the best VPS provider depends on your budget, location, and performance needs. For example, Hetzner Cloud offers competitive pricing at 4.15 EUR/mo, while DigitalOcean and Vultr are popular for their easy scalability and user-friendliness at 6 USD/mo. For a full VPS comparison, check out this link. Always analyze specific features and support that align with your technical requirements before making a decision.

3. How do I monitor the health of my self-hosted Plausible service?

To monitor your self-hosted Plausible instance, you can use Dockerโ€™s built-in management commands like docker logs plausible to check for any errors or issues. Additionally, integrating monitoring solutions such as Grafana or Prometheus can provide insights into the performance and resource usage of your Docker containers. Itโ€™s essential to regularly check the operational logs to preemptively catch any potential downtime or errors.

By following these steps, you can efficiently self-host Plausible on a VPS, maintaining both performance and data privacy. Enjoy your journey in self-hosting with open-source tools!