Command Reference
Quick reference for common commands used in managing ANTE ERP.
Complete CLI Documentation Available
For comprehensive CLI documentation including all commands, options, and examples, see the CLI Command Reference. This page provides a quick reference for self-hosting operations.
CLI Commands (Recommended)
If you installed ANTE ERP using the CLI (ante-erp-cli), use these commands for all management tasks. The CLI provides simplified, user-friendly commands that handle complex Docker operations automatically.
Complete Documentation:
- CLI Overview - Introduction to the ANTE CLI
- CLI Command Reference - Complete command documentation
- CLI Troubleshooting - Solve CLI issues
Installation & Setup
# Install the CLI globally
npm install -g ante-erp-cli
# Check CLI version
ante --version
# Get help
ante --help
# View command-specific help
ante install --help
ante backup --helpService Management
# Check status of all services
ante status
# Start all services
ante start
# Stop all services
ante stop
# Restart all services
ante restart
# Run system health diagnostics
ante doctorViewing Logs
# View all logs (last 100 lines)
ante logs
# Follow logs in real-time
ante logs --follow
# View logs for specific service
ante logs --service backend
ante logs --service frontend
ante logs --service postgres
ante logs --service redis
ante logs --service mongodb
# View specific number of lines
ante logs --lines 200
# Follow specific service logs
ante logs --service backend --followCommon Log Commands:
# Debug backend issues
ante logs --service backend --lines 500 --follow
# Monitor all services
ante logs --follow
# Export logs to file
ante logs > logs-$(date +%Y%m%d).txtBackup & Restore
# Create full backup (all databases and volumes)
ante backup
# List available backups
ante backup list
# Restore from backup
ante restore
# Restore specific backup file
ante restore /path/to/backup.tar.gz
# Restore with confirmation prompt
ante restore --interactiveBackup Details:
- Backups include PostgreSQL, MongoDB, Redis data
- Backups include uploaded files and configuration
- Stored in
./backups/directory by default - Named with timestamp:
ante-backup-YYYYMMDD-HHMMSS.tar.gz
Database Operations
# Run database migrations
ante db migrate
# Seed database with initial data
ante db seed
# Open PostgreSQL database shell
ante db shell
# View database information
ante db info
# Optimize database performance
ante db optimize
# Clone remote database to local (⚠️ DESTRUCTIVE - replaces local data)
ante db clone-db <postgresql-url>
# Reset database (⚠️ DESTRUCTIVE - deletes all data)
ante db resetClone Remote Database
DESTRUCTIVE OPERATION
This command drops your local database schema and replaces it with data from the remote source. Always ensure you have a backup before proceeding!
The clone-db command allows you to copy a remote PostgreSQL database to your local database. This is useful for:
- Development Setup - Clone production/staging data for local development
- Testing - Test with real data in a safe environment
- Data Migration - Copy databases between servers
- Troubleshooting - Debug issues with production data locally
Basic Usage:
# Clone from remote Supabase (staging example)
ante db clone-db "postgresql://user:password@host.supabase.co:5432/postgres"
# Clone from any PostgreSQL server
ante db clone-db "postgresql://user:pass@192.168.1.100:5432/ante_db"Advanced Options:
# Skip confirmation prompts (non-interactive)
ante db clone-db "postgresql://..." --force
# Use existing backup file instead of creating new dump
ante db clone-db "postgresql://..." --skip-dump --backup-file ./backups/existing.dump
# Skip Prisma client generation and migrations
ante db clone-db "postgresql://..." --no-prismaWhat the command does:
- ✅ Parses URLs - Validates source and target database connections
- ✅ Tests connections - Verifies both databases are accessible
- ⚠️ Creates backup - Dumps remote database (timestamped in
./backups/) - ❌ Drops local schema - Removes all local data (CASCADE)
- 🔄 Restores data - Imports remote database dump
- 🔧 Runs Prisma - Generates client and applies migrations
Backup Location: Cloned databases are saved as: ./backups/clone_backup_YYYY-MM-DD_HH-MM-SS.dump
Example Workflow:
# 1. Check current local database
ante db info
# 2. Clone staging database to local
ante db clone-db "postgresql://postgres:pass@db.staging.com:5432/postgres"
# Output:
# ╔════════════════════════════════════════════════════════════╗
# ║ ANTE CLI - Clone PostgreSQL Database ║
# ╚════════════════════════════════════════════════════════════╝
#
# Step 1/6: Parsing source database URL...
# ✓ Source URL parsed successfully
# Host: db.staging.com:5432
# Database: postgres
#
# Step 2/6: Reading local database configuration...
# ✓ Local database configuration loaded
# Host: localhost:5432
# Database: ante_db
#
# Step 3/6: Testing database connections...
# ✓ Source database connection successful
# ✓ Local database connection successful
#
# ⚠️ WARNING: This will DROP and RECREATE your local database schema!
# ⚠️ All existing local data will be LOST!
#
# Configuration Summary:
# ┌─ Source Database:
# │ Host: db.staging.com:5432
# │ Database: postgres
# │
# └─ Target Database (Local):
# Host: localhost:5432
# Database: ante_db
# Schema: public
#
# ? Do you want to continue? (y/N) y
#
# Step 4/6: Dumping source database...
# ✓ Database dump completed
# File: ./backups/clone_backup_2025-10-29_14-30-00.dump
# Size: 125.5 MB
#
# Step 5/6: Restoring to local database...
# ✓ Database restore completed
#
# Step 6/6: Running Prisma operations...
# ✓ Prisma client generated
# ✓ Prisma migrations completed
#
# ╔════════════════════════════════════════════════════════════╗
# ║ Database Clone Completed Successfully! ║
# ╚════════════════════════════════════════════════════════════╝
#
# Summary:
# ✓ Source database dumped to: ./backups/clone_backup_2025-10-29_14-30-00.dump
# ✓ Restored to local database: ante_db
# ✓ Prisma client generated
# ✓ Prisma migrations applied
#
# Your local database is now cloned from the source!
# 3. Verify cloned data
ante db info
# 4. Start development server
ante startUse Cases:
Local Development with Production Data:
bash# Clone production database for local testing ante db clone-db "postgresql://prod_user:pass@production.db:5432/ante"Reuse Existing Backup:
bash# Use previously created dump file ante db clone-db "postgresql://..." \ --skip-dump \ --backup-file ./backups/clone_backup_2025-10-28_10-00-00.dumpAutomated Scripts (CI/CD):
bash# Non-interactive clone for automation ante db clone-db "postgresql://staging@host:5432/db" --force
Troubleshooting:
Connection Failed:
# Test source database connection manually
docker run --rm -e PGPASSWORD=your_password postgres:17-alpine \
psql -h host.example.com -p 5432 -U username -d database -c "SELECT 1"Permission Errors:
# Ensure your database user has sufficient privileges
# Required privileges: SELECT, CONNECT on source databaseLarge Database Timeout:
# For very large databases (>10GB), consider:
# 1. Use existing backup: --skip-dump --backup-file
# 2. Dump manually first with pg_dump
# 3. Check network bandwidth and timeout settingsMemory Issues:
# If restore fails due to memory, try:
# 1. Increase Docker memory limits
# 2. Clone smaller datasets (table-specific dumps)
# 3. Use --no-prisma and run migrations separatelySSL/HTTPS Configuration
# Enable SSL/HTTPS with automatic Let's Encrypt certificates
ante ssl enable --email admin@yourcompany.com
# Interactive mode (prompts for email and confirmation)
ante ssl enable
# Test with Let's Encrypt staging environment (recommended for testing)
ante ssl enable --email admin@yourcompany.com --staging
# Non-interactive mode
ante ssl enable --email admin@yourcompany.com --no-interactive
# Check SSL certificate status and expiry
ante ssl statusWhat ante ssl enable does:
- ✅ Installs certbot - If not already installed
- ✅ Verifies DNS - Checks domain resolution
- 🔐 Obtains certificates - From Let's Encrypt (free)
- 🔧 Configures NGINX - Updates configuration for HTTPS
- 🔄 Sets up auto-renewal - Daily check at 3:00 AM via cron/systemd
Requirements:
- Domain name configured with
ante set-domain(not localhost or IP) - Domain must resolve to your server's public IP
- Ports 80 and 443 must be open and accessible
- NGINX installed (CLI will install if needed)
- Valid email address for certificate notifications
Example Workflow:
# 1. Configure domains
ante set-domain --frontend https://erp.yourcompany.com --api https://api.yourcompany.com
# 2. Enable SSL with automatic certificates
ante ssl enable --email admin@yourcompany.com
# Output:
# 🔒 Enable SSL/HTTPS for ANTE
#
# Current Configuration:
# Frontend: http://erp.yourcompany.com
# API: http://api.yourcompany.com
#
# SSL certificates will be obtained for:
# • erp.yourcompany.com (Frontend)
# • api.yourcompany.com (API)
#
# ? Email address for certificate notifications: admin@yourcompany.com
# ? Proceed with SSL certificate installation? Yes
#
# 🚀 Starting SSL Configuration...
#
# 📋 Configuring SSL for erp.yourcompany.com...
# ✓ SSL certificate obtained for erp.yourcompany.com
# ✓ NGINX configured for HTTPS on erp.yourcompany.com
#
# 📋 Configuring SSL for api.yourcompany.com...
# ✓ SSL certificate obtained for api.yourcompany.com
# ✓ NGINX configured for HTTPS on api.yourcompany.com
#
# 🔄 Setting up automatic certificate renewal...
# ✓ Automatic SSL renewal configured (systemd timer)
#
# ✓ SSL/HTTPS Configuration Complete!
#
# Secured Domains:
# • erp.yourcompany.com
# https://erp.yourcompany.com
# • api.yourcompany.com
# https://api.yourcompany.com
#
# Certificate Details:
# Provider: Let's Encrypt
# Validity: 90 days
# Auto-renewal: Enabled (daily check at 3:00 AM)
# 3. Verify SSL status
ante ssl status
# 4. Test HTTPS access
curl -I https://erp.yourcompany.comCertificate Management:
Check status:
# View certificate expiry and status
ante ssl status
# Example output:
# 🔒 SSL Certificate Status
#
# Frontend:
# Domain: erp.yourcompany.com
# URL: https://erp.yourcompany.com
# ✓ Certificate found
# Expiry: 2026-01-27
# Days remaining: 87
# Status: Valid
#
# API:
# Domain: api.yourcompany.com
# URL: https://api.yourcompany.com
# ✓ Certificate found
# Expiry: 2026-01-27
# Days remaining: 87
# Status: ValidAuto-renewal: Certificates automatically renew when they have 30 days or less remaining. The renewal check runs:
- Modern systems: systemd timer (check with
systemctl status certbot.timer) - Legacy systems: cron job at 3:00 AM daily (
/etc/cron.d/certbot-renewal)
Manual renewal (if needed):
# Test renewal process (dry run)
sudo certbot renew --dry-run
# Force renewal (if certificate expires in >30 days)
sudo certbot renew --force-renewal --nginx
sudo systemctl reload nginxTroubleshooting:
DNS not resolving:
# Check DNS resolution
dig +short erp.yourcompany.com
# Should return your server's IP address
# If not, update your DNS records and wait for propagationPorts not accessible:
# Check firewall
sudo ufw status
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# Check if ports are listening
sudo netstat -tlnp | grep -E ':(80|443)'Certificate already exists:
# View existing certificates
sudo certbot certificates
# Renew/replace certificate
sudo certbot renew --force-renewal --nginxFor detailed SSL setup guide, see Security & SSL Configuration.
System Reset
DESTRUCTIVE OPERATION
This command completely resets your ANTE ERP system to factory defaults. Use with extreme caution!
# Reset entire system (creates mandatory backup first)
ante reset
# Skip confirmation prompt (backup still created)
ante reset --force
# Create backup without resetting
ante reset --backup-onlyWhat ante reset does:
- ✅ Mandatory backup - Creates backup before proceeding (cannot be skipped)
- ❌ Deletes all data - Removes all companies, users, and business data
- 🔄 Resets databases - Drops and recreates PostgreSQL and MongoDB
- 🆕 Prepares setup wizard - System returns to first-time setup state
- ⚠️ Requires confirmation - Must type "RESET ALL DATA" to proceed
When to use:
- Starting over with a clean installation
- Switching to different organization/company
- Resolving severe database corruption
- Testing fresh installation process
After reset:
- Navigate to your ANTE URL (e.g.,
http://localhost:9000) - Complete the setup wizard
- Create your first admin account
- Restore data from backup if needed
Backup location: Backups are stored in: ./backups/ante-backup-before-reset-[timestamp].tar.gz
Database Shell Examples:
# After running: ante db shell
# List all tables
\dt
# Describe table structure
\d table_name
# Run SQL query
SELECT * FROM users LIMIT 10;
# Exit shell
\qUpdates & Maintenance
# Update to latest version
ante update
# Check for available updates
ante update --check
# Update and restart services
ante update --restart
# View current and available versions
ante versionUpdate Process:
- Creates automatic backup before update
- Pulls latest Docker images
- Runs database migrations if needed
- Restarts services with new version
- Verifies health after update
Health & Diagnostics
# Run comprehensive health check
ante doctor
# Check specific component
ante doctor --component backend
ante doctor --component database
ante doctor --component redis
# Verbose diagnostics output
ante doctor --verboseHealth Check Includes:
- ✅ Docker service status
- ✅ Container health checks
- ✅ Database connectivity
- ✅ Redis/Cache status
- ✅ MongoDB connection
- ✅ Disk space usage
- ✅ Memory usage
- ✅ Port availability
Uninstallation
# Uninstall ANTE ERP (removes containers, keeps data)
ante uninstall
# Uninstall and remove all data (⚠️ DESTRUCTIVE)
ante uninstall --purge
# Uninstall with backup first
ante backup && ante uninstallAdvanced: Direct Docker Access
Not Recommended
Direct Docker commands bypass CLI safety features like automatic backups, health checks, and validation. Always use the CLI commands above for normal operations.
When Direct Docker Access Might Be Needed
- Advanced debugging
- Custom Docker Compose configurations
- Integration with external monitoring tools
- Development and testing scenarios
Location
The CLI creates standard Docker Compose files in the installation directory:
cd ./ante-erp/ # Or your custom installation directory
ls -la
# You'll see: docker-compose.yml, .env, and other configuration filesEssential Docker Commands
View Status:
cd ./ante-erp
docker compose psView Logs:
# All services
docker compose logs -f
# Specific service
docker compose logs -f backendRestart Services:
# Restart all
docker compose restart
# Restart specific
docker compose restart backendFor more Docker commands, see the Docker Scripts README.
Use the CLI Instead
Instead of manual Docker commands, use the CLI equivalents:
docker compose ps→ante statusdocker compose logs -f→ante logs --followdocker compose restart→ante restart
Keyboard Shortcuts
When viewing logs (ante logs --follow):
- Ctrl + C - Stop following logs
- Ctrl + Z - Suspend process
- Ctrl + D - Exit
When in database shell (ante db shell):
- Ctrl + D - Exit shell
- Ctrl + L - Clear screen
- \q - Quit (PostgreSQL)
Command Aliases (Optional)
Add these to your ~/.bashrc for quick access:
# ANTE shortcuts
alias astatus='ante status'
alias alogs='ante logs --follow'
alias arestart='ante restart'
alias abackup='ante backup'
alias aupdate='ante update'
# Navigate to installation
alias cda='cd ~/ante-erp' # or your installation directoryReload shell:
source ~/.bashrcQuick Reference
ANTE ERP - Essential Commands
==============================
Installation:
ante install Install ANTE ERP
Status & Monitoring:
ante status Service status
ante logs View logs
ante logs --follow Follow logs
ante doctor Health check
Service Management:
ante start Start services
ante stop Stop services
ante restart Restart services
Backup & Restore:
ante backup Create backup
ante backup list List backups
ante restore <file> Restore backup
Database:
ante db migrate Run migrations
ante db shell PostgreSQL shell
ante db optimize Optimize database
ante db clone-db <url> Clone remote database
SSL/HTTPS:
ante ssl enable Enable SSL/HTTPS
ante ssl status Check certificate status
Configuration:
ante set-domain Configure domains
System Reset:
ante reset Reset system (⚠️ DESTRUCTIVE)
ante reset --force Skip confirmation
ante reset --backup-only Backup without reset
Updates:
ante update Update ANTE
ante update-cli Update CLI
Help:
ante --help Show all commands
ante <command> --help Command helpNext Steps
- CLI Command Reference - Complete CLI documentation
- Troubleshooting Guide - Solve common issues
- Maintenance Guide - Backups and updates
Last Updated: 2025-10-29
