CLI Command Reference
Complete reference for all ANTE CLI commands. All commands are accessible via the ante command after installing the CLI globally.
Command Format
ante <command> [options]
ante <command> <subcommand> [options]Global Options
These options work with most commands:
--help,-h- Display help for a command--version,-v- Display CLI version
Installation & Setup
ante install
Install ANTE ERP on your system.
Usage:
ante install [options]Options:
Installation Location:
-d, --dir <path>- Installation directory (default:./ante-erp)
Domain Configuration:
--frontend-domain <url>- Frontend domain/URL (e.g.,https://erp.company.com)--api-domain <url>- API domain/URL (e.g.,https://api.company.com)
Port Configuration:
--port <port>- Frontend port (default:8080)
Frontend App Selection:
--with-facial- Install Facial Recognition Web app--with-gate- Install Gate App (school attendance management)--with-guardian- Install Guardian App (parent portal)--with-pos- Install Point of Sale (POS) app--with-all-frontends- Install all frontend applications
Installation Preset:
--preset <type>- Installation preset:minimal,standard, orenterprise(default:standard)
Installation Behavior:
--no-interactive- Non-interactive mode with defaults--skip-checks- Skip system requirements check (not recommended)
Examples:
Basic Installation:
# Interactive installation (recommended for first-time users)
ante install
# Non-interactive with custom directory
ante install --dir /opt/ante-erp --no-interactive
# Custom port
ante install --port 9000Frontend App Selection:
# Install with Facial Recognition app
ante install --with-facial
# Install with Gate App (school attendance)
ante install --with-gate
# Install with Guardian App (parent portal)
ante install --with-guardian
# Install with POS app
ante install --with-pos
# Install all frontend apps
ante install --with-all-frontends
# Install specific combination of apps
ante install --with-gate --with-guardian --with-facialDomain and SSL Configuration:
# Enterprise preset with domain configuration
ante install \
--preset enterprise \
--frontend-domain https://erp.company.com \
--api-domain https://api.company.com
# Install with all apps and domain configuration
ante install \
--with-all-frontends \
--frontend-domain https://erp.company.com \
--api-domain https://api.company.comAdvanced Installation:
# Complete custom installation with all options
ante install \
--dir /opt/ante-erp \
--preset enterprise \
--frontend-domain https://erp.company.com \
--api-domain https://api.company.com \
--port 8080 \
--with-all-frontends \
--no-interactive
# Skip system checks (for Docker-only environments)
ante install --skip-checks --no-interactiveWhat it does:
- Checks system requirements (Docker, disk space, etc.)
- Generates secure credentials for all services
- Creates Docker Compose configuration
- Pulls Docker images
- Starts all services
- Runs database migrations
- Performs health checks
- Saves credentials to
installation-credentials.txt
Service Management
ante start
Start ANTE services.
Usage:
ante start [options]Options:
-s, --service <name>- Start specific service only
Examples:
# Start all services
ante start
# Start specific service
ante start --service backend
ante start --service frontend
ante start --service postgresAvailable Services:
backend- NestJS API serverfrontend- Vue.js frontend applicationpostgres- PostgreSQL databaseredis- Redis cache and queuemongodb- MongoDB document database
ante stop
Stop ANTE services.
Usage:
ante stop [options]Options:
-s, --service <name>- Stop specific service only
Examples:
# Stop all services
ante stop
# Stop specific service
ante stop --service backendNote: Stopping services does not delete data. All data is preserved in Docker volumes.
ante restart
Restart ANTE services.
Usage:
ante restart [options]Options:
-s, --service <name>- Restart specific service only
Examples:
# Restart all services
ante restart
# Restart backend only (useful after configuration changes)
ante restart --service backendStatus & Monitoring
ante status
Show current status of all ANTE services.
Usage:
ante statusAlias: ante ps
Output includes:
- Service name
- Running state (running/stopped)
- Health status (healthy/unhealthy)
- Port mappings
Example output:
📊 ANTE ERP Status
┌──────────┬─────────────┬───────────┬──────────────┐
│ Service │ Status │ Health │ Ports │
├──────────┼─────────────┼───────────┼──────────────┤
│ backend │ ● running │ ✓ healthy │ 3001→3000 │
│ frontend │ ● running │ ✓ healthy │ 8080→80 │
│ postgres │ ● running │ ✓ healthy │ 5433→5432 │
│ redis │ ● running │ ✓ healthy │ 6380→6379 │
│ mongodb │ ● running │ ✓ healthy │ 27018→27017 │
└──────────┴─────────────┴───────────┴──────────────┘
✓ All services runningante health / ante doctor
Run comprehensive health checks on your ANTE installation.
Usage:
ante health
ante doctor # aliasChecks performed:
- Docker daemon status
- Docker Compose version
- Service health status
- Database connectivity
- Disk space availability
- Memory usage
- Network connectivity
- Configuration validity
Example output:
🔍 ANTE System Health Check
System Requirements:
✓ Docker: 24.0.7 (OK)
✓ Docker Compose: v2.23.0 (OK)
✓ Node.js: v24.0.0 (OK)
Resources:
✓ Disk Space: 45GB free (OK)
✓ Memory: 12GB available (OK)
Services:
✓ Backend: Running, healthy
✓ Frontend: Running, healthy
✓ PostgreSQL: Running, healthy
✓ Redis: Running, healthy
✓ MongoDB: Running, healthy
Databases:
✓ PostgreSQL: Connected
✓ Redis: Connected
✓ MongoDB: Connected
✓ All health checks passedante logs
View logs from ANTE services.
Usage:
ante logs [options]Options:
-s, --service <name>- View logs for specific service-f, --follow- Follow log output (real-time)-n, --lines <number>- Number of lines to show (default: 100)--since <time>- Show logs since timestamp (e.g.,10m,1h,2025-10-27)
Examples:
# View last 100 lines from all services
ante logs
# Follow logs in real-time
ante logs --follow
# View backend logs only
ante logs --service backend
# View last 500 lines of backend logs
ante logs --service backend --lines 500
# Follow backend logs (useful for debugging)
ante logs --service backend --follow
# View logs from last 30 minutes
ante logs --since 30m
# Export logs to file
ante logs > ante-logs-$(date +%Y%m%d).txtAvailable Services:
backendfrontendpostgresredismongodb
Backup & Restore
ante backup
Create a complete backup of your ANTE ERP installation.
Usage:
ante backup [options]Alias: ante dump
Options:
-o, --output <path>- Custom output file path-k, --keyword <text>- Add keyword to backup filename for easier identification--clean- Clean up backups older than 24 hours before creating new backup
Examples:
# Create full backup (default timestamped filename)
ante backup
# Create backup with custom path
ante backup -o /backups/ante-backup-before-update.tar.gz
# Create backup with keyword for easy identification
ante backup -k before-major-update
# Create backup and clean old backups (older than 24 hours)
ante backup --clean
# Combine keyword and cleanup
ante backup -k production-snapshot --clean
# Custom path with keyword
ante backup -o /backups/custom-backup.tar.gz -k pre-migrationWhat's included:
- PostgreSQL database (full dump)
- MongoDB database
- Redis data
- Uploaded files and attachments
- Environment configuration
- Docker Compose configuration
Backup location: Backups are stored in ./backups/ directory by default.
Filename formats:
- Default:
ante-backup-YYYY-MM-DD-HHMMSS-AM/PM.tar.gz - With keyword:
ante-backup-YYYY-MM-DD-HHMMSS-AM/PM-<keyword>.tar.gz - Custom path: Uses the path you specify with
-ooption
Keyword feature: The -k, --keyword option adds a meaningful identifier to the backup filename, making it easier to find specific backups later.
Examples with keywords:
# Before database migration
ante backup -k pre-migration
# Creates: ante-backup-2025-11-17-143022-PM-pre-migration.tar.gz
# Before major version update
ante backup -k v2.0-upgrade
# Creates: ante-backup-2025-11-17-143022-PM-v2.0-upgrade.tar.gz
# Production snapshot
ante backup -k production-snapshot
# Creates: ante-backup-2025-11-17-143022-PM-production-snapshot.tar.gzCleanup feature: The --clean option automatically removes backups older than 24 hours before creating a new backup. This helps manage disk space by removing old backups.
ante backup list
List all available backups.
Usage:
ante backup listExample output:
💾 Available Backups
┌──────────────────────────────────────────┬─────────┬──────────────────────┐
│ Filename │ Size │ Created │
├──────────────────────────────────────────┼─────────┼──────────────────────┤
│ ante-backup-2025-10-27-143022.tar.gz │ 245 MB │ 2025-10-27 14:30:22 │
│ ante-backup-2025-10-26-090015.tar.gz │ 238 MB │ 2025-10-26 09:00:15 │
│ ante-backup-2025-10-25-183045.tar.gz │ 230 MB │ 2025-10-25 18:30:45 │
└──────────────────────────────────────────┴─────────┴──────────────────────┘
3 backups found (713 MB total)ante restore
Restore ANTE from a backup file (local or S3).
Usage:
ante restore [file] [options]Options:
--force- Skip confirmation prompts
Examples:
# Interactive restore (shows both local and S3 backups)
ante restore
# Restore specific backup file
ante restore ./backups/ante-backup-2025-10-27-143022.tar.gz
# Restore without confirmation
ante restore ./backups/ante-backup-2025-10-27-143022.tar.gz --forceInteractive Selection:
When you run ante restore without specifying a file, it automatically detects both local and S3 backups (if daily backup is configured):
$ ante restore
Found 8 backup(s):
Local: 3
S3: 5
? Select backup to restore:
❯ [S3] ante-backup-2025-11-18_03-00-00-AM.tar.gz (287.45 MB) - today
[S3] ante-backup-2025-11-17_03-00-00-AM.tar.gz (285.32 MB) - 1 day ago
[S3] ante-backup-2025-11-16_03-00-00-AM.tar.gz (283.19 MB) - 2 days ago
[LOCAL] ante-backup-2025-11-15_03-00-00-AM.tar.gz (280.00 MB) - 3 days ago
[LOCAL] ante-backup-2025-11-14_03-00-00-AM.tar.gz (278.00 MB) - 4 days agoFeatures:
- ✅ Unified view - Shows both local and S3 backups in one list
- ✅ Auto-download - Automatically downloads S3 backups before restoring
- ✅ Progress tracking - Shows download progress for S3 backups
- ✅ Smart sorting - Newest backups appear first
- ✅ Relative timestamps - Shows "today", "1 day ago", etc.
S3 Download Progress:
When you select an S3 backup, it's automatically downloaded with progress tracking:
⠹ Downloading from S3... 47% (135.23 MB / 287.45 MB)
✓ Downloaded backup from S3: ante-backup-2025-11-18_03-00-00-AM.tar.gzMulti-Server Setup:
If you use the same S3 bucket for multiple servers, backups are automatically isolated by server IP. Each server only sees its own backups:
your-bucket/
├── 143.198.91.153/ # Production server backups
├── 178.128.49.38/ # Staging server backups
└── 192.168.1.100/ # Development server backupsThis prevents accidental cross-server restores.
⚠️ Warning: Restoring will overwrite all current data. This operation cannot be undone.
What it does:
- Downloads from S3 if remote backup selected (with progress)
- Stops all services
- Extracts backup archive
- Restores PostgreSQL database
- Restores MongoDB database
- Restores Redis data
- Restores uploaded files
- Restores configuration
- Restarts all services
- Cleans up temporary files
- Runs health checks
See also:
ante set-daily-backup- Configure automated S3 backupsante daily-backup list- List remote S3 backups
ante set-daily-backup
Configure automated daily backups to S3-compatible cloud storage (DigitalOcean Spaces, AWS S3, etc.).
Usage:
ante set-daily-backup [options]Options:
--endpoint <url>- S3 endpoint URL (e.g.,https://sgp1.digitaloceanspaces.com)--region <region>- S3 region (default:sgp1)--bucket <name>- S3 bucket name--access-key <key>- S3 access key--secret-key <key>- S3 secret key--schedule <cron>- Cron schedule (default:0 3 * * *- daily at 3:00 AM)--retention <days>- Retention period in days (default:30)--folder-prefix <name>- Custom folder prefix (default: auto-detected server IP)--test- Run test backup immediately after setup
Examples:
Interactive Setup (Recommended):
# Prompts for all required information
ante set-daily-backup
# Example interaction:
# ? S3 Endpoint: https://sgp1.digitaloceanspaces.com
# ? S3 Region: sgp1
# ? S3 Bucket Name: ante-backups
# ? S3 Access Key: DO801A32T8C74...
# ? S3 Secret Key: ********************
#
# ✓ Testing S3 connection...
# ✓ S3 connection successful!
# ✓ Setting up cron job...
# ✓ Running test backup...
# ✓ Daily backups configured successfully!Non-Interactive Setup:
# Useful for automation or scripts
ante set-daily-backup \
--endpoint https://sgp1.digitaloceanspaces.com \
--region sgp1 \
--bucket ante-backups \
--access-key DO801A32T8C74EUHZFKU \
--secret-key 4Uh5/JqSDrgkeQ2z9c3A... \
--retention 30 \
--folder-prefix production-serverCustom Schedule:
# Daily at 2:00 AM
ante set-daily-backup --schedule "0 2 * * *"
# Every 12 hours
ante set-daily-backup --schedule "0 */12 * * *"
# Weekly (Sunday at 3:00 AM)
ante set-daily-backup --schedule "0 3 * * 0"What Happens During Setup:
- ✅ Tests S3 connection with provided credentials
- ✅ Encrypts and stores credentials securely (AES-256)
- ✅ Sets up automated cron job for daily backups
- ✅ Runs immediate test backup to verify configuration
- ✅ Configures 30-day automatic cleanup
Backup Process:
Each day at the scheduled time:
- Creates local backup (PostgreSQL, MongoDB, Redis, files, config)
- Uploads to S3 with progress tracking
- Organizes in server-specific folder (by IP address)
- Deletes backups older than retention period
- Logs all operations to
~/.ante-cli-backup.log
S3 Organization:
your-bucket/
└── 143.198.91.153/ # Server IP (auto-detected)
├── ante-backup-2025-11-18_03-00-00-AM.tar.gz
├── ante-backup-2025-11-17_03-00-00-AM.tar.gz
└── ... (up to 30 days)Multi-Server Setup:
You can safely use the same S3 bucket for multiple servers. Each server's backups are automatically isolated by IP address:
your-bucket/
├── 143.198.91.153/ # Production server
├── 178.128.49.38/ # Staging server
└── 192.168.1.100/ # Development serverSecurity Features:
- 🔐 Encrypted Credentials - S3 keys encrypted at rest using AES-256
- 🔐 Secure Transfer - All S3 operations use HTTPS
- 🔐 Server Isolation - Each server stores backups in separate folder
- 🔐 Access Control - Credentials stored in user-specific config
Cost Optimization:
DigitalOcean Spaces example:
- Base cost: $5/month (includes 250GB storage)
- Average backup size: ~300MB
- 30 days retention: ~9GB total
- Result: Well within included storage
Recommendations:
- Use same region as your server to reduce egress costs
- Configure 30-day retention (default) for balance
- Monitor bucket size with
ante daily-backup status
See also:
ante daily-backup status- Check configurationante daily-backup run- Manual triggerante disable-daily-backup- Disable automation
ante disable-daily-backup
Disable automated daily backups.
Usage:
ante disable-daily-backupWhat it does:
- Removes cron job for automated backups
- Marks daily backup as disabled in configuration
- Does NOT delete existing backups on S3
- Credentials remain stored (encrypted)
Example:
$ ante disable-daily-backup
⠹ Disabling daily backups...
✓ Daily backups disabled successfully!
Note: Existing backups on S3 have not been deleted.
To re-enable: ante set-daily-backupRe-enabling:
To re-enable daily backups, simply run ante set-daily-backup again. Your existing configuration will be restored.
ante daily-backup Command Group
Manage daily backup operations.
Available Commands:
ante daily-backup status- Show configuration and statusante daily-backup run- Trigger manual backupante daily-backup logs- View backup logsante daily-backup list- List remote S3 backupsante daily-backup clean- Clean old backups manually
ante daily-backup status
Show daily backup configuration and status.
Usage:
ante daily-backup statusExample Output:
╔══════════════════════════════════════════╗
║ Daily Backup Status ║
╚══════════════════════════════════════════╝
Status Enabled
Schedule 0 3 * * * (Daily at 3:00 AM)
S3 Bucket ante-backups
S3 Endpoint https://sgp1.digitaloceanspaces.com
Folder Prefix 143.198.91.153
Retention 30 days
Last Backup 2025-11-18 03:00:15
Last Status Success
📊 S3 Bucket Info:
Total Backups 15
Total Size 4.2 GB
Oldest Backup 2025-10-20 03:00:02
Newest Backup 2025-11-18 03:00:15
⏰ Next scheduled backup: 2025-11-19 03:00:00Information Displayed:
- Current configuration (schedule, bucket, retention)
- Last backup timestamp and status
- S3 bucket statistics (count, size, date range)
- Next scheduled run time
Use Cases:
- Verify backup is running correctly
- Check S3 storage usage
- Confirm schedule and retention settings
- Troubleshoot backup issues
ante daily-backup run
Trigger manual backup now (uses same process as automated backup).
Usage:
ante daily-backup runExample Output:
🔄 Starting manual backup...
⠹ Creating local backup...
✓ Local backup created: /root/ante-erp/backups/ante-backup-2025-11-18_15-30-22-PM.tar.gz
⠹ Uploading to S3... 47% (135.23 MB / 287.45 MB)
✓ Uploaded to S3: 143.198.91.153/ante-backup-2025-11-18_15-30-22-PM.tar.gz
⠹ Cleaning old backups...
✓ Cleaned 2 old backup(s)
✅ Backup completed successfully!Use Cases:
- Test backup configuration
- Create backup before risky operations
- Verify S3 credentials are working
- Manually trigger backup outside schedule
ante daily-backup logs
View backup logs from automated runs.
Usage:
ante daily-backup logs [options]Options:
--lines <n>- Number of lines to show (default:50)
Examples:
# View last 50 lines (default)
ante daily-backup logs
# View last 100 lines
ante daily-backup logs --lines 100
# Follow logs in real-time (during manual run)
tail -f ~/.ante-cli-backup.logLog File Location:
~/.ante-cli-backup.logExample Log Output:
[2025-11-18T03:00:01Z] [INFO] Starting automated daily backup...
[2025-11-18T03:00:02Z] [INFO] Backup configuration loaded successfully
[2025-11-18T03:00:02Z] [INFO] S3 Bucket: ante-backups
[2025-11-18T03:00:02Z] [INFO] Folder Prefix: 143.198.91.153
[2025-11-18T03:00:03Z] [INFO] Step 1/3: Creating local backup...
[2025-11-18T03:02:45Z] [SUCCESS] Local backup created: ante-backup-2025-11-18_03-00-00-AM.tar.gz
[2025-11-18T03:02:46Z] [INFO] Step 2/3: Uploading backup to S3...
[2025-11-18T03:05:30Z] [SUCCESS] Backup uploaded successfully to S3
[2025-11-18T03:05:31Z] [INFO] Step 3/3: Cleaning old backups...
[2025-11-18T03:05:35Z] [SUCCESS] Cleaned 2 old backup(s)
[2025-11-18T03:05:35Z] [SUCCESS] Automated backup completed successfully!Use Cases:
- Verify backups are running
- Troubleshoot backup failures
- Monitor backup duration
- Check what was backed up
ante daily-backup list
List all remote backups stored on S3.
Usage:
ante daily-backup listExample Output:
📦 Remote Backups (15 total):
┌──────────────────────────────────────────────┬──────────┬──────────────────────┐
│ Name │ Size │ Date │
├──────────────────────────────────────────────┼──────────┼──────────────────────┤
│ ante-backup-2025-11-18_03-00-00-AM.tar.gz │ 287.45 MB│ 2025-11-18 03:00:15 │
│ ante-backup-2025-11-17_03-00-00-AM.tar.gz │ 285.32 MB│ 2025-11-17 03:00:10 │
│ ante-backup-2025-11-16_03-00-00-AM.tar.gz │ 283.19 MB│ 2025-11-16 03:00:08 │
│ ante-backup-2025-11-15_03-00-00-AM.tar.gz │ 280.15 MB│ 2025-11-15 03:00:05 │
│ ... (11 more backups) │ │ │
└──────────────────────────────────────────────┴──────────┴──────────────────────┘Information Shown:
- Backup filename
- File size in MB
- Creation date and time
- Total count
Use Cases:
- Verify backups are being created
- Check retention is working (should be ≤30 backups)
- Find specific backup to restore
- Monitor storage usage
ante daily-backup clean
Manually clean old backups from S3 (respects retention period).
Usage:
ante daily-backup cleanExample Output:
⠹ Cleaning old backups...
✓ Cleaned 3 old backup(s)
Deleted backups:
- ante-backup-2025-10-15_03-00-00-AM.tar.gz
- ante-backup-2025-10-14_03-00-00-AM.tar.gz
- ante-backup-2025-10-13_03-00-00-AM.tar.gzWhat it does:
- Finds backups older than retention period (30 days by default)
- Deletes old backups from S3
- Keeps backups within retention period
Note: Cleanup runs automatically after each backup, so manual cleanup is rarely needed.
Use Cases:
- Force cleanup if automatic cleanup failed
- Free up S3 storage immediately
- Verify cleanup is working correctly
Database Operations
ante db migrate
Run database migrations.
Usage:
ante db migrateWhen to use:
- After updating ANTE to a new version
- When database schema changes are required
- When setting up a fresh installation
What it does: Runs Prisma migrations to update the database schema to the latest version.
ante db seed
Seed database with initial data.
Usage:
ante db seedWhat it seeds:
- Default admin user
- System settings
- Sample data (if applicable)
Note: This is typically run automatically during installation.
ante db shell
Open an interactive PostgreSQL shell.
Usage:
ante db shellCommon commands:
-- List all tables
\dt
-- Describe table structure
\d table_name
-- Run SQL query
SELECT * FROM "User" LIMIT 10;
-- Exit shell
\q⚠️ Caution: Direct database access can be dangerous. Only use if you know what you're doing.
ante db optimize
Optimize database performance.
Usage:
ante db optimizeWhat it does:
- Analyzes database tables
- Updates table statistics
- Runs VACUUM on PostgreSQL
- Rebuilds indexes
- Cleans up old data
When to use:
- Monthly maintenance
- After large data operations
- When experiencing slow queries
ante db clone-db
Clone a remote PostgreSQL database to your local database.
Usage:
ante db clone-db <postgresql-url> [options]Options:
--force- Skip confirmation prompts (non-interactive mode)--skip-dump- Use existing backup file instead of creating new dump--backup-file <path>- Path to existing backup file (requires--skip-dump)--no-prisma- Skip Prisma client generation and migrations
Examples:
# 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"
# Non-interactive mode (automation/scripts)
ante db clone-db "postgresql://..." --force
# Use existing backup file
ante db clone-db "postgresql://..." --skip-dump --backup-file ./backups/existing.dump
# Skip Prisma operations
ante db clone-db "postgresql://..." --no-prisma⚠️ DANGER: This command will DROP your local database schema and replace it with data from the remote source. Always ensure you have a backup before proceeding!
What it does:
- Parses URLs - Validates source and target database connection strings
- Tests connections - Verifies both source and target databases are accessible
- Creates backup - Dumps remote database to timestamped file in
./backups/ - Drops local schema - Removes all local data (CASCADE)
- Restores data - Imports remote database dump to local database
- Runs Prisma - Generates Prisma client and applies migrations
Use Cases:
- 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
Backup Location: Cloned databases are saved as: ./backups/clone_backup_YYYY-MM-DD_HH-MM-SS.dump
Common Scenarios:
Clone staging database for local development:
bashante db clone-db "postgresql://staging_user:pass@staging.db:5432/ante"Reuse existing backup (faster, no network dump):
bashante db clone-db "postgresql://..." \ --skip-dump \ --backup-file ./backups/clone_backup_2025-10-28_10-00-00.dumpAutomated scripts (CI/CD pipelines):
bash# Non-interactive for automation ante db clone-db "postgresql://..." --force
Requirements:
- Docker must be installed and running
- Source database must be accessible from your machine
- Local database must be running
- Sufficient disk space for backup file
- Database user must have SELECT and CONNECT privileges
Troubleshooting:
Connection Failed:
# Test connection manually
docker run --rm -e PGPASSWORD=password postgres:17-alpine \
psql -h host.example.com -p 5432 -U username -d database -c "SELECT 1"Large Database Timeout:
- Use
--skip-dumpwith pre-created backup for very large databases (>10GB) - Consider table-specific dumps for partial cloning
- Check network bandwidth and firewall rules
Memory Issues:
- Increase Docker memory limits
- Use
--no-prismaand run migrations separately - Clone in batches using table-specific dumps
ante db clone-mongodb
Clone a remote MongoDB database to your local MongoDB database.
Usage:
ante db clone-mongodb <mongodb-url> [options]Options:
--force- Skip confirmation prompts (non-interactive mode)--skip-dump- Use existing backup instead of creating new dump--backup-dir <path>- Path to existing backup directory (requires--skip-dump)
Examples:
# Clone from remote MongoDB (staging example)
ante db clone-mongodb "mongodb://user:password@staging.server.com:27017/ante"
# Clone from MongoDB Atlas
ante db clone-mongodb "mongodb+srv://user:password@cluster.mongodb.net/ante_db"
# Clone from local MongoDB on different port
ante db clone-mongodb "mongodb://localhost:27018/ante_staging"
# Non-interactive mode (automation/scripts)
ante db clone-mongodb "mongodb://..." --force
# Use existing backup directory
ante db clone-mongodb "mongodb://..." --skip-dump --backup-dir ./backups/mongodb_dump_2025-10-28
# Combined with skip-dump for faster restore
ante db clone-mongodb "mongodb://..." --skip-dump --backup-dir ./backups/existing_dump⚠️ DANGER: This command will DROP your local MongoDB database and replace it with data from the remote source. Always ensure you have a backup before proceeding!
What it does:
- Validates Connection - Tests connection to remote MongoDB server
- Creates Backup - Dumps remote MongoDB database to timestamped directory in
./backups/ - Drops Local Database - Removes all local MongoDB data
- Restores Data - Imports remote database dump to local MongoDB
- Verifies - Confirms successful restoration
Use Cases:
- Development Setup - Clone production/staging MongoDB data for local development
- Testing - Test with real data in a safe environment
- Data Migration - Copy MongoDB databases between servers
- Troubleshooting - Debug issues with production data locally
Backup Location: Cloned databases are saved as: ./backups/mongodb_dump_YYYY-MM-DD_HH-MM-SS/
Common Scenarios:
Clone staging MongoDB for local development:
bashante db clone-mongodb "mongodb://staging_user:pass@staging.server.com:27017/ante"Clone from MongoDB Atlas (production):
bashante db clone-mongodb "mongodb+srv://user:password@cluster.mongodb.net/ante_production"Reuse existing backup (faster, no network dump):
bashante db clone-mongodb "mongodb://..." \ --skip-dump \ --backup-dir ./backups/mongodb_dump_2025-10-28_10-00-00Automated scripts (CI/CD pipelines):
bash# Non-interactive for automation ante db clone-mongodb "mongodb://..." --force
Requirements:
- Docker must be installed and running
- Source MongoDB must be accessible from your machine
- Local MongoDB must be running
- Sufficient disk space for backup directory
- MongoDB user must have read permissions
MongoDB URL Formats:
Standard MongoDB:
mongodb://username:password@host:port/databaseMongoDB Atlas (SRV):
mongodb+srv://username:password@cluster.mongodb.net/databaseLocal MongoDB:
mongodb://localhost:27017/databaseTroubleshooting:
Connection Failed:
# Test connection manually
docker run --rm mongo:7.0 mongosh "mongodb://user:pass@host:27017/db" --eval "db.runCommand({ping: 1})"Authentication Failed:
- Verify username and password are correct
- Ensure user has necessary permissions
- Check if authentication database is correct
Large Database Timeout:
- Use
--skip-dumpwith pre-created backup for very large databases (>50GB) - Check network bandwidth and firewall rules
- Consider collection-specific dumps for partial cloning
Memory Issues:
- Increase Docker memory limits
- Use
mongodumpwith--numParallelCollectionsfor large databases - Clone in batches using collection-specific dumps
Comparison with ante db clone-db:
ante db clone-db- Clones PostgreSQL databasesante db clone-mongodb- Clones MongoDB databases
ante db reset
Reset database to initial state.
Usage:
ante db reset [options]Options:
--force- Skip confirmation prompts
⚠️ DANGER: This command will DELETE ALL DATA. This operation cannot be undone.
What it does:
- Drops all database tables
- Runs migrations to recreate schema
- Seeds initial data
When to use:
- Development/testing environments
- Starting fresh after testing
- Never use in production without a backup
ante db info
Display database information and statistics.
Usage:
ante db infoInformation shown:
- Database size
- Number of tables
- Connection status
- Version information
- Performance metrics
ante db expose
Expose database ports for external access (remote connections).
Usage:
ante db expose [options]Options:
--postgres- Expose only PostgreSQL (port 5432)--redis- Expose only Redis (port 6379)--mongodb- Expose only MongoDB (port 27017)--all- Expose all databases (default)--force- Skip confirmation prompts--no-restart- Don't restart services automatically
Examples:
# Expose all databases (interactive)
ante db expose
# Expose only PostgreSQL
ante db expose --postgres
# Expose PostgreSQL and Redis
ante db expose --postgres --redis
# Non-interactive mode (skip prompts)
ante db expose --force
# Expose without restarting services
ante db expose --no-restart⚠️ SECURITY WARNING: Exposing database ports allows external access to your databases. This should ONLY be used for development/staging environments. Never expose production databases without proper firewall rules.
What it does:
- Creates timestamped backup of
docker-compose.yml - Adds port bindings to selected database services
- Recreates containers to apply port changes
- Displays connection strings with actual passwords
- Shows firewall configuration recommendations
Connection Strings Output: After exposing, you'll see ready-to-use connection strings:
Connection strings:
PostgreSQL: postgresql://ante:your_password@SERVER_IP:5432/ante_db
Redis: redis://SERVER_IP:6379 (password: your_password)
MongoDB: mongodb://ante:your_password@SERVER_IP:27017/anteSecurity Recommendations:
Use Firewall Rules (UFW):
bash# Allow access only from your IP ufw allow from YOUR_IP to any port 5432 ufw allow from YOUR_IP to any port 6379 ufw allow from YOUR_IP to any port 27017Ensure Strong Passwords:
- Check your
.envfile for secure passwords - Never use default passwords in exposed databases
- Check your
Remove Access When Done:
bash# Always secure databases after use ante db secure
Use Cases:
- Connect with database GUI tools (pgAdmin, MongoDB Compass, RedisInsight)
- Remote development via Tailscale or VPN
- Database administration and troubleshooting
- Temporary access for migrations or backups
Common Database Tools:
- PostgreSQL: pgAdmin, DBeaver
- Redis: RedisInsight, Another Redis Desktop Manager
- MongoDB: MongoDB Compass, Studio 3T
ante db secure
Remove database port bindings to block external access.
Usage:
ante db secure [options]Options:
--force- Skip confirmation prompts--no-restart- Don't restart services automatically
Examples:
# Secure all exposed databases (interactive)
ante db secure
# Non-interactive mode
ante db secure --force
# Secure without restarting services
ante db secure --no-restartWhat it does:
- Shows currently exposed databases
- Creates timestamped backup of
docker-compose.yml - Removes port bindings from all database services
- Recreates containers to apply changes
- Confirms databases are now secured
When to use:
- After finishing remote database work
- Before deploying to production
- As part of security hardening
- When switching from development to staging
Best Practice: Always run ante db secure after you finish working with exposed databases to maintain security.
ante db port-status
Show current database port exposure status.
Usage:
ante db port-statusOutput Example:
Database Port Exposure Status
──────────────────────────────────────────────────
🔓 PostgreSQL: EXPOSED Port: 5432
🔒 Redis: SECURED
🔒 MongoDB: SECURED
──────────────────────────────────────────────────
⚠️ Some databases are exposed. Run 'ante db secure' to block external access.Status Icons:
- 🔓 EXPOSED - Port is accessible from external connections
- 🔒 SECURED - Port is not exposed (internal Docker network only)
When to use:
- Check security status before deployment
- Verify databases are secured
- Audit current port exposure
- Troubleshoot connection issues
SSL/HTTPS & Security
ante ssl enable
Enable SSL/HTTPS with automatic certificates from Let's Encrypt.
Usage:
ante ssl enable [options]Options:
--email <email>- Email address for certificate notifications (required)--staging- Use Let's Encrypt staging environment for testing--no-interactive- Non-interactive mode (requires--email)
Examples:
# Interactive mode (prompts for email)
ante ssl enable
# Non-interactive mode
ante ssl enable --email admin@company.com --no-interactive
# Test with staging environment (recommended before production)
ante ssl enable --email admin@company.com --stagingRequirements:
- Domain name configured with
ante set-domain(not localhost or IP address) - Domain must resolve to your server's public IP address
- Ports 80 and 443 must be open and accessible from the internet
- NGINX installed (CLI will auto-install if not present)
- Valid email address for Let's Encrypt notifications
What it does:
- ✅ Checks if certbot is installed (installs if needed)
- ✅ Verifies domain DNS resolution
- 🔐 Obtains SSL certificates from Let's Encrypt (free, valid for 90 days)
- 🔧 Configures NGINX for HTTPS with security headers
- 🔄 Sets up HTTP to HTTPS redirect
- ⏰ Configures automatic certificate renewal (daily check at 3:00 AM)
Certificate Renewal:
- Certificates automatically renew when they have 30 days or less remaining
- Uses systemd timer (modern Linux) or cron job (legacy systems)
- No manual intervention required
Verification:
# Check certificate status
ante ssl status
# Test HTTPS access
curl -I https://your-domain.com
# Verify auto-renewal is configured
systemctl status certbot.timer
# OR (for cron-based systems)
cat /etc/cron.d/certbot-renewalTroubleshooting:
DNS not resolving:
# Check if domain points to your server
dig +short your-domain.com
nslookup your-domain.com
# Should return your server's IP addressPorts not accessible:
# Check firewall rules
sudo ufw status
# Allow HTTP and HTTPS
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
# Force renewal if needed
sudo certbot renew --force-renewal --nginx
sudo systemctl reload nginxLet's Encrypt rate limits:
- If you encounter rate limit errors, use
--stagingflag to test first - Production limit: 50 certificates per domain per week
- Staging environment has no practical limits
Security features configured:
- TLS 1.2 and TLS 1.3 protocols
- Strong cipher suites
- HSTS (HTTP Strict Transport Security)
- X-Frame-Options, X-Content-Type-Options headers
- XSS protection headers
ante ssl status
Check SSL certificate status and expiry information.
Usage:
ante ssl statusNo options required.
Example output:
🔒 SSL Certificate Status
Frontend:
Domain: erp.company.com
URL: https://erp.company.com
✓ Certificate found
Expiry: 2026-01-27
Days remaining: 87
Status: Valid
API:
Domain: api.company.com
URL: https://api.company.com
✓ Certificate found
Expiry: 2026-01-27
Days remaining: 87
Status: ValidStatus indicators:
- ✓ Valid - Certificate is valid and has more than 30 days remaining
- ⚠ Expiring soon - Certificate has less than 30 days remaining (auto-renewal will trigger)
- ✗ No certificate found - Domain does not have an SSL certificate
What it checks:
- Certificate existence
- Certificate expiry date
- Days remaining until expiry
- Certificate validity status
When to use:
- Regular monitoring (monthly check recommended)
- After running
ante ssl enable - When troubleshooting HTTPS issues
- Before certificate expiry to verify auto-renewal is working
ante set-domain
Configure frontend and API domains/URLs with optional SSL/HTTPS setup.
Usage:
ante set-domain [options]Options:
Domain Configuration:
--frontend <url>- Frontend URL (e.g.,https://erp.company.com)--api <url>- API URL (e.g.,https://api.company.com)--detect- Auto-detect public IP address
SSL/HTTPS Configuration:
--ssl,--enable-ssl- Enable SSL certificate (Let's Encrypt)--email <email>- Email address for SSL certificate notifications (required with--ssl)--ssl-staging- Use Let's Encrypt staging environment (for testing)
Behavior:
--no-interactive- Non-interactive mode (requires--frontendand--api)
Examples:
Basic Domain Configuration:
# Interactive mode (recommended)
ante set-domain
# Auto-detect public IP
ante set-domain --detect
# Non-interactive with custom domains
ante set-domain \
--frontend https://erp.company.com \
--api https://api.company.com \
--no-interactive
# Using IP address with custom ports
ante set-domain \
--frontend http://192.168.1.100:8080 \
--api http://192.168.1.100:3001 \
--no-interactiveDomain Configuration with SSL (Combined Workflow):
# Set domain and enable SSL in one command
ante set-domain \
--frontend https://erp.company.com \
--api https://api.company.com \
--ssl \
--email admin@company.com \
--no-interactive
# Test SSL setup with staging environment first
ante set-domain \
--frontend https://erp.company.com \
--api https://api.company.com \
--ssl \
--email admin@company.com \
--ssl-staging \
--no-interactive
# After testing, run again without --ssl-staging for production SSL
ante set-domain \
--frontend https://erp.company.com \
--api https://api.company.com \
--ssl \
--email admin@company.com \
--no-interactiveWhat it does:
- Updates
.envfile with new URLs - Configures NGINX reverse proxy (if using domains or HTTPS)
- If
--sslflag provided:- Installs certbot (if not already installed)
- Verifies domain DNS resolution
- Obtains SSL certificates from Let's Encrypt
- Configures NGINX for HTTPS with security headers
- Sets up HTTP to HTTPS redirect
- Configures automatic certificate renewal
- Restarts services to apply new configuration
- Waits for services to become healthy
- Verifies configuration
URL formats:
- Domain with HTTPS:
https://erp.company.com(port 443, requires SSL) - Domain with HTTP:
http://erp.company.com(port 80) - IP with custom port:
http://192.168.1.100:8080 - Localhost:
http://localhost:8080(for development)
When NGINX is configured: NGINX reverse proxy is automatically set up when:
- Using HTTPS (any URL starting with
https://) - Using HTTP without explicit port (implies port 80)
- Using a domain name (not an IP address)
Common workflows:
Development (localhost):
ante set-domain --frontend http://localhost:8080 --api http://localhost:3001Production (with SSL) - Traditional Two-Step:
# Step 1: Set domains
ante set-domain --frontend https://erp.company.com --api https://api.company.com
# Step 2: Enable SSL separately
ante ssl enable --email admin@company.comProduction (with SSL) - Integrated Single-Step:
# One command does both domain configuration and SSL setup
ante set-domain \
--frontend https://erp.company.com \
--api https://api.company.com \
--ssl \
--email admin@company.comSSL Testing Best Practice:
# Step 1: Test with staging SSL first (no rate limits)
ante set-domain \
--frontend https://erp.company.com \
--api https://api.company.com \
--ssl \
--email admin@company.com \
--ssl-staging
# Step 2: If successful, run again with production SSL
ante set-domain \
--frontend https://erp.company.com \
--api https://api.company.com \
--ssl \
--email admin@company.comAfter configuration:
- Frontend accessible at configured URL
- API accessible at configured URL
- WebSocket uses same URL as API
- Services automatically restarted
Updates & Maintenance
ante update
Update ANTE to the latest version.
Usage:
ante update [options]Alias: ante upgrade
Options:
-v, --version <version>- Update to specific version--skip-backup- Skip automatic backup before update--skip-cleanup- Skip Docker cleanup after update (keeps old images)--force- Force update without confirmation
Examples:
# Update to latest version (recommended)
ante update
# Update to specific version
ante update --version 2.0.0
# Update without automatic backup (not recommended)
ante update --skip-backup
# Update without cleanup (if you want to keep old images for rollback)
ante update --skip-cleanupWhat it does:
- Creates automatic backup (unless
--skip-backup) - Pulls latest Docker images
- Stops current services
- Updates Docker Compose configuration
- Starts services with new images
- Runs database migrations
- Performs health checks
- Cleans up unused Docker images (unless
--skip-cleanup)
The update process now automatically removes unused Docker images to free disk space. This prevents accumulation of old images over time.
Rollback: If update fails, you can restore from the automatic backup.
ante update-cli
Update the ANTE CLI tool itself to the latest version.
Usage:
ante update-cli [options]Options:
--check- Check for updates without installing--force- Skip confirmation prompt
Examples:
# Check for CLI updates
ante update-cli --check
# Update CLI to latest version
ante update-cli
# Update without confirmation
ante update-cli --forceNote: This updates the CLI tool itself, not the ANTE ERP installation. To update ANTE ERP, use ante update.
ante cleanup
Clean up unused Docker resources to free disk space.
Usage:
ante cleanup [options]Options:
--dry-run- Preview what would be deleted without making changes--volumes- Also remove unused volumes (⚠ WARNING: potential data loss)--force- Skip confirmation prompts
Examples:
# Preview cleanup (see what would be removed)
ante cleanup --dry-run
# Clean up unused images and containers
ante cleanup
# Deep cleanup including volumes (use with caution)
ante cleanup --volumes --forceWhat it does:
- Removes dangling Docker images (untagged images from previous updates)
- Removes stopped containers
- Removes unused Docker networks
- Optionally removes unused volumes (if
--volumesflag is used)
When to use:
- After multiple updates to reclaim disk space
- When low on disk space
- As part of regular maintenance
Disk Space Savings:
- Average savings: 500MB - 1GB per update worth of old images
- Automatic cleanup runs during
ante update(can be disabled with--skip-cleanup)
WARNING
Using --volumes flag will remove unused Docker volumes, which may result in data loss. Only use this if you're certain the volumes are not needed.
System Maintenance
ante reset
Reset ANTE ERP system to initial state (complete system reset).
Usage:
ante reset [options]Options:
--force- Skip confirmation prompts (non-interactive mode)--backup-only- Only create backup without proceeding with reset
Examples:
# Interactive reset (with confirmation prompts)
ante reset
# Non-interactive mode (for automation/scripts)
ante reset --force
# Only create pre-reset backup without resetting
ante reset --backup-only⚠️ EXTREME DANGER: This command performs a COMPLETE SYSTEM RESET and will:
- CREATE MANDATORY BACKUP - Automatically creates a timestamped backup before proceeding
- DROP ALL DATABASES - Completely drops PostgreSQL and MongoDB schemas (all data lost)
- RESET TO FRESH STATE - Returns system to initial installation state
- PRESERVE DOCKER CONTAINERS - Keeps containers running (no need to reinstall)
What it does:
- Safety Check - Confirms you understand the consequences (unless
--force) - Mandatory Backup - Creates timestamped backup:
reset_backup_YYYY-MM-DD_HH-MM-SS.tar.gz - Drop PostgreSQL Schema - Completely removes all tables and data (CASCADE)
- Drop MongoDB Database - Removes entire MongoDB database
- Run Migrations - Applies fresh migrations to recreate schema
- Seed Database - Adds initial system data
- Restart Services - Ensures all services pick up fresh state
When to use:
- Development/Testing - Start fresh after extensive testing
- Demo Reset - Return demo system to initial state
- Corrupted Data - Fix severely corrupted database issues
- Clean Slate - Need completely fresh installation without Docker reinstall
When NOT to use:
- ❌ Production Systems - Never use in production without explicit approval
- ❌ Active Data - Never use when you need to preserve data (use backup/restore instead)
- ❌ During Business Hours - High-impact operation, plan downtime
Backup Location: Backups are saved as: ./backups/reset_backup_YYYY-MM-DD_HH-MM-SS.tar.gz
Recovery: If you need to recover after reset:
# Restore from the automatic pre-reset backup
ante restore ./backups/reset_backup_YYYY-MM-DD_HH-MM-SS.tar.gzCommon Scenarios:
Reset development environment:
bash# Interactive with confirmation ante resetAutomated reset in CI/CD:
bash# Non-interactive for automation ante reset --forceCreate safety backup before manual reset:
bash# Only create backup, don't reset ante reset --backup-only
Comparison with ante db reset:
ante db reset- Only resets PostgreSQL databaseante reset- Resets BOTH PostgreSQL and MongoDB databases (complete system reset)
DANGER
This is the most destructive command in the CLI. It will DELETE ALL DATA from both PostgreSQL and MongoDB. Always ensure you have backups before proceeding. The automatic backup created by this command is your safety net.
ante regenerate-compose
Regenerate docker-compose.yml with correct configuration.
Usage:
ante regenerate-composeNo options required.
What it does:
- Backs up current
docker-compose.ymltodocker-compose.yml.backup.TIMESTAMP - Reads current configuration from
.envfile - Regenerates
docker-compose.ymlwith proper port mappings and volumes - Preserves all environment variables and credentials
- Fixes any port conflicts or configuration issues
When to use:
- Port Mapping Issues - Fix incorrect or conflicting port configurations
- After Manual Edits - Restore correct structure after manual compose file edits
- Configuration Problems - Resolve Docker Compose configuration errors
- Template Updates - Apply updated compose template from CLI updates
Example:
# Regenerate compose file
ante regenerate-compose
# Restart services with new configuration
ante restartWhat's preserved:
- All environment variables from
.env - Database credentials
- Custom port configurations
- Volume mounts
Backup location: Original compose file saved as: docker-compose.yml.backup.YYYYMMDD_HHMMSS
Common use cases:
Fix port conflicts:
bash# After changing ports in .env ante regenerate-compose ante restartRecover from manual edits:
bash# Made manual changes that broke configuration ante regenerate-compose ante restartApply CLI template updates:
bash# After updating CLI to get new compose features ante update-cli ante regenerate-compose ante restart
TIP
If you manually edit docker-compose.yml and encounter issues, run this command to restore the correct configuration based on your .env settings.
Cleanup & Uninstallation
ante uninstall
Uninstall ANTE ERP from your system.
Usage:
ante uninstall [options]Options:
--keep-data- Keep database volumes (preserves data)--keep-files- Keep installation files--force- Skip confirmation prompts
Examples:
# Uninstall with confirmation prompts
ante uninstall
# Keep data but remove containers
ante uninstall --keep-data
# Keep everything except containers
ante uninstall --keep-data --keep-files
# Force uninstall without prompts
ante uninstall --forceWhat it does:
- Stops all services
- Removes Docker containers
- Removes Docker volumes (unless
--keep-data) - Removes installation files (unless
--keep-files) - Removes CLI configuration
⚠️ Warning: Unless you use --keep-data, all your data will be permanently deleted.
Recommendation: Create a backup before uninstalling:
ante backup
ante uninstallHelp & Information
ante help
Display help information for commands.
Usage:
ante help [command]Examples:
# Show all available commands
ante help
# Show help for specific command
ante help install
ante help backup
ante help dbante version
Display ANTE CLI version.
Usage:
ante version
ante --version
ante -vExit Codes
The CLI uses standard exit codes:
0- Success1- General error2- Configuration error3- Docker error4- Database error5- Network error
These can be useful in scripts:
if ante status; then
echo "ANTE is running"
else
echo "ANTE is not running"
ante start
fiConfiguration
The CLI stores its configuration in ~/.config/ante-cli/config.json:
{
"installPath": "/path/to/ante-erp",
"version": "1.0.0",
"lastBackup": "2025-10-27T10:00:00.000Z",
"domain": "erp.company.com"
}You can manually edit this file if needed, but it's recommended to use CLI commands instead.
Tips & Best Practices
Daily Operations
# Morning health check
ante status
ante doctor
# View recent activity
ante logs --lines 50Before Updates
# Always create backup before updates
ante backup
ante updateTroubleshooting
# When something goes wrong
ante doctor # Check system health
ante logs --service backend --follow # Check backend logs
ante restart # Try restarting servicesScheduled Backups
Set up a cron job for automatic backups:
# Daily backup at 2 AM
0 2 * * * cd /path/to/ante-erp && ante backup
# Weekly backup on Sunday at 3 AM
0 3 * * 0 cd /path/to/ante-erp && ante backupMonitoring
Use the CLI in monitoring scripts:
#!/bin/bash
# health-check.sh
if ! ante status > /dev/null 2>&1; then
echo "ANTE services are down!"
ante start
# Send notification
fiNext Steps
- Installation Guide - Install the ANTE CLI
- Troubleshooting - Solve common issues
- Self-Hosting Guide - Complete self-hosting documentation
Support
If you encounter issues not covered in this documentation:
- GitHub Issues: https://github.com/gtplusnet/ante-official/issues
- Email: support@ante.ph
- Documentation: https://docs.ante.ph
