---
title: "Deploy wacli (Self-Hosted)"
description: "Self-host wacli with persistent WhatsApp sessions and continuous sync."
category: "Automation"
url: https://railway.com/deploy/wacli-self-hosted
---

# Deploy wacli (Self-Hosted)

Self-host wacli with persistent WhatsApp sessions and continuous sync.

**[Deploy wacli (Self-Hosted) on Railway](https://railway.com/template/wacli-self-hosted)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/wacli-self-hosted/manifest.json

- **Creator:** Hosmel Quintana's Projects
- **Category:** Automation

## Template content

### wacli https://wacli.sh/favicon.svg

- **Image:** ghcr.io/hosmelq/railway-wacli-template:latest

## Documentation

# Deploy and Host wacli (Self-Hosted) on Railway

wacli is a command-line WhatsApp client for syncing messages, searching local history, and sending text or media. This template includes a prebuilt image, persistent session storage, and continuous sync after you link your phone.

## About Hosting wacli (Self-Hosted)

The template deploys one worker with a persistent `/data` volume. Your linked-device session, messages, and downloaded media survive redeployments. The worker waits for you to pair WhatsApp, then starts continuous sync automatically. No public domain or separate database is required.

## Common Use Cases

- Keep a searchable copy of WhatsApp conversations on your own infrastructure.
- Search synced messages from the terminal or scripts.
- Use WhatsApp CLI commands in your own workflows.

## Dependencies for wacli (Self-Hosted) Hosting

- Persistent storage, included in this template.
- A WhatsApp account and access to its primary phone.
- Railway SSH access to pair the phone and run commands.

### Deployment Dependencies

- https://wacli.sh
- https://github.com/openclaw/wacli

### Implementation Details

After deployment, open the wacli service’s SSH terminal and run `wacli-pair`. On your phone, open WhatsApp → Linked devices → Link a device and scan the QR code. You can also run `wacli-pair --phone +15551234567` to link using a phone-number code. Once pairing and the initial sync finish, the worker starts continuous sync.

Run `wacli-run --json auth status` to check your session and `wacli-run messages search "invoice"` to search synced history. Keep one replica per volume. The template does not send messages automatically. wacli uses the WhatsApp Web protocol and is not affiliated with WhatsApp or Meta.

See the [source repository](https://github.com/hosmelq/railway-wacli-template) and [wacli documentation](https://wacli.sh) for setup and commands.

## Why Deploy wacli (Self-Hosted) on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying wacli (Self-Hosted) on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/wacli-self-hosted
