Advanced Configuration
This guide covers all configuration options for ANTE ERP self-hosted installations.
Configuration Methods
ANTE ERP can be configured through:
- Environment Variables (
.envfile) - Recommended - Docker Compose (
docker-compose.yml) - Infrastructure settings - Application Settings (Web Interface) - Runtime configuration
Environment Variables Reference
Database Configuration
PostgreSQL
bash
# Connection String (Pooled)
DATABASE_URL=postgresql://ante:password@postgres:5432/ante_db?schema=public&connection_limit=10
# Direct Connection (for migrations)
DIRECT_URL=postgresql://ante:password@postgres:5432/ante_db?schema=public
# Individual Components (alternative format)
DB_HOST=postgres
DB_PORT=5432
DB_USERNAME=ante
DB_PASSWORD=your_password
DB_DATABASE=ante_dbConnection Limit: Adjust based on expected concurrent users
- Small (5-20 users):
connection_limit=10 - Medium (20-50 users):
connection_limit=20 - Large (50+ users):
connection_limit=50
Redis
bash
# Redis Configuration
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=your_redis_password
REDIS_DB=0
REDIS_TLS=false
# Connection Pool
REDIS_MAX_RETRIES=3
REDIS_CONNECT_TIMEOUT=10000
# Cache TTL (Time To Live in seconds)
CACHE_TTL=3600 # 1 hour defaultMongoDB
bash
# MongoDB Connection
MONGODB_URI=mongodb://ante:password@mongodb:27017/ante?authSource=admin
# With replication (for high availability)
MONGODB_URI=mongodb://ante:password@mongo1:27017,mongo2:27017,mongo3:27017/ante?replicaSet=rs0&authSource=admin
# Connection Pool Settings
MONGODB_POOL_SIZE=10Security Configuration
bash
# JWT (JSON Web Token) Configuration
JWT_SECRET=your-very-long-random-secret-minimum-32-characters
JWT_EXPIRATION=24h # Options: 1h, 12h, 24h, 7d, 30d
JWT_REFRESH_EXPIRATION=7d
# Developer API Key (for API integrations)
DEVELOPER_KEY=your-16-character-dev-key
# Encryption Key (for sensitive data)
ENCRYPTION_KEY=your-16-character-enc-key
# Password Policy
PASSWORD_MIN_LENGTH=8
PASSWORD_REQUIRE_UPPERCASE=true
PASSWORD_REQUIRE_LOWERCASE=true
PASSWORD_REQUIRE_NUMBER=true
PASSWORD_REQUIRE_SPECIAL=true
# Session Configuration
SESSION_TIMEOUT=3600 # 1 hour in seconds
SESSION_ABSOLUTE_TIMEOUT=86400 # 24 hoursApplication URLs
bash
# Frontend URL (user-facing application)
FRONTEND_URL=https://erp.yourcompany.com
# Backend API URL
API_URL=https://api.yourcompany.com
# WebSocket URL
SOCKET_URL=wss://api.yourcompany.com
# Internal URLs (if different)
INTERNAL_API_URL=http://backend:3001Email Configuration (SMTP)
bash
# SMTP Server Configuration
SMTP_HOST=smtp.gmail.com # or your SMTP server
SMTP_PORT=587 # 587 (TLS) or 465 (SSL)
SMTP_SECURE=false # true for 465, false for 587
SMTP_USERNAME=your-email@gmail.com
SMTP_PASSWORD=your-app-specific-password
# Sender Information
SMTP_FROM_EMAIL=noreply@yourcompany.com
SMTP_FROM_NAME=ANTE ERP
# Email Options
SMTP_TIMEOUT=30000 # 30 seconds
SMTP_MAX_CONNECTIONS=5
SMTP_RATE_LIMIT=10 # emails per secondPopular SMTP Providers:
| Provider | Host | Port | Secure |
|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | false |
| Outlook | smtp-mail.outlook.com | 587 | false |
| SendGrid | smtp.sendgrid.net | 587 | false |
| Mailgun | smtp.mailgun.org | 587 | false |
| Amazon SES | email-smtp.region.amazonaws.com | 587 | false |
File Upload Configuration
bash
# Upload Limits
UPLOAD_MAX_SIZE=10485760 # 10MB in bytes
UPLOAD_MAX_FILES=10 # Maximum files per upload
# Allowed File Types (MIME types)
UPLOAD_ALLOWED_TYPES=image/*,application/pdf,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document
# Storage Location
UPLOAD_DIRECTORY=/app/uploads
# External Storage (Optional - for cloud storage)
# AWS S3
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
AWS_S3_BUCKET=your-bucket-name
AWS_S3_REGION=us-east-1
# DigitalOcean Spaces
DO_SPACES_KEY=your-spaces-key
DO_SPACES_SECRET=your-spaces-secret
DO_SPACES_BUCKET=your-bucket-name
DO_SPACES_REGION=nyc3
DO_SPACES_ENDPOINT=https://nyc3.digitaloceanspaces.comMonitoring & Logging
bash
# Application Logging
LOG_LEVEL=info # Options: error, warn, info, debug
LOG_FORMAT=json # Options: json, text
LOG_FILE_ENABLED=true
LOG_FILE_PATH=/app/logs/app.log
LOG_FILE_MAX_SIZE=10m
LOG_FILE_MAX_FILES=7
# Error Tracking (Sentry)
SENTRY_DSN=https://your-sentry-dsn@sentry.io/project-id
SENTRY_ENVIRONMENT=production
SENTRY_TRACES_SAMPLE_RATE=0.1 # 10% of transactions
# Performance Monitoring (New Relic)
NEW_RELIC_LICENSE_KEY=your-license-key
NEW_RELIC_APP_NAME=ANTE-ERP-Production
NEW_RELIC_LOG_LEVEL=info
# Prometheus Metrics
METRICS_ENABLED=true
METRICS_PORT=9090Performance Tuning
bash
# Node.js Configuration
NODE_ENV=production
NODE_OPTIONS=--max-old-space-size=4096 # 4GB heap
# Worker Processes
WORKERS=4 # Number of worker processes (based on CPU cores)
# Rate Limiting
RATE_LIMIT_ENABLED=true
RATE_LIMIT_WINDOW=900000 # 15 minutes in ms
RATE_LIMIT_MAX_REQUESTS=100 # requests per window
# Queue Configuration
QUEUE_CONCURRENCY=5
QUEUE_ATTEMPTS=3
QUEUE_BACKOFF_DELAY=5000 # 5 seconds
# Cache Configuration
CACHE_ENABLED=true
CACHE_TYPE=redis # Options: redis, memory
CACHE_DEFAULT_TTL=3600 # 1 hourFeature Flags
bash
# Module Enablement
MODULE_PROJECTS_ENABLED=true
MODULE_HR_ENABLED=true
MODULE_PAYROLL_ENABLED=true
MODULE_ASSETS_ENABLED=true
MODULE_TREASURY_ENABLED=true
MODULE_LEADS_ENABLED=true
# Feature Toggles
FEATURE_AI_ASSISTANT=false
FEATURE_MOBILE_APP=true
FEATURE_OFFLINE_MODE=false
FEATURE_DARK_MODE=true
# Experimental Features
EXPERIMENTAL_FEATURES=falseNotification Configuration
bash
# Email Notifications
NOTIFICATIONS_EMAIL_ENABLED=true
NOTIFICATIONS_EMAIL_DIGEST=daily # Options: realtime, hourly, daily, weekly
# In-App Notifications
NOTIFICATIONS_PUSH_ENABLED=true
NOTIFICATIONS_SOUND_ENABLED=true
# Telegram Notifications (Optional)
TELEGRAM_BOT_TOKEN=your-bot-token
TELEGRAM_CHAT_ID=your-chat-idLocalization & Timezone
bash
# Default Language
DEFAULT_LANGUAGE=en # Options: en, es, fr, de, etc.
# Timezone
TZ=Asia/Manila # Use IANA timezone identifier
DEFAULT_TIMEZONE=Asia/Manila
# Date/Time Format
DATE_FORMAT=YYYY-MM-DD
TIME_FORMAT=HH:mm:ss
DATETIME_FORMAT=YYYY-MM-DD HH:mm:ss
# Currency
DEFAULT_CURRENCY=PHP # ISO 4217 currency code
CURRENCY_SYMBOL=₱Backup Configuration
bash
# Automated Backups
BACKUP_ENABLED=true
BACKUP_SCHEDULE=0 2 * * * # Cron format (2 AM daily)
BACKUP_RETENTION_DAYS=30
BACKUP_LOCATION=/backups
# Backup Notifications
BACKUP_NOTIFY_ON_SUCCESS=false
BACKUP_NOTIFY_ON_FAILURE=true
BACKUP_NOTIFICATION_EMAIL=admin@yourcompany.comDocker Compose Configuration
Port Mapping
Change default ports in docker-compose.yml:
yaml
services:
frontend:
ports:
- "80:80" # Change 8080 to 80 for standard HTTP
backend:
ports:
- "443:3001" # Or use reverse proxy
- "4001:4001" # WebSocket portResource Limits
Set memory and CPU limits:
yaml
services:
backend:
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G
reservations:
cpus: '1.0'
memory: 1G
postgres:
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 512MRestart Policies
yaml
services:
backend:
restart: unless-stopped # Options: no, always, on-failure, unless-stoppedExternal Databases
Use external managed databases:
yaml
services:
# Remove local postgres, redis, mongodb services
backend:
environment:
DATABASE_URL: postgresql://user:pass@external-db.com:5432/db
REDIS_HOST: external-redis.com
MONGODB_URI: mongodb+srv://user:pass@cluster.mongodb.net/dbCustom Volumes
Map to specific directories:
yaml
volumes:
backend_uploads:
driver: local
driver_opts:
type: none
o: bind
device: /mnt/storage/ante-uploadsApplication Configuration (Web Interface)
After installation, configure these through the web interface:
Company Settings
- Navigate to Settings → Company
- Configure:
- Company name and logo
- Address and contact information
- Business registration details
- Fiscal year settings
User Management
- Settings → Users & Roles
- Create user roles with specific permissions
- Define approval hierarchies
- Set up departments and teams
Module Configuration
- Settings → Modules
- Enable/disable modules
- Configure module-specific settings
- Set default values
Email Templates
- Settings → Email Templates
- Customize notification templates
- Configure email signatures
- Set up automated reminders
Configuration Profiles
Development Profile
bash
NODE_ENV=development
LOG_LEVEL=debug
CACHE_ENABLED=false
RATE_LIMIT_ENABLED=falseStaging Profile
bash
NODE_ENV=staging
LOG_LEVEL=info
SENTRY_ENVIRONMENT=staging
METRICS_ENABLED=trueProduction Profile
bash
NODE_ENV=production
LOG_LEVEL=warn
CACHE_ENABLED=true
RATE_LIMIT_ENABLED=true
SENTRY_ENVIRONMENT=production
METRICS_ENABLED=trueConfiguration Best Practices
Security
- Never commit
.envfiles to version control - Use strong, unique passwords for all services
- Rotate keys regularly (JWT secret, API keys)
- Limit database user permissions to minimum required
- Enable HTTPS for all production deployments
Performance
- Enable Redis caching for better performance
- Configure connection pooling based on user count
- Set appropriate resource limits in Docker
- Use CDN for static assets (optional)
- Enable compression for API responses
Reliability
- Configure automated backups
- Set up monitoring and alerts
- Use health checks in Docker
- Configure log rotation
- Test disaster recovery procedures
Scalability
- Use external managed databases for large deployments
- Configure multiple workers for backend
- Use load balancer for high availability
- Separate read replicas for databases
- Use Redis Cluster for distributed caching
Troubleshooting Configuration Issues
Environment Variables Not Applied
bash
# Recreate containers to apply changes
docker compose down
docker compose up -d
# Or restart specific service
docker compose restart backendConfiguration Validation
bash
# Check environment variables are loaded
docker compose exec backend printenv | grep -E "DATABASE|REDIS|MONGO"
# Test database connection
docker compose exec backend npm run db:testView Effective Configuration
bash
# View backend configuration
docker compose exec backend cat /app/.env
# View all environment variables
docker compose configNext Steps
Last Updated: October 27, 2025
