Railway

Deploy Evolution API with postgres

WhatsApp HTTP REST API with PostgreSQL and persistent storage.

Deploy Evolution API with postgres

Just deployed

/evolution/instances

/var/lib/postgresql/data

Railway

Deploy and Host Evolution API with PostgreSQL on Railway

Evolution API with PostgreSQL is a simple, low-cost Evolution API deployment template for Railway. It includes the core services needed to run Evolution API with PostgreSQL and persistent volume storage, giving you a lightweight WhatsApp HTTP REST API backend that is easy to deploy, manage, and scale without complex server configuration.

Imgur

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 service already connected. PostgreSQL stores application data such as instances, messages, contacts, and session-related information. Railway handles the infrastructure layer, including service deployment, networking, environment variables, public domain setup, and persistent storage.

This template is designed for users who want a simpler Evolution API deployment without Redis while still keeping PostgreSQL and persistent storage in place. Once deployed, you can access the API, open the manager, connect WhatsApp instances, and start building automation workflows.

Common Use Cases

  • WhatsApp automation for sending messages, alerts, and notifications
  • Connecting WhatsApp workflows with n8n, Chatwoot, Typebot, or custom apps
  • Running a lightweight Evolution API backend for personal, agency, or SaaS projects

Dependencies for Evolution API with PostgreSQL Hosting

  • PostgreSQL database
  • Railway volume for persistent instance storage

Deployment Dependencies

Implementation Details

This template deploys Evolution API with PostgreSQL and a mounted Railway volume. Environment variables are configured using Railway reference variables, so the Evolution API service can connect directly to the PostgreSQL service.

PORT=8080
SERVER_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
DATABASE_PROVIDER=postgresql
AUTHENTICATION_API_KEY=${{secret(64, "abcdef0123456789")}}
DATABASE_CONNECTION_URI=${{Postgres.DATABASE_URL}}

This template does not include Redis. It is intended as a simpler PostgreSQL-based setup for users who want a lighter stack while still keeping database persistence and volume storage.

Persistent Volume Configuration

This template can 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. This helps reduce the risk of losing local instance data that should survive normal deployment changes.

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.

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.

  1. 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"
    }
    
  2. Copy the value from the manager field.

    Example:

    http://XXXXXX.up.railway.app/manager
    
  3. Open the Manager URL in your browser.

  4. When the Manager asks for the API Key Global, use the value of AUTHENTICATION_API_KEY from your Evolution API service.

    You can find it in Railway by opening your Evolution API service, then going to the Variables tab.

  5. Paste the AUTHENTICATION_API_KEY value into the API Key Global field.

  6. 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 simpler Evolution API stack with the most important persistence layer included. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
N8N Main + Worker
Deploy and Host N8N with Inactive worker.

jakemerson
View Template
NEW
Evolution API with n8n
WhatsApp HTTP REST API with n8n automation, PostgreSQL and Redis.

codestorm
View Template
Postgres Backup
Cron-based PostgreSQL backup to bucket storage

Railway Templates