NexisChat Docs
Evolution API LiteConfiguration

Environment Variables

Complete guide to configuring Evolution API Lite through environment variables

Environment Variables

Evolution API Lite is configured through environment variables defined in your .env file. This guide provides a comprehensive overview of all available configuration options, organized by category.

info Copy the .env.example file to .env and modify the values according to your needs. All variables have sensible defaults, but some require configuration for production use.

Server Configuration

Basic Server Settings

VariableTypeDefaultDescription
SERVER_TYPEhttp | httpshttpProtocol type for the server
SERVER_PORTnumber8080Port number where the server will listen
SERVER_URLstringhttp://localhost:8080Full URL where your application is accessible

CORS Configuration

VariableTypeDefaultDescription
CORS_ORIGINstring*Allowed origins for CORS. Use * for all or comma-separated domains
CORS_METHODSstringGET,POST,PUT,DELETEAllowed HTTP methods for CORS
CORS_CREDENTIALSbooleantrueWhether to allow credentials in CORS requests

=== Development Example

SERVER_TYPE=http
SERVER_PORT=8080
SERVER_URL=http://localhost:8080
CORS_ORIGIN=*

=== Production Example

SERVER_TYPE=https
SERVER_PORT=443
SERVER_URL=https://api.yourdomain.com
CORS_ORIGIN=https://yourdomain.com,https://app.yourdomain.com

Logging Configuration

Log Levels and Output

VariableTypeDefaultDescription
LOG_LEVELstringERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS,WEBSOCKETComma-separated list of log levels to display
LOG_COLORbooleantrueEnable colored log output
LOG_BAILEYSstringerrorBaileys library log level: fatal, error, warn, info, debug, trace

Event Emitter Configuration

VariableTypeDefaultDescription
EVENT_EMITTER_MAX_LISTENERSnumber50Maximum number of event listeners per event

Instance Management

VariableTypeDefaultDescription
DEL_INSTANCEboolean | numberfalseAuto-delete inactive instances. Set to false to disable, or number of minutes for timeout

warn Setting DEL_INSTANCE to a low value may cause instances to be deleted while users are temporarily offline. Use with caution in production.

Database Configuration

Connection Settings

VariableTypeDefaultDescription
DATABASE_PROVIDERpostgresql | mysqlpostgresqlDatabase provider to use
DATABASE_CONNECTION_URIstringpostgresql://user:pass@postgres:5432/evolution?schema=publicFull database connection string
DATABASE_CONNECTION_CLIENT_NAMEstringevolution_exchangeClient name for database connection separation

Data Persistence Options

VariableTypeDefaultDescription
DATABASE_SAVE_DATA_INSTANCEbooleantrueSave instance data to database
DATABASE_SAVE_DATA_NEW_MESSAGEbooleantrueSave new messages to database
DATABASE_SAVE_MESSAGE_UPDATEbooleantrueSave message updates to database
DATABASE_SAVE_DATA_CONTACTSbooleantrueSave contact information to database
DATABASE_SAVE_DATA_CHATSbooleantrueSave chat information to database
DATABASE_SAVE_DATA_LABELSbooleantrueSave label information to database
DATABASE_SAVE_DATA_HISTORICbooleantrueSave message history to database
DATABASE_SAVE_IS_ON_WHATSAPPbooleantrueSave WhatsApp presence status
DATABASE_SAVE_IS_ON_WHATSAPP_DAYSnumber7Days to keep WhatsApp presence data
DATABASE_DELETE_MESSAGEbooleantrueEnable logical message deletion

=== PostgreSQL Example

DATABASE_PROVIDER=postgresql
DATABASE_CONNECTION_URI=postgresql://username:password@localhost:5432/evolution_db?schema=public
DATABASE_CONNECTION_CLIENT_NAME=evolution_prod

=== MySQL Example

DATABASE_PROVIDER=mysql
DATABASE_CONNECTION_URI=mysql://username:password@localhost:3306/evolution_db
DATABASE_CONNECTION_CLIENT_NAME=evolution_prod

Cache Configuration

Redis Cache

VariableTypeDefaultDescription
CACHE_REDIS_ENABLEDbooleantrueEnable Redis caching
CACHE_REDIS_URIstringredis://localhost:6379/6Redis connection string
CACHE_REDIS_TTLnumber604800Cache TTL in seconds (default: 7 days)
CACHE_REDIS_PREFIX_KEYstringevolutionPrefix for Redis keys
CACHE_REDIS_SAVE_INSTANCESbooleanfalseSave instance data in Redis instead of database

Local Cache

VariableTypeDefaultDescription
CACHE_LOCAL_ENABLEDbooleanfalseEnable local memory caching

Event Integration

RabbitMQ Configuration

VariableTypeDefaultDescription
RABBITMQ_ENABLEDbooleanfalseEnable RabbitMQ integration
RABBITMQ_URIstringamqp://localhostRabbitMQ connection string
RABBITMQ_EXCHANGE_NAMEstringevolutionExchange name for RabbitMQ
RABBITMQ_GLOBAL_ENABLEDbooleanfalseSend events from all instances to same queue

RabbitMQ Events

All RabbitMQ events are disabled by default. Enable specific events by setting them to true:

  • RABBITMQ_EVENTS_APPLICATION_STARTUP
  • RABBITMQ_EVENTS_INSTANCE_CREATE
  • RABBITMQ_EVENTS_INSTANCE_DELETE
  • RABBITMQ_EVENTS_QRCODE_UPDATED
  • RABBITMQ_EVENTS_MESSAGES_SET
  • RABBITMQ_EVENTS_MESSAGES_UPSERT
  • RABBITMQ_EVENTS_MESSAGES_EDITED
  • RABBITMQ_EVENTS_MESSAGES_UPDATE
  • RABBITMQ_EVENTS_MESSAGES_DELETE
  • RABBITMQ_EVENTS_SEND_MESSAGE
  • RABBITMQ_EVENTS_CONTACTS_SET
  • RABBITMQ_EVENTS_CONTACTS_UPSERT
  • RABBITMQ_EVENTS_CONTACTS_UPDATE
  • RABBITMQ_EVENTS_PRESENCE_UPDATE
  • RABBITMQ_EVENTS_CHATS_SET
  • RABBITMQ_EVENTS_CHATS_UPSERT
  • RABBITMQ_EVENTS_CHATS_UPDATE
  • RABBITMQ_EVENTS_CHATS_DELETE
  • RABBITMQ_EVENTS_GROUPS_UPSERT
  • RABBITMQ_EVENTS_GROUP_UPDATE
  • RABBITMQ_EVENTS_GROUP_PARTICIPANTS_UPDATE
  • RABBITMQ_EVENTS_CONNECTION_UPDATE
  • RABBITMQ_EVENTS_REMOVE_INSTANCE
  • RABBITMQ_EVENTS_LOGOUT_INSTANCE
  • RABBITMQ_EVENTS_CALL
  • RABBITMQ_EVENTS_TYPEBOT_START
  • RABBITMQ_EVENTS_TYPEBOT_CHANGE_STATUS

Amazon SQS Configuration

VariableTypeDefaultDescription
SQS_ENABLEDbooleanfalseEnable Amazon SQS integration
SQS_ACCESS_KEY_IDstring-AWS access key ID
SQS_SECRET_ACCESS_KEYstring-AWS secret access key
SQS_ACCOUNT_IDstring-AWS account ID
SQS_REGIONstring-AWS region

WebSocket Configuration

VariableTypeDefaultDescription
WEBSOCKET_ENABLEDbooleanfalseEnable WebSocket support
WEBSOCKET_GLOBAL_EVENTSbooleanfalseSend global events via WebSocket

Pusher Configuration

VariableTypeDefaultDescription
PUSHER_ENABLEDbooleanfalseEnable Pusher integration