---
title: "Deploy activepieces-template"
description: "Activepieces + Postgres and Redis. Generated secrets. Healthcheck."
category: "Automation"
url: https://railway.com/deploy/activepieces-template
---

# Deploy activepieces-template

Activepieces + Postgres and Redis. Generated secrets. Healthcheck.

**[Deploy activepieces-template on Railway](https://railway.com/template/activepieces-template)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/activepieces-template/manifest.json

- **Creator:** goat-general-prod
- **Category:** Automation

## Template content

### activepieces

- **Image:** ghcr.io/activepieces/activepieces
- **Health check:** /api/v1/pieces
- **Public domain:** Yes

### Redis

- **Image:** redis:7

### Postgres

- **Image:** postgres:16

## Documentation

# Deploy and Host Activepieces on Railway

Self-host [Activepieces](https://activepieces.com/) with Railway Postgres and Redis. Official `ghcr.io/activepieces/activepieces` image, one container in `WORKER_AND_APP` mode. This is the Apache-2.0 Zapier alternative on [c17.io/stacks/activepieces](https://c17.io/stacks/activepieces). n8n is a **separate** template: [9o4t/n8n](https://github.com/9o4t/n8n).

No LLM or SaaS API keys are required to boot. The template generates `AP_ENCRYPTION_KEY` and `AP_JWT_SECRET`, and wires `AP_FRONTEND_URL` to the public domain.

## About Hosting Activepieces

Activepieces is open-source workflow automation (pieces instead of Zapier apps). Connections are encrypted with `AP_ENCRYPTION_KEY`. The job queue is Redis. Structured data is Postgres.

On Railway this is three services:

| Service | Source | Public | Notes |
|---|---|---|---|
| `activepieces` | `ghcr.io/activepieces/activepieces` | Yes | `AP_PORT=${{PORT}}`. Health `GET /api/v1/health`. |
| `Postgres` | Railway plugin | No | Flows, runs, connections. |
| `Redis` | Railway plugin | No | BullMQ queue. Required for this image; in-memory Redis is not used. |

The first account you create becomes the platform admin. There is no default username or password.

Losing `AP_ENCRYPTION_KEY` makes stored connections unreadable, even from a full database backup.

## Common Use Cases

- Apache-2.0 replacement for Zapier / Make
- Webhook and polling pieces without a task meter
- MCP / agent tools on top of the same flows
- Customer-data automations you will not put on a SaaS graph

## Dependencies for Activepieces Hosting

### Required (wired or generated — you do not type these)

| Variable | Service | Source |
|---|---|---|
| `PORT` | activepieces | Injected. Also set `AP_PORT=${{PORT}}`. |
| `AP_FRONTEND_URL` | activepieces | `https://${{RAILWAY_PUBLIC_DOMAIN}}` |
| `AP_ENCRYPTION_KEY` | activepieces | Generated `openssl rand -hex 16` (32 hex chars). Back this up. |
| `AP_JWT_SECRET` | activepieces | Generated `openssl rand -hex 32`. |
| `AP_ENVIRONMENT` | activepieces | `prod` |
| `AP_EXECUTION_MODE` | activepieces | `UNSANDBOXED` (single-container Railway) |
| `AP_CONTAINER_TYPE` | activepieces | `WORKER_AND_APP` |
| `AP_DB_TYPE` | activepieces | `POSTGRES` |
| `AP_POSTGRES_URL` | activepieces | `${{Postgres.DATABASE_URL}}` (discrete host fields ignored when this is set) |
| `AP_REDIS_URL` | activepieces | `${{Redis.REDIS_URL}}` |

### Optional

| Variable | Required | Why |
|---|---|---|
| `AP_TELEMETRY_ENABLED` | No | Default `false` in this template. |
| `AP_OPENAI_API_KEY` | No | Only if you enable semantic piece search (`AP_TOOL_SEARCH_ENABLED=true`). BYO. |
| Slack / Google / other piece keys | No | Added inside Activepieces connections after deploy. Not template variables. |

### Volume

| Mount | Service | Why |
|---|---|---|
| `/usr/src/app/cache` | activepieces | Piece cache. Optional but avoids re-downloads on every deploy. |

## Why Deploy Activepieces on Railway?

Make and Zapier meter runs. Activepieces is Apache-2.0: you pay Railway (app + Postgres + Redis) and the APIs you call. A small team graph is usually a few dollars a month plus tokens. Trial credits cover the first deploy for most people. c17 never charges you — Railway usage is the referral / template kickback.

See `TEMPLATE.md` for the marketplace / composer shape.

## Run locally

```bash
cp .env.example .env
# set AP_ENCRYPTION_KEY (openssl rand -hex 16)
# set AP_JWT_SECRET and AP_POSTGRES_PASSWORD (openssl rand -hex 32)
docker compose up
```

UI: http://localhost:8080 — create the first admin account. Health: `GET /api/v1/health`.

## License

Activepieces is Apache-2.0. This repo is config and docs only.


## 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/activepieces-template
