🖥️ Activity Monitor

Self-Hosting Guide

Run the Computer Activity Monitor server on your own infrastructure. The free tier includes the agent API, dashboard, and your own PostgreSQL database — you own every byte. The optional support plan ($4/computer/month) adds the full reporting suite and email support.

1. Requirements

A Linux server (x64), PostgreSQL 14 or newer, and outbound HTTPS if you're on the support plan (monthly license check-in). 1 vCPU / 1 GB RAM handles dozens of agents comfortably.

2. Install

# 1. Create the database and role
sudo -u postgres createuser activity_monitor -P
sudo -u postgres createdb activity_monitor -O activity_monitor

# 2. Apply the schema and migrations (shipped in the migrations/ folder)
psql -U activity_monitor -d activity_monitor -f migrations/activity_monitor_schema.sql
for f in migrations/migration-*.sql; do
  psql -U activity_monitor -d activity_monitor -f "$f"
done

# 3. Configure
cp .env.example .env   # edit DB password, SESSION_SECRET, BASE_URL

# 4. Run (behind systemd, or your process manager of choice)
./cam-server

Then open http://your-server:8086/signup, create your company account, and download agents from the dashboard. Agents are compiled with your API key baked in — no per-machine configuration.

Example systemd unit

[Unit]
Description=Computer Activity Monitor
After=network.target postgresql.service

[Service]
WorkingDirectory=/opt/cam
ExecStart=/opt/cam/cam-server
Restart=always
User=cam

[Install]
WantedBy=multi-user.target

3. The data model

Everything your agents report lands in these tables:

TableWhat's in it
companiesYour company account, API key, settings
computersOne row per (computer_name, username) pair seen
activity_logsOne row per agent report (~every 10 min): active/idle seconds, input counts, active window, suspicious-pattern flag
activity_app_logsPer-application breakdown for each report: app name, window title (browsers only, PII-scrubbed), active/idle seconds
activity_daily_summaryDaily rollups (populated by the retention job if enabled)
company_target_appsYour configured target apps and thresholds

4. Example queries (free tier)

On the free tier you query your own data directly. Some starting points:

Active hours per user, last 7 days

SELECT c.username,
       ROUND(SUM(al.active_seconds) / 3600.0, 1) AS active_hours,
       ROUND(SUM(al.idle_seconds)   / 3600.0, 1) AS idle_hours
FROM computers c
JOIN activity_logs al ON al.computer_id = c.id
WHERE al.timestamp >= NOW() - INTERVAL '7 days'
GROUP BY c.username
ORDER BY active_hours DESC;

Top applications by time, last 30 days

SELECT aal.app_name,
       ROUND(SUM(aal.active_seconds) / 3600.0, 1) AS active_hours,
       COUNT(DISTINCT c.username) AS users
FROM activity_app_logs aal
JOIN computers c ON c.id = aal.computer_id
WHERE aal.timestamp >= NOW() - INTERVAL '30 days'
GROUP BY aal.app_name
ORDER BY active_hours DESC
LIMIT 20;

Flagged (suspicious-pattern) intervals by computer

SELECT c.computer_name, c.username,
       COUNT(*) AS flagged_intervals,
       MAX(al.timestamp) AS most_recent
FROM computers c
JOIN activity_logs al ON al.computer_id = c.id
WHERE al.suspicious_pattern = TRUE
  AND al.timestamp >= NOW() - INTERVAL '30 days'
GROUP BY c.computer_name, c.username
ORDER BY flagged_intervals DESC;

Treat a flag as a reason to have a conversation — not automated evidence of wrongdoing.

Daily activity trend, one user

SELECT DATE(al.timestamp) AS day,
       ROUND(SUM(al.active_seconds) / 3600.0, 1) AS active_hours
FROM computers c
JOIN activity_logs al ON al.computer_id = c.id
WHERE c.username = 'jsmith'
  AND al.timestamp >= NOW() - INTERVAL '30 days'
GROUP BY 1 ORDER BY 1;

5. The support plan

If you'd rather click than write SQL: the support plan ($4/computer/month, billed on actual usage reported by your server's monthly check-in) unlocks the full reporting suite — overview, per-user and per-computer reports, application usage, trends, target-app thresholds with email alerts, and shareable compliance reports — plus email support (answered within 24 business hours) and 4 hours of setup help. 30-day free trial of the reporting tools.

To get a license key, email hello@computeractivitymonitor.com. You'll set it as LICENSE_KEY in your .env and restart — reports unlock immediately. The monthly check-in sends only your key, product version, and computer count (that count is what we bill).

Support covers CAM software only — OS, PostgreSQL, and network administration are out of scope. AI-powered summaries are exclusive to the hosted plan.

Questions?

Email hello@computeractivitymonitor.com — we reply to every message.