Deploying Offen
Introduction
Offen is a privacy-focused, open-source web analytics platform that takes a fundamentally different approach to tracking. Instead of collecting data secretly, Offen treats users as partners by giving them full access to their own data and the ability to delete it at any time.
Built with privacy by design, Offen uses end-to-end encryption so that even the operator cannot access individual user data. This approach makes it naturally GDPR compliant and respects user privacy while still providing valuable analytics insights.
Key highlights of Offen:
- Privacy by Design: End-to-end encryption protects user data
- User Access: Users can view and delete their own data
- GDPR Compliant: Built for privacy regulation compliance
- Consent-Based: Respects user choice about tracking
- Lightweight Script: Minimal impact on page performance
- Fair Data Exchange: Users get value from sharing data
- Self-Hosted: Complete control over your analytics data
- Anonymous Insights: Aggregate data without individual tracking
- Open Source: Apache 2.0 license with transparent development
- Simple Interface: Clean, focused analytics dashboard
This guide walks through deploying Offen on Klutch.sh using Docker.
Why Deploy Offen on Klutch.sh
Deploying Offen on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh handles the Go application deployment automatically.
Persistent Storage: Attach persistent volumes for your analytics database.
HTTPS by Default: Automatic SSL certificates for secure data transmission.
GitHub Integration: Version-controlled deployments through your repository.
Scalable Resources: Allocate CPU and memory based on traffic volume.
Environment Variable Management: Securely store configuration secrets.
Custom Domains: Use your own domain for professional analytics.
Always-On Availability: Your analytics service remains accessible 24/7.
Prerequisites
Before deploying Offen on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- A website where you want to add analytics
- (Optional) A custom domain for your Offen instance
Understanding Offen Architecture
Offen has a privacy-centric architecture:
Go Backend: Server handling data collection and the dashboard.
SQLite/PostgreSQL: Database storing encrypted analytics data.
JavaScript Client: Lightweight script embedded on tracked websites.
Encryption Layer: Client-side encryption before data leaves the browser.
Consent Management: Built-in consent flow for user control.
Deploying Offen on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 3000
- Access
https://your-app.klutch.sh/setup - Create your admin credentials
- Complete the setup process
Create Your GitHub Repository
Create a new GitHub repository for your Offen deployment configuration.
Create the Dockerfile
Create a Dockerfile in your repository root:
FROM offen/offen:latest
# Set environmentENV OFFEN_SERVER_PORT=3000ENV OFFEN_DATABASE_DIALECT=sqlite3ENV OFFEN_DATABASE_CONNECTIONSTRING=/var/opt/offen/offen.db
# Create data directoryRUN mkdir -p /var/opt/offen
EXPOSE 3000
CMD ["offen"]Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project.
Create a New App
Within your project, create a new app and connect your GitHub repository.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Configure the following environment variables:
| Variable | Value |
|---|---|
OFFEN_SECRET | Generate with offen secret |
OFFEN_SERVER_PORT | 3000 |
OFFEN_DATABASE_DIALECT | sqlite3 |
OFFEN_DATABASE_CONNECTIONSTRING | /var/opt/offen/offen.db |
Attach Persistent Volumes
Add persistent storage:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/var/opt/offen | 10 GB | Database and configuration |
Deploy Your Application
Click Deploy to start the build process.
Create Admin Account
After deployment, create your admin account:
Initial Configuration
Creating an Account
Set up your first account:
- Go to the setup page
- Create admin email and password
- Choose account name
- Complete registration
Adding Your First Website
Create an analytics account:
- Log in to the dashboard
- Click “Create new account”
- Name your account (e.g., “My Website”)
- Copy the embed code
- Add to your website
Embedding the Script
Add to your website’s HTML:
<script async src="https://your-offen.klutch.sh/script.js" data-account-id="your-account-id"></script>Using Offen
Dashboard Overview
View your analytics:
- Log in to the dashboard
- Select an account
- View page views and sessions
- Analyze referrer sources
- See geographic distribution
User Experience
What users see:
- Consent banner on first visit
- Option to opt-in or opt-out
- Access to their own data
- Ability to delete their data
- Transparent data collection
Data Retention
Configure data lifetime:
- Access account settings
- Set retention period
- Data automatically expires
- Respects user deletions
Privacy Features
End-to-End Encryption
How encryption works:
- User data encrypted in browser
- Keys never leave user’s device
- Server stores only encrypted data
- Operators cannot access individual data
User Consent
Consent management:
- Users explicitly opt-in
- No tracking without consent
- Users can withdraw anytime
- Clear explanation of data use
Data Transparency
Give users access:
- Users visit
/auditorium - View their collected data
- See what’s being tracked
- Delete data if desired
Analytics Metrics
Available Data
What Offen tracks:
- Page views
- Sessions
- Referrer sources
- Landing pages
- Exit pages
- Browser/device info
- Geographic location (approximate)
- Session duration
What’s NOT Tracked
Privacy-first design:
- No personal identification
- No cross-site tracking
- No fingerprinting
- No advertising profiles
- No third-party data sharing
Production Best Practices
Security Recommendations
- Generate strong OFFEN_SECRET
- Use HTTPS exclusively
- Regular backups
- Keep software updated
Performance
Optimize for scale:
- SQLite for small sites
- PostgreSQL for larger deployments
- Configure appropriate resources
- Monitor database size
Backup Strategy
- Database Backups: Regular SQLite/PostgreSQL backups
- Configuration: Document environment settings
- Encryption Keys: Securely store secret
Troubleshooting Common Issues
Script Not Loading
- Verify embed code is correct
- Check account ID
- Confirm HTTPS configuration
- Review browser console
No Data Appearing
- Confirm script is loading
- Check user has consented
- Verify account configuration
- Wait for data processing
Login Issues
- Verify credentials
- Check OFFEN_SECRET hasn’t changed
- Review server logs
Comparison with Other Analytics
| Feature | Offen | Google Analytics | Plausible |
|---|---|---|---|
| Privacy-First | Yes | No | Yes |
| User Data Access | Yes | No | No |
| GDPR Compliant | Native | Difficult | Yes |
| Self-Hosted | Yes | No | Yes |
| Open Source | Yes | No | Yes |
Additional Resources
Conclusion
Deploying Offen on Klutch.sh provides a truly privacy-respecting analytics solution that treats users as partners rather than products. By giving users access to their own data and using end-to-end encryption, Offen offers a fair exchange: insights for operators, transparency for users. This approach naturally achieves GDPR compliance while building trust with your audience.