Skip to content

Deploying Shynet

Introduction

Shynet is a modern, privacy-friendly, and detailed web analytics platform that provides powerful insights without compromising visitor privacy. Unlike traditional analytics services that track users across the web, Shynet focuses solely on your website’s traffic patterns while respecting user privacy through cookieless tracking.

Built with Django and designed for self-hosting, Shynet offers a refreshing alternative to invasive analytics platforms. It provides detailed session tracking, page performance metrics, and geographic data without requiring cookie consent banners or invasive JavaScript tracking.

Key features of Shynet include:

  • Privacy-First Design: No cookies, no cross-site tracking, and minimal data collection while still providing actionable insights
  • Detailed Analytics: Track page views, sessions, bounce rates, time on page, and user flows through your website
  • Lightweight Script: A tiny JavaScript snippet that won’t slow down your pages
  • Real-Time Dashboard: Monitor your traffic as it happens with live updating metrics
  • Multiple Sites: Track unlimited websites from a single Shynet installation
  • API Access: Programmatic access to your analytics data for custom integrations
  • User Management: Multi-user support with granular permissions per service
  • Geographic Insights: See where your visitors come from without invasive fingerprinting
  • Performance Metrics: Track page load times and Core Web Vitals
  • Open Source: Fully transparent codebase under the Apache 2.0 license

This guide walks through deploying Shynet on Klutch.sh using Docker, configuring the application with PostgreSQL, and setting up your first tracked website.

Why Deploy Shynet on Klutch.sh

Deploying Shynet on Klutch.sh provides several advantages for privacy-conscious analytics:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Shynet without complex orchestration. Push your configuration to GitHub and your analytics platform deploys automatically.

Persistent Storage: Attach persistent volumes for your PostgreSQL database and static files. Your analytics data survives container restarts and redeployments without data loss.

HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure connections for both your dashboard and the tracking script served to your websites.

GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments, keeping your deployment synchronized with your repository.

Scalable Resources: Allocate CPU and memory based on your traffic volume. Start small and scale up as your tracked sites grow.

Environment Variable Management: Securely store sensitive configuration like database credentials and secret keys through Klutch.sh’s environment variable system.

Custom Domains: Assign a custom domain to your Shynet instance for a professional, branded analytics dashboard.

Always-On Availability: Your analytics platform remains accessible 24/7 without managing your own infrastructure.

Prerequisites

Before deploying Shynet on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your Shynet configuration
  • A PostgreSQL database (Klutch.sh managed database or external provider)
  • Basic familiarity with Docker and containerization concepts
  • (Optional) A custom domain for your Shynet instance

Deploying Shynet on Klutch.sh

    Create a GitHub Repository

    Create a new GitHub repository to store your Shynet deployment configuration. This repository will contain your Dockerfile and any custom configuration files.

    Create Your Dockerfile

    Create a Dockerfile in your repository with the following content:

    FROM milesmcc/shynet:latest
    ENV DJANGO_SETTINGS_MODULE=shynet.settings
    ENV ALLOWED_HOSTS=*
    ENV DB_NAME=${DB_NAME}
    ENV DB_USER=${DB_USER}
    ENV DB_PASSWORD=${DB_PASSWORD}
    ENV DB_HOST=${DB_HOST}
    ENV DB_PORT=${DB_PORT:-5432}
    ENV SECRET_KEY=${SECRET_KEY}
    ENV TIME_ZONE=${TIME_ZONE:-UTC}
    ENV SCRIPT_USE_HTTPS=True
    ENV ACCOUNT_SIGNUPS_ENABLED=False
    EXPOSE 8080
    CMD ["./entrypoint.sh"]

    Push Your Repository to GitHub

    Commit and push your Dockerfile to your GitHub repository.

    Create a PostgreSQL Database

    Set up a PostgreSQL database for Shynet. You can use Klutch.sh’s managed database service or an external PostgreSQL provider. Note down the connection details: host, port, database name, username, and password.

    Generate a Secret Key

    Generate a secure secret key for Django. You can use any secure random string generator to create a 50+ character string.

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project for your Shynet deployment.

    Create a New App

    Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Shynet Dockerfile.

    Configure Environment Variables

    In the environment variables section, add the following:

    VariableValue
    DB_NAMEYour PostgreSQL database name
    DB_USERYour PostgreSQL username
    DB_PASSWORDYour PostgreSQL password
    DB_HOSTYour PostgreSQL host address
    DB_PORT5432 (or your custom port)
    SECRET_KEYYour generated secret key
    TIME_ZONEYour timezone (e.g., America/New_York)

    Configure HTTP Settings

    Set the traffic type to HTTP and configure the internal port to 8080.

    Attach Persistent Storage

    Add a persistent volume for static files:

    Mount PathRecommended SizePurpose
    /var/www/shynet/static1 GBStatic files and assets

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will build your container, attach the persistent volume, and start your Shynet instance.

    Create Admin User

    After deployment, access your app’s console through Klutch.sh and run the following command to create your admin user:

    python manage.py createsuperuser

    Access Your Dashboard

    Once deployment completes, access your Shynet dashboard at your app’s URL and log in with your admin credentials.

Configuring Your First Website

After logging into Shynet, you can start tracking your first website:

  1. Navigate to the Services section in the dashboard
  2. Click “New Service” to add a website
  3. Enter your website’s name and homepage URL
  4. Copy the generated tracking script
  5. Add the script to your website’s HTML before the closing </body> tag

The tracking script is lightweight and privacy-friendly, requiring no cookie consent banners.

Additional Resources

Conclusion

Deploying Shynet on Klutch.sh gives you a powerful, privacy-respecting analytics platform with automatic builds, persistent storage, and secure HTTPS access. By self-hosting your analytics, you maintain complete control over your data while providing your website visitors with the privacy they deserve.

With Shynet, you can gain valuable insights into your website traffic without contributing to the surveillance economy. The combination of detailed analytics and privacy-first design makes it an excellent choice for developers, businesses, and anyone who values both data and ethics.