---
title: "Deploy Keila | Open Source Mailchimp Alternative"
description: "Self-host Keila open-source newsletter tool, email marketing on Railway"
category: "Other"
url: https://railway.com/deploy/keila-newsletter
---

# Deploy Keila | Open Source Mailchimp Alternative

Self-host Keila open-source newsletter tool, email marketing on Railway

**[Deploy Keila | Open Source Mailchimp Alternative on Railway](https://railway.com/template/keila-newsletter)**

- **Creator:** Heimdall
- **Category:** Other
- **Total deploys:** 4

## Template content

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

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

### Keila https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/keila.svg

- **Image:** pentacent/keila:0.19.1
- **Public domain:** Yes

## Documentation

![Keila logo](https://app.keila.io/images/og_image-b39096c93ff3cf29e96fe0dbcccccef2.png?vsn=d)

# Deploy and Host Keila on Railway

Keila is an open-source, self-hosted newsletter and email marketing tool that lets you run your own opt-in mailing lists, send transactional and broadcast campaigns, and manage subscribers from a clean Phoenix LiveView dashboard. Self-host Keila on Railway to escape per-subscriber pricing from Mailchimp, Brevo, or ConvertKit while keeping full control of your subscriber data and sending reputation.

This Railway template deploys Keila using the official `pentacent/keila` Docker image, provisions a managed Postgres database (which doubles as Keila's Oban background job queue), and wires up a persistent volume for newsletter campaign images and uploaded user content.

## Getting Started with Keila on Railway

After the deploy finishes, visit the generated Railway URL — Keila will redirect you to `/auth/login`. Sign in with the `KEILA_USER` email and the `KEILA_PASSWORD` you set during deploy (these create the root admin account on first boot via `seeds.exs`). Before sending your first campaign, replace the placeholder SMTP variables (`MAILER_SMTP_HOST`, `MAILER_SMTP_PASSWORD`, `MAILER_SMTP_USER`, `MAILER_SMTP_FROM_EMAIL`) with credentials from a transactional email provider — Resend, SendGrid, AWS SES, Mailgun, or Postmark all work over standard SMTP. Then create your first sender, build a sign-up form, embed it on your site, and import or invite subscribers.

![Keila dashboard screenshot](https://res.cloudinary.com/asset-cloudinary/image/upload/v1777308044/69ec6df6-74a1-4908-835a-ffc630e98c31.png)

## About Hosting Keila on Railway

Keila is a complete email marketing platform built in Elixir/Phoenix. It handles subscriber lists with double opt-in confirmation, captcha-protected sign-up forms, drag-and-drop or HTML campaign editing, automatic bounce and complaint processing, click and open tracking, and segmentation by tag or custom field. Background sending uses Oban, a Postgres-backed job queue — there's no separate Redis dependency to deploy or pay for.

Key features:
- Opt-in subscriber management with double opt-in confirmation
- Drag-and-drop campaign editor plus raw HTML mode
- hCaptcha and Friendly Captcha support on public sign-up forms
- Automatic bounce, complaint, and unsubscribe handling
- Click and open tracking with public unsubscribe links
- Per-sender SMTP configuration (multiple senders per instance)
- API access for programmatic subscriber and campaign management
- AGPLv3 open source — no per-subscriber fees, ever

## Why Deploy Keila on Railway

Railway is the fastest path from "I want my own newsletter tool" to a working public URL with TLS, Postgres, and persistent storage already wired together.

- One-click deploy with managed Postgres included
- Free TLS and a public domain on first boot
- Built-in WebSocket support for the Phoenix LiveView admin UI
- Persistent volume for uploaded campaign images
- Pay only for the resources you actually use — no per-subscriber tax

## Common Use Cases for Self-Hosted Keila

- Replace Mailchimp or Brevo for personal blogs, newsletters, and indie projects
- Run a privacy-focused subscriber list with full GDPR data residency control
- Send product update emails from a SaaS without paying per-MAU pricing
- Power a Substack-style author newsletter on your own domain

## Dependencies for the Keila Railway Template

- **Keila** — `pentacent/keila:0.19.1` ([GitHub](https://github.com/pentacent/keila), [Docker Hub](https://hub.docker.com/r/pentacent/keila))
- **Postgres** — Railway-managed Postgres (also used as the Oban background job queue)

### Environment Variables Reference

| Variable | Purpose |
|---|---|
| `DB_URL` | Postgres connection string (references `${{Postgres.DATABASE_URL}}`) |
| `SECRET_KEY_BASE` | Phoenix session signing key, ≥64 chars |
| `URL_HOST` | Public hostname — set to `${{RAILWAY_PUBLIC_DOMAIN}}` |
| `URL_SCHEMA` / `URL_PORT` | Public scheme + port for generated links (`https`/`443`) |
| `KEILA_USER` / `KEILA_PASSWORD` | Bootstrap-only root admin credentials |
| `MAILER_SMTP_*` | System SMTP for password reset and signup confirmation emails |
| `USER_CONTENT_DIR` | Directory for uploaded campaign images (mount your volume here) |
| `DISABLE_REGISTRATION` | Set `true` to lock down public account creation |

### Deployment Dependencies

- Runtime: Elixir/OTP via the `pentacent/keila` Docker image
- GitHub: https://github.com/pentacent/keila
- Docs: https://www.keila.io/docs/configuration
- Docker Hub: https://hub.docker.com/r/pentacent/keila

## Hardware Requirements for Self-Hosting Keila on Railway

| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 1–2 vCPU |
| RAM | 512 MB | 1–2 GB (heavier when sending to >50k contacts) |
| Storage | 2 GB | 5–10 GB (for campaign images on volume) |
| Runtime | Postgres 13+ | Postgres 15+ |

## Self-Hosting Keila with Docker

If you want to run Keila locally before deploying on Railway, the official image works with a single Postgres dependency:

```
docker run -d --name keila-db \
  -e POSTGRES_USER=keila \
  -e POSTGRES_PASSWORD=keilapass \
  -e POSTGRES_DB=keila \
  postgres:15
```

```
docker run -d --name keila \
  -p 4000:4000 \
  -e DB_URL=postgres://keila:keilapass@keila-db/keila \
  -e SECRET_KEY_BASE=$(openssl rand -hex 64) \
  -e URL_HOST=localhost \
  -e KEILA_USER=admin@example.com \
  -e KEILA_PASSWORD=changemepls \
  -e MAILER_SMTP_HOST=smtp.example.com \
  -e MAILER_SMTP_PASSWORD=smtppass \
  -e MAILER_SMTP_FROM_EMAIL=noreply@example.com \
  --link keila-db \
  pentacent/keila:0.19.1
```

The Railway template wraps the same image with a managed Postgres, persistent volume, public TLS domain, and sane production defaults (registration disabled, update checks off).

## How Much Does Keila Cost to Self-Host?

Keila itself is 100% open source under AGPLv3 — no license fees, no per-subscriber pricing, no MAU caps. The only cost is the Railway infrastructure to run it: roughly $5–$10/month for a small list (under 5k contacts), scaling with RAM and outbound SMTP usage from your chosen provider (Resend, SES, Postmark, etc.). Compare against Mailchimp at $13–$135/month or ConvertKit at $25–$166/month for the same subscriber count.

## FAQ

**What is Keila and why self-host it?**
Keila is an open-source newsletter and email marketing tool — think Mailchimp or Brevo, but you own the data, control the sending domain, and pay only for compute. Self-hosting eliminates per-subscriber pricing and keeps your subscriber list out of third-party databases.

**What does this Railway template deploy?**
The template provisions the `pentacent/keila:0.19.1` Docker image, a managed Railway Postgres database, a persistent volume mounted at `/opt/app/uploads` for campaign images, and a public TLS-terminated domain pointing at port 4000.

**Why is Postgres included as a dependency?**
Keila uses Postgres for both application data (subscribers, lists, campaigns) and as the backing store for Oban, its background job queue that handles email delivery, bounce processing, and scheduled sends. There is no separate Redis service to deploy.

**How do I configure SMTP for Keila on Railway?**
Set `MAILER_SMTP_HOST`, `MAILER_SMTP_USER`, `MAILER_SMTP_PASSWORD`, and `MAILER_SMTP_FROM_EMAIL` to credentials from any transactional email provider (Resend, SendGrid, AWS SES, Mailgun, Postmark). The Phoenix runtime requires these to be set before first boot — the container will not start without them.

**How do I disable public sign-ups on my Keila instance?**
Set `DISABLE_REGISTRATION=true` after creating your root admin user. This blocks the public `/auth/register` page so only invited users (added via the admin UI) can create accounts on your self-hosted Keila.

**Can I send transactional emails through Keila's API?**
Yes. Keila exposes a REST API for programmatically managing subscribers, lists, and triggering campaigns — useful for SaaS apps that want to send onboarding sequences or product update emails from their own newsletter infrastructure.

**Does Keila on Railway support double opt-in?**
Yes. Double opt-in is enabled by default on every list — subscribers must click a confirmation link before they receive any campaigns. This is the AUP-compliant way to send bulk email and keeps your sender reputation healthy.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/keila-newsletter
