VPS tutorial
Run self-hosted analytics on your own VPS
A VPS is a practical starting point for a small self-hosted analytics deployment because it keeps the application, storage, and operational surface understandable. The tradeoff is direct responsibility for security, capacity, backups, and uptime.
Published Technical guide by Vectr4
Category
Self-hosted analytics
Product focus
Events, funnels, sessions, journeys
Deployment
Your VPS with Docker Compose
01
Size the server for data, not only traffic
Event volume, retention, query complexity, concurrent dashboards, and backup space drive resource use. Start conservatively, measure real load, and leave storage headroom. A traffic spike can increase both ingestion work and later query cost.
02
Secure the base system
- Use SSH keys and disable password login where practical.
- Create a non-root administrative account.
- Patch the operating system and Docker regularly.
- Allow only SSH, HTTP, and HTTPS from required sources.
- Keep databases off the public interface.
03
Install and configure the stack
Install Docker Engine and the Compose plugin, then follow the vendor-specific deployment package. For Vectr4, use the Docker analytics installation guide. Put secrets in a protected environment file and review persistent volumes before starting services.
04
Add DNS, HTTPS, backups, and monitoring
Point a dedicated hostname at the server, terminate HTTPS, verify real host and protocol forwarding, and avoid caching event ingestion. Back up both data and configuration to another system. Monitor disk, memory, containers, endpoint health, and certificate expiry.
- Test one event from browser to dashboard.
- Restore a backup into an isolated environment.
- Record update and rollback steps.
- Review the broader guide to self-hosting web analytics.
05
Know when one VPS is no longer enough
Move beyond a single host when recovery objectives, event volume, query load, storage growth, or organizational requirements demand it. Scaling early adds operational complexity; scaling late risks data loss or prolonged outages. Measure before changing the architecture.
FAQ
Frequently asked questions
Which VPS provider should I use?
Choose a reputable provider with a suitable region, predictable storage and bandwidth, snapshots, documented networking, and an operational model you understand. The architecture should not depend on one brand.
How large should the VPS be?
There is no universal size. Estimate event volume and retention, start with enough memory and disk headroom, then monitor actual ingestion and query load.
Should the analytics database be public?
No. Keep databases on private interfaces or container networks and expose only the application routes that users and SDKs require.