Railway

Deploy Keila | Open Source Mailchimp Alternative

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

Deploy Keila | Open Source Mailchimp Alternative

/var/lib/postgresql/data

Just deployed

/opt/app/uploads

Keila logo

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

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

  • Keilapentacent/keila:0.19.1 (GitHub, Docker Hub)
  • Postgres — Railway-managed Postgres (also used as the Oban background job queue)

Environment Variables Reference

VariablePurpose
DB_URLPostgres connection string (references ${{Postgres.DATABASE_URL}})
SECRET_KEY_BASEPhoenix session signing key, ≥64 chars
URL_HOSTPublic hostname — set to ${{RAILWAY_PUBLIC_DOMAIN}}
URL_SCHEMA / URL_PORTPublic scheme + port for generated links (https/443)
KEILA_USER / KEILA_PASSWORDBootstrap-only root admin credentials
MAILER_SMTP_*System SMTP for password reset and signup confirmation emails
USER_CONTENT_DIRDirectory for uploaded campaign images (mount your volume here)
DISABLE_REGISTRATIONSet true to lock down public account creation

Deployment Dependencies

Hardware Requirements for Self-Hosting Keila on Railway

ResourceMinimumRecommended
CPU1 vCPU1–2 vCPU
RAM512 MB1–2 GB (heavier when sending to >50k contacts)
Storage2 GB5–10 GB (for campaign images on volume)
RuntimePostgres 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 [email protected] \
  -e KEILA_PASSWORD=changemepls \
  -e MAILER_SMTP_HOST=smtp.example.com \
  -e MAILER_SMTP_PASSWORD=smtppass \
  -e [email protected] \
  --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.


Template Content

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

Shahed Nasser