Complete guide for installing and configuring Evolution API on Hostinger VPS with custom subdomain setup.
- Hostinger VPS account
- Domain already configured with Hostinger
📺 Video Tutorial: 🎥 Complete Setup Guide
We need to create a subdomain for the Evolution API. In this guide, we'll use evo as the subdomain.
-
Access Hostinger DNS Management
- Log into your Hostinger account
- Navigate to your domain management panel
- Go to DNS / Nameservers section
-
Add DNS Record for Evolution API
- We'll create a subdomain called
evofor our Evolution API - The new DNS will be:
https://evo.elshamyn8n.shop/
- We'll create a subdomain called
-
DNS Configuration
- Add a new A record:
- Type: A
- Name: evo
- Points to: Your VPS IP address (212.213.181)
- TTL: 3600
- Add a new A record:
Screenshot showing the Hostinger DNS management interface with the evo subdomain A record pointing to IP 212.213.181 with TTL 300
After configuring the DNS record, verify that the subdomain is properly pointing to your VPS IP address.
Run the following command to check the DNS resolution:
dig +short evo.elshamyn8n.shopExpected Output:
212.1.213.181
This confirms that the evo subdomain is correctly resolving to your VPS IP address.
In your VPS terminal, create a new folder for the Evolution API:
mkdir -p ~/evolution-api && cd ~/evolution-apiCreate the .env file with the required configuration:
cat > .env <<'EOF'
AUTHENTICATION_API_KEY=put your API Key
SERVER_TYPE=http
SERVER_PORT=8080
CONFIG_SESSION_PHONE_VERSION=2.3000.1023204200
SERVER_URL=https://evo.elshamyn8n.shop
DATABASE_ENABLED=true
DATABASE_PROVIDER=postgresql
DATABASE_CONNECTION_URI=postgresql://postgres:postgrespass@postgres:5432/evolution?schema=public
CACHE_REDIS_ENABLED=true
CACHE_REDIS_URI=redis://redis:6379/1
CACHE_REDIS_PREFIX_KEY=evolution_v2
EOFCreate the docker-compose.yml file:
cat > docker-compose.yml <<'EOF'
services:
evolution-api:
image: evoapicloud/evolution-api:latest
container_name: evolution_api
restart: always
env_file: [.env]
volumes:
- evolution_instances:/evolution/instances
networks:
- n8n_network
labels:
- "traefik.enable=true"
- "traefik.http.routers.evo.rule=Host(`evo.elshamyn8n.shop`)"
- "traefik.http.routers.evo.tls=true"
- "traefik.http.routers.evo.entrypoints=web,websecure"
- "traefik.http.routers.evo.tls.certresolver=mytlschallenge"
- "traefik.http.services.evo.loadbalancer.server.port=8080"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
postgres:
image: postgres:15
container_name: evolution_postgres
restart: always
environment:
POSTGRES_DB: evolution
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespass
volumes:
- evolution_pg:/var/lib/postgresql/data
networks:
- n8n_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d evolution"]
interval: 30s
timeout: 10s
retries: 3
redis:
image: redis:7-alpine
container_name: evolution_redis
restart: always
command: ["redis-server", "--appendonly", "yes"]
networks:
- n8n_network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
volumes:
evolution_instances:
evolution_pg:
networks:
n8n_network:
external: true
name: root_default
EOFDeploy the Evolution API stack:
docker compose up -dNext steps will be added in the following sections...
