Deploy Self-Hosted Evolution API
[Jun'26] The cheapest self-hosted WhatsApp REST API
Just deployed
/var/lib/postgresql/data
evolution-api
Just deployed
/evolution/instances
Deploy and Host Evolution API with PostgreSQL on Railway
Evolution API with PostgreSQL is a lightweight Evolution API deployment template for Railway. It runs Evolution API with PostgreSQL for reliable data persistence, local cache for simpler operation, and no Redis dependency, making it a practical low-cost option for hosting a WhatsApp HTTP REST API backend.
About Hosting Evolution API with PostgreSQL
Hosting Evolution API with PostgreSQL on Railway gives you a fast way to run Evolution API with the required database layer already connected. PostgreSQL stores application data such as instances, messages, contacts, sessions, and other API-related records, while local cache keeps the setup simpler by avoiding an additional Redis service.
This template is useful for demos, personal projects, lightweight automation, and small-to-medium WhatsApp API workloads. Railway handles service deployment, networking, environment variables, public domain setup, PostgreSQL provisioning, and optional persistent volume storage.
Compared to a Redis-backed setup, this version keeps the infrastructure lighter and cheaper while still using PostgreSQL as the main database provider required by Evolution API.
Common Use Cases
- Running a lightweight WhatsApp REST API backend
- Hosting Evolution API with PostgreSQL persistence
- Building WhatsApp automations for personal or small business projects
- Connecting WhatsApp workflows with n8n, Typebot, Chatwoot, or custom apps
- Creating a low-cost Evolution API starter environment without Redis
- Testing Evolution API before scaling to a larger production stack
Dependencies for Evolution API with PostgreSQL Hosting
- Evolution API service
- PostgreSQL database
- Optional Railway volume for persistent instance/session files
Deployment Dependencies
Implementation Details
This template deploys Evolution API with PostgreSQL as the database provider and local cache enabled. Redis is disabled to keep the deployment lighter.
PORT=8080
SERVER_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
CACHE_LOCAL_ENABLED=true
CACHE_REDIS_ENABLED=false
DATABASE_PROVIDER=postgresql
DATABASE_CONNECTION_URI=${{Postgres.DATABASE_URL}}
AUTHENTICATION_API_KEY=${{secret(64, "abcdef0123456789")}}
If your Evolution API image requires the database layer to be explicitly enabled, you can also include:
DATABASE_ENABLED=true
PostgreSQL Configuration
This template uses PostgreSQL as the main database provider for Evolution API.
Recommended Railway variable:
DATABASE_CONNECTION_URI=${{Postgres.DATABASE_URL}}
PostgreSQL is required because Evolution API needs a valid database provider during startup. If DATABASE_PROVIDER is missing or empty, the service may fail with an error similar to:
Error: Database provider invalid.
For this template, the database provider should be:
DATABASE_PROVIDER=postgresql
Persistent Volume Configuration
This template can optionally use a Railway volume mounted into the Evolution API service to persist instance-related files.
Recommended volume configuration:
Mount Path: /evolution/instances
Initial Size: 5.00 GB
Resize: Live resize supported
The volume is mounted to the following directory inside the evolution-api service:
/evolution/instances
This mount is useful because Evolution API may store instance/session-related files in the instances directory. By using a persistent volume, the data in this path can remain available even when the service is redeployed or restarted.
The default volume size can start at 5.00 GB. Railway only charges for the amount of data stored, and the volume can be resized later using Live Resize when more storage is needed.
Important Notes
This template includes PostgreSQL and does not include Redis.
That makes the deployment lighter than a full PostgreSQL + Redis stack, while still keeping the database persistence required by Evolution API. For heavier production workloads, high-volume messaging, or larger multi-instance usage, consider using a full setup with PostgreSQL and Redis.
Use this PostgreSQL version when you want:
- A lightweight Evolution API deployment
- PostgreSQL-backed persistence
- No Redis dependency
- Lower Railway resource usage
- A quick testing or demo environment
- A WhatsApp API backend for small automations
How to Access the Evolution API Manager
After the deployment is complete, Railway will generate a public URL for your Evolution API service. You can use this public URL to confirm that the API is running and to find the Manager URL.
-
Open the public URL of your Evolution API service.
You should see a response similar to this:
{ "status": 200, "message": "Welcome to the Evolution API, it is working!", "version": "2.3.7", "clientName": "evolution_exchange", "manager": "http://XXXXXX.up.railway.app/manager", "documentation": "https://doc.evolution-api.com", "whatsappWebVersion": "2.3000.1040316331" } -
Copy the value from the
managerfield.Example:
http://XXXXXX.up.railway.app/manager -
Open the Manager URL in your browser.
-
When the Manager asks for the API Key Global, use the value of
AUTHENTICATION_API_KEYfrom your Evolution API service.You can find it in Railway by opening your Evolution API service, then going to the Variables tab.
-
Paste the
AUTHENTICATION_API_KEYvalue into the API Key Global field. -
Congrats, you are now inside the Evolution API Manager and can start creating or managing WhatsApp instances.
Create a WhatsApp Instance
After you are inside the Evolution API Manager, create a new WhatsApp instance.
Use this simple starter configuration:
Instance name: main
Channel: Baileys
The instance name main is recommended for a simple starter setup. If you use this Evolution API service later with n8n, Chatwoot, Typebot, or another automation tool, you can use main as the instance name in your API endpoint.
After creating the instance, open the connection or QR code page in the Manager.
Then scan the QR code using WhatsApp on your phone:
WhatsApp -> Linked devices -> Link a device -> Scan QR code
Wait until the instance status becomes connected.
After the instance is connected, you can test it by sending a WhatsApp message from another number to the connected WhatsApp account. If the message appears in the Evolution API Manager or the instance stays connected successfully, your Evolution API setup is ready to use.
You can now start using Evolution API as a WhatsApp HTTP REST API backend for automations, alerts, notifications, or integrations with tools such as n8n, Chatwoot, Typebot, or your own custom application.
Why Deploy Evolution API with PostgreSQL on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you do not have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Evolution API with PostgreSQL on Railway, you get a simple and reliable way to start using Evolution API with database-backed persistence. It is ideal for testing, demos, personal automation, and lightweight WhatsApp API workloads without running an additional Redis service.
Template Content
evolution-api
evoapicloud/evolution-api:latest