-
-
Notifications
You must be signed in to change notification settings - Fork 0
Useful Commands
This document provides a reference guide for common management tasks and commands for Evolution API on Dokku.
- Application Management
- Logging and Monitoring
- Database Management
- Storage Management
- Resource Management
- Updates and Deployment
- Troubleshooting
# Check if application is running
dokku ps:report evo
# View application information
dokku apps:info evo
# List all applications
dokku apps:list# Restart the application
dokku ps:restart evo
# Stop the application
dokku ps:stop evo
# Start the application
dokku ps:start evo
# Rebuild and restart
dokku ps:rebuild evo# Scale to multiple instances
dokku ps:scale evo web=2
# View current scaling
dokku ps:report evo | grep -i scale# Access container shell
dokku enter evo web
# Execute command in container
dokku enter evo web bash -c "ls -la /evolution/instances"# Real-time logs
dokku logs evo -t
# View last 100 lines
dokku logs evo -n 100
# View specific process logs
dokku logs evo web -tWindows (PowerShell):
ssh your-server "logs evo -t"# View resource usage
dokku ps:report evo
# Monitor in real-time (requires docker stats)
docker stats $(dokku ps:inspect evo | jq -r '.[].ID')# View all environment variables
dokku config evo
# View specific variable
dokku config:get evo AUTHENTICATION_API_KEY
# Export configuration
dokku config:export evo > evo-config.env# View database information
dokku postgres:info evo
# Check database size
dokku postgres:connect evo -c "SELECT pg_size_pretty(pg_database_size('evo'));"
# List all databases
dokku postgres:list# Connect to PostgreSQL console
dokku postgres:connect evo
# Execute SQL command
dokku postgres:connect evo -c "SELECT COUNT(*) FROM _prisma_migrations;"Windows (PowerShell):
ssh your-server "postgres:connect evo"Create backup:
# Linux/macOS
dokku postgres:backup evo backup-$(date +%Y%m%d)
# Windows (PowerShell)
$date = Get-Date -Format "yyyyMMdd"
ssh your-server "postgres:backup evo backup-$date"List backups:
dokku postgres:backup-list evoRestore from backup:
dokku postgres:backup-restore evo backup-nameExport database:
dokku postgres:export evo > evolution-backup.sqlImport database:
dokku postgres:import evo < evolution-backup.sql# Vacuum database (optimize)
dokku postgres:connect evo -c "VACUUM ANALYZE;"
# Check database connections
dokku postgres:connect evo -c "SELECT COUNT(*) FROM pg_stat_activity;"
# View database statistics
dokku postgres:connect evo -c "SELECT schemaname, tablename, pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) AS size FROM pg_tables ORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC LIMIT 10;"# View storage configuration
dokku storage:report evo
# Check mounted volumes
dokku storage:list evo# Check disk usage
du -sh /var/lib/dokku/data/storage/evo
# Detailed breakdown
du -h --max-depth=1 /var/lib/dokku/data/storage/evo
# Check available disk space
df -h /var/lib/dokku/data/storage# Mount new storage
dokku storage:mount evo /var/lib/dokku/data/storage/evo-media:/evolution/media
# Unmount storage
dokku storage:unmount evo /var/lib/dokku/data/storage/evo:/evolution/instances
# Ensure directory exists
dokku storage:ensure-directory evo-backup# Enter container and clean old media
dokku enter evo web
find /evolution/instances -type f -mtime +30 -delete
# Clean old logs
find /evolution/logs -type f -mtime +7 -delete# View current limits
dokku resource:report evo
# View detailed resource usage
dokku ps:report evoWindows (PowerShell):
ssh your-server "resource:report evo"
ssh your-server "ps:report evo"Minimal (1-10 users):
dokku resource:limit evo --memory 256m --cpu 0.5Small team (10-50 users):
dokku resource:limit evo --memory 512m --cpu 1Medium team (50-200 users):
dokku resource:limit evo --memory 1024m --cpu 2High volume (200+ users):
dokku resource:limit evo --memory 2048m --cpu 4dokku resource:limit-clear evo --process-type webFrom Git repository:
dokku git:sync --build evo https://github.com/carrilloapps/evolution-api-on-dokku.gitFrom local repository:
git push dokku master# 1. Pull latest code (if using git sync)
dokku git:sync evo https://github.com/carrilloapps/evolution-api-on-dokku.git
# 2. Rebuild application
dokku ps:rebuild evo
# 3. Verify deployment
dokku logs evo -t# View deployment history
dokku releases evo
# Rollback to previous version
dokku releases:rollback evo# Enable zero-downtime checks
dokku checks:enable evo
# View check configuration
dokku checks:report evo# View health check status
dokku checks:report evo
# Test manually
curl -I https://evo.example.com# Check port mappings
dokku ports:report evo
# Check proxy configuration
dokku proxy:report evo
# Check domain configuration
dokku domains:report evoApplication won't start:
# Check logs
dokku logs evo -t
# Verify configuration
dokku config evo
# Rebuild application
dokku ps:rebuild evoDatabase connection issues:
# Verify database link
dokku postgres:links evo
# Check database status
dokku postgres:info evo
# Test connection
dokku postgres:connect evo -c "SELECT 1;"Out of memory:
# Check current usage
dokku ps:report evo | grep -i memory
# Increase memory limit
dokku resource:limit evo --memory 1024m
# Restart application
dokku ps:restart evoStorage full:
# Check disk usage
df -h /var/lib/dokku/data/storage
# Clean old files
dokku enter evo web
find /evolution/instances -type f -mtime +30 -delete
# Optimize database
dokku postgres:connect evo -c "VACUUM FULL;"# Dokku version
dokku version
# Docker version
docker --version
# System resources
free -h
df -h
top# List domains
dokku domains:report evo
# Add domain
dokku domains:add evo api.example.com
# Remove domain
dokku domains:remove evo api.example.com
# Clear all domains
dokku domains:clear evo# Enable Let's Encrypt
dokku letsencrypt:enable evo
# Renew certificate
dokku letsencrypt:renew evo
# View certificate info
dokku letsencrypt:list
# Disable Let's Encrypt
dokku letsencrypt:disable evo
# Set email for Let's Encrypt
dokku letsencrypt:set evo email you@example.com# Add cron job for auto-renewal
dokku letsencrypt:cron-job --add
# Remove cron job
dokku letsencrypt:cron-job --remove
# List cron jobs
dokku letsencrypt:cron-job --list# View network configuration
dokku network:report evo
# List Docker networks
docker network ls# Create network
dokku network:create custom-network
# Attach to network
dokku network:set evo attach-post-create custom-network
# Detach from network
dokku network:set evo detach-post-create custom-networkNote: Redis is NOT required and NOT included by default. These commands are only for teams that have installed Redis (50+ users). See Redis Integration Guide for complete setup and configuration.
If you have Redis installed:
# Create Redis instance
dokku redis:create evo
# Link to application
dokku redis:link evo evo
# View Redis info
dokku redis:info evo
# Connect to Redis
dokku redis:connect evo
# Backup Redis
dokku redis:backup evo backup-$(date +%Y%m%d)
# List backups
dokku redis:backup-list evo
# Remove Redis (if no longer needed)
dokku redis:unlink evo evo
dokku redis:destroy evoFor complete Redis documentation, see Redis Integration Guide.
Create /root/backup-evolution.sh:
#!/bin/bash
DATE=$(date +%Y%m%d-%H%M%S)
dokku postgres:backup evo backup-$DATE
echo "Backup created: backup-$DATE"Make executable and add to cron:
chmod +x /root/backup-evolution.sh
echo "0 2 * * * /root/backup-evolution.sh" | crontab -Create /root/check-evolution.sh:
#!/bin/bash
if ! curl -f -s https://evo.example.com > /dev/null; then
echo "Evolution API is down! Restarting..."
dokku ps:restart evo
echo "Restarted at $(date)" >> /var/log/evolution-restarts.log
fiMake executable and add to cron (check every 5 minutes):
chmod +x /root/check-evolution.sh
echo "*/5 * * * * /root/check-evolution.sh" | crontab -# View logs
dokku logs evo -t
# Restart app
dokku ps:restart evo
# View config
dokku config evo
# Database backup
dokku postgres:backup evo backup-$(date +%Y%m%d)
# Check resources
dokku resource:report evo
# Update app
dokku git:sync --build evo https://github.com/carrilloapps/evolution-api-on-dokku.git# Application crashed
dokku ps:rebuild evo
# Out of memory
dokku resource:limit evo --memory 1024m
dokku ps:restart evo
# Database issues
dokku postgres:restart evo
# Full reset (CAUTION: DATA LOSS)
dokku ps:stop evo
dokku postgres:destroy evo --force
dokku postgres:create evo
dokku postgres:link evo evo
dokku ps:rebuild evo- Performance & Optimization - Optimize your deployment
- Configuration - Advanced configuration options
- System Requirements - Hardware recommendations