Installation
From Package Manager
The easiest way to install Vector with systemd support: Ubuntu/Debian:From Installation Script
Systemd Service File
The default systemd service file is installed at/etc/systemd/system/vector.service:
Service File Breakdown
- User/Group: Runs as dedicated
vectoruser for security - ExecStartPre: Validates configuration before starting
- ExecStart: Starts Vector (config loaded from
/etc/vector/vector.yaml) - ExecReload: Reloads configuration on
systemctl reload vector - Restart=always: Automatically restarts on failure
- AmbientCapabilities: Allows binding to privileged ports (< 1024)
- EnvironmentFile: Loads environment variables from
/etc/default/vector
Configuration
Default Configuration Location
Vector reads configuration from/etc/vector/vector.yaml:
Environment Variables
Create/etc/default/vector to set environment variables:
Service Management
Start Vector
Enable at boot
Stop Vector
Restart Vector
Reload configuration
Check status
View logs
Hardened Service Configuration
For production environments, use the hardened service file with additional security restrictions:Security Features Explained
- ProtectSystem=strict: Makes
/usr,/boot,/efiread-only - ProtectHome=yes: Makes
/homeinaccessible - PrivateTmp=yes: Provides isolated
/tmpdirectory - PrivateDevices=yes: Limits device access
- RestrictAddressFamilies: Limits to Unix, IPv4, and IPv6 sockets only
- NoNewPrivileges=yes: Prevents privilege escalation
- SystemCallFilter: Restricts allowed system calls
- MemoryDenyWriteExecute=yes: Prevents memory exploitation techniques
Multi-Instance Deployment
Run multiple Vector instances on the same host:Create Instance Configuration
Agent Instance Service
Aggregator Instance Service
Enable and Start Instances
User and Permissions
The Vector service runs as thevector user, created during installation:
File Permissions
Monitoring and Debugging
Check Vector is running
View resource usage
Detailed status
Validate configuration
Check Vector version
Test configuration changes
Troubleshooting
Service fails to start
Configuration reload fails
High memory usage
Permission denied errors
Upgrading
Using Package Manager
Manual Upgrade
Best Practices
Configuration Management
- Store configurations in version control
- Validate configuration before deploying
- Use
/etc/default/vectorfor environment-specific settings - Test changes in non-production first
Security
- Use the hardened service configuration in production
- Run as dedicated
vectoruser (never root) - Apply principle of least privilege for file access
- Use systemd credentials for secrets instead of environment variables
- Regularly update Vector to get security patches
Reliability
- Enable automatic restart:
Restart=always - Configure appropriate restart limits
- Use disk buffers for critical data pipelines
- Monitor systemd journal for errors
- Set up alerting for service failures
Performance
- Tune thread count via
VECTOR_THREADS - Monitor resource usage with
systemctl status - Use appropriate log levels (avoid
tracein production) - Implement log rotation for Vector’s own logs
- Configure memory limits to prevent OOM
Maintenance
- Regularly check logs:
journalctl -u vector - Monitor disk usage of
/var/lib/vector - Test configuration reloads before applying
- Keep Vector updated to latest stable version
- Document any custom service file modifications