---
title: "Deploy OpenWA (w/ Postgres, Redis and MinIO)"
description: "Deploy OpenWA on Railway. WhatsApp REST API. One click."
category: "Bots"
url: https://railway.com/deploy/openwa-w-postgres-redis-and-minio
---

# Deploy OpenWA (w/ Postgres, Redis and MinIO)

Deploy OpenWA on Railway. WhatsApp REST API. One click.

**[Deploy OpenWA (w/ Postgres, Redis and MinIO) on Railway](https://railway.com/template/openwa-w-postgres-redis-and-minio)**

- **Creator:** RBR Digital
- **Category:** Bots
- **Total deploys:** 4

## Template content

### MinIO https://cdn.prod.website-files.com/681c8426519d8db8f867c1e8/681c8426519d8db8f867c1f2_favicon-32x32.png

- **Image:** minio/minio
- **Start command:** `minio server /data --console-address ":9001"`

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### OpenWA API https://www.open-wa.org/assets/openwa_logo.webp

- **Image:** ghcr.io/rmyndharis/openwa:latest
- **Public domain:** Yes

## Documentation

# Deploy and Host OpenWA on Railway

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/mFYefU?utm_medium=integration&utm_source=template&utm_campaign=generic)

OpenWA is an open-source WhatsApp automation platform built on top of WhatsApp Web. Connect personal or business WhatsApp accounts through a REST API to send messages, manage chats, receive webhooks, and automate workflows without requiring Meta Business API approval.

## About Hosting OpenWA

Hosting OpenWA on Railway requires persistent storage for WhatsApp authentication sessions, media files, plugins, and database data. This template provisions a complete OpenWA stack including PostgreSQL, Redis, and MinIO object storage.

This template uses the prebuilt Docker image:
```txt
ghcr.io/rmyndharis/openwa:latest
```

Railway provisions networking, SSL, deployments, private networking, and persistent storage automatically.

## Common Use Cases
- WhatsApp chatbots and automation
- Customer support integrations
- Workflow automation with webhooks
- Notifications and alerts
- Multi-session WhatsApp management
- Media storage and automation pipelines

## Dependencies for OpenWA Hosting
- Persistent volume (mount path: `/app/data`)
- PostgreSQL database
- Redis cache
- MinIO S3-compatible object storage

### Deployment Dependencies
- [OpenWA GitHub](https://github.com/rmyndharis/OpenWA)
- [Railway Documentation](https://docs.railway.com)

### Implementation Details

**Docker image:**
```txt
ghcr.io/rmyndharis/openwa:latest
```

**Environment variables** (use Railway reference syntax when deploying):

| Variable               | Value                                                                         |
| ---------------------- | ----------------------------------------------------------------------------- |
| `NODE_ENV`             | `production`                                                                  |
| `API_PORT`             | `2785`                                                                        |
| `LOG_LEVEL`            | `info`                                                                        |
| `DATABASE_TYPE`        | `postgres`                                                                    |
| `DATABASE_HOST`        | `${{Postgres.PGHOST}}`                                                        |
| `DATABASE_PORT`        | `${{Postgres.PGPORT}}`                                                        |
| `DATABASE_USERNAME`    | `${{Postgres.PGUSER}}`                                                        |
| `DATABASE_PASSWORD`    | `${{Postgres.PGPASSWORD}}`                                                    |
| `DATABASE_NAME`        | `${{Postgres.PGDATABASE}}`                                                    |
| `DATABASE_SYNCHRONIZE` | `false`                                                                       |
| `ENGINE_TYPE`          | `whatsapp-web.js`                                                             |
| `SESSION_DATA_PATH`    | `/app/data/sessions`                                                          |
| `STORAGE_TYPE`         | `s3`                                                                          |
| `STORAGE_LOCAL_PATH`   | `/app/data/media`                                                             |
| `S3_ENDPOINT`          | `http://${{MinIO.RAILWAY_PRIVATE_DOMAIN}}:9000`                               |
| `S3_ACCESS_KEY`        | `${{MinIO.MINIO_ROOT_USER}}`                                                  |
| `S3_SECRET_KEY`        | `${{MinIO.MINIO_ROOT_PASSWORD}}`                                              |
| `S3_BUCKET`            | `openwa`                                                                      |
| `REDIS_ENABLED`        | `true`                                                                        |
| `REDIS_HOST`           | `${{Redis.RAILWAY_PRIVATE_DOMAIN}}`                                           |
| `REDIS_PORT`           | `6379`                                                                        |
| `PLUGINS_ENABLED`      | `true`                                                                        |
| `PLUGINS_DIR`          | `/app/data/plugins`                                                           |
| `PUPPETEER_HEADLESS`   | `true`                                                                        |
| `PUPPETEER_ARGS`       | `--no-sandbox,--disable-setuid-sandbox,--disable-dev-shm-usage,--disable-gpu` |

**Initial API Key:**

OpenWA automatically generates an API key during the first startup and prints it in the OpenWA API deployment logs.

After deployment:

1. Open the `OpenWA API` service in Railway.
2. Go to `Deploy Logs`.
3. Copy the generated API key.

API keys can later be managed through the API or the Dashboard.

**OpenWA Volume:** Mount `/app/data` for persistent WhatsApp sessions, plugins, SQLite fallback database, and media files.

**MinIO Volume:** Mount `/data` for persistent object storage.

**MinIO Start Command:**
```bash
minio server /data --console-address ":9001"
```

**Redis Start Command:**
```bash
redis-server --appendonly yes
```

**Public port:** `2785`

**Quick start (local):**
```bash
docker run -p 2785:2785 \
  -v openwa-data:/app/data \
  ghcr.io/rmyndharis/openwa:latest
```

API available at:
```txt
http://localhost:2785
```

## Why Deploy OpenWA on Railway?
Railway provides a simple way to deploy and scale OpenWA without managing servers, reverse proxies, SSL certificates, databases, cache infrastructure, or object storage manually.

By deploying OpenWA on Railway, you can run a complete WhatsApp automation infrastructure with PostgreSQL, Redis, MinIO, persistent storage, public networking, and automated deployments in minutes while focusing on your integrations and workflows instead of infrastructure management.

---

## Template Author

Created and maintained by **Douglas Rubim**.

GitHub: https://github.com/douglasrubims

## Similar templates

- [Telegram JavaScript Bot](https://railway.com/deploy/5lRkWa) — A template for Telegram bot in JavaScript using grammY
- [Cobalt Tools [Updated Aug ’26]](https://railway.com/deploy/cobalt) — Cobalt Tools [Aug ’26] (Media Downloader, Converter & Automation) Self Host
- [Telegram Gateway](https://railway.com/deploy/railway-telegram-gateway) — Multi-bot Telegram webhook gateway with real-time WebSocket event streaming

Open this page in a browser: https://railway.com/deploy/openwa-w-postgres-redis-and-minio
