---
title: "Deploy Waline — Self-Hosted Disqus Alternative for Blogs"
description: "Self-host Waline: fast, ad-free Disqus alternative. Import your comments."
category: "Other"
url: https://railway.com/deploy/waline-disqus-alternative
---

# Deploy Waline — Self-Hosted Disqus Alternative for Blogs

Self-host Waline: fast, ad-free Disqus alternative. Import your comments.

**[Deploy Waline — Self-Hosted Disqus Alternative for Blogs on Railway](https://railway.com/template/waline-disqus-alternative)**

- **Creator:** SilverBanana
- **Category:** Other
- **Total deploys:** 1

## Template content

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

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

### Waline https://devicons.railway.com/i/waline.svg

- **Source:** walinejs/railway-starter

## Documentation

# Deploy and Host Waline on Railway

Waline is a simple, safe, self-hosted comment system — the most feature-rich open-source
alternative to Disqus. Add a fast, privacy-friendly comment section to any blog or static site
(Hugo, Hexo, Astro, Jekyll, Next.js, VuePress) with Markdown, reactions, article view counts,
email/Telegram notifications, Akismet spam filtering, and a clean moderation dashboard. MIT
licensed, no tracking, no ads, and no per-page pricing.

Disqus loads heavy trackers, slows your pages, and now pushes ads into your comment section.
Waline on Railway gives you a fast, tracker-free comment backend with PostgreSQL persistence for
~$5/month flat — your readers' data on infrastructure you own, with a one-click importer from
Disqus, Twikoo, Valine, Commento, and Artalk.

---

## What This Template Deploys

| Service | Purpose |
|---|---|
| **Waline Server** | The comment backend and moderation dashboard — REST API the comment widget calls, on the public web service |
| **PostgreSQL** | Persistent storage for comments, reactions, view counts, and user data — survives every redeploy |

Both services connect over Railway's private network with credentials injected automatically.
Using PostgreSQL (not an ephemeral SQLite file) is what keeps your comments safe across redeploys
— the correct production setup for Waline on Railway.

---

## About Hosting Waline

Waline is a serverless-style Node.js comment backend that needs a database and a public HTTPS
endpoint. Free-hosting paths (Vercel + a free cloud DB) work for hobby sites but couple your
comments to a third-party database that can expire or rate-limit. Running Waline with its own
PostgreSQL gives you a durable, self-owned comment store.

Railway provisions the Waline server and a managed PostgreSQL over private networking, with
automatic HTTPS and the database connection wired for you. Point your site's Waline widget at the
Railway URL and comments flow into your own database.

Typical cost: **~$5/month** on Railway's Hobby plan for Waline and PostgreSQL. Disqus is "free"
but monetizes with ads and trackers on your readers; Hyvor Talk and Commento Cloud charge
$5–14/month. Waline self-hosted is flat compute with no ads, no trackers, and no per-pageview fee.

---

## Deploy in Under 5 Minutes

1. Click **Deploy on Railway** — Waline and PostgreSQL build automatically (~2–3 minutes)
2. The PostgreSQL connection is wired automatically via Railway reference variables
3. Set `JWT_TOKEN` to a random secret and `SITE_URL` to your website's URL
4. Open your Railway URL and register — the **first account becomes the admin**
5. Add the Waline widget to your site, pointing `serverURL` at your Railway domain

No SSH. No database setup. No SQLite file to lose on redeploy.

---

## Common Use Cases

- **Self-hosted alternative to Disqus** — drop the trackers, ads, and page-slowing scripts;
  Waline loads fast and keeps reader data in your own database
- **Comments for Hugo, Hexo, Astro, and Jekyll** — add a comment section to any static-site
  generator with a lightweight widget and your own backend
- **Migrate off Disqus without losing comments** — Waline's importer brings across comments from
  Disqus, Twikoo, Valine, Typecho, Commento, and Artalk
- **Privacy-friendly comments for GDPR** — no third-party trackers; reader comments and emails
  stay in your PostgreSQL instance, not a data broker's cloud
- **Article reactions and view counts** — Waline includes emoji reactions and per-article page
  view counters alongside comments, all from one backend
- **Multi-notification moderation** — get email, Telegram, or webhook alerts on new comments and
  approve or block them from the dashboard, with Akismet and keyword spam filtering

---

## Configuration

| Variable | Required | Description |
|---|---|---|
| `JWT_TOKEN` | ✅ Required | Random secret for signing login tokens — set a strong value |
| `SITE_URL` | ✅ Required | Your website's URL — used in notifications and links |
| `SITE_NAME` | Recommended | Your site's name, shown in notification emails |
| `PG_HOST` / `POSTGRES_*` | ✅ Auto-injected | PostgreSQL connection details via Railway reference variables |
| `SMTP_HOST` / `SMTP_USER` / `SMTP_PASS` | Optional | SMTP for email notifications — use an HTTPS relay (Resend, Brevo) on Hobby |
| `AKISMET_KEY` | Optional | Akismet API key for spam filtering (enabled by default; set `false` to disable) |
| `TG_BOT_TOKEN` / `TG_CHAT_ID` | Optional | Telegram notifications for new comments |
| `SECURE_DOMAINS` | Recommended | Restrict which domains can post to your Waline instance |

> The **first user to register becomes the admin** — register immediately after deploy so no one
> else claims it. Set `SECURE_DOMAINS` to your site's domain so other sites can't post comments to
> your instance. On Railway Hobby, use an HTTPS email relay for notifications since raw SMTP is blocked.

---

## Waline vs. Comment Systems

| | Waline (Railway) | Disqus | Commento Cloud | giscus |
|---|---|---|---|---|
| **Monthly cost** | ~$5 flat | Free (ads) | $5–10/mo | Free |
| **Ads / trackers** | ✅ None | ❌ Both | ✅ None | ✅ None |
| **Self-hosted / own data** | ✅ Your PostgreSQL | ❌ Disqus cloud | ⚠️ Paid self-host | ⚠️ GitHub issues |
| **Works without reader login** | ✅ Yes | ✅ Yes | ✅ Yes | ❌ Needs GitHub |
| **Markdown + reactions** | ✅ Yes | ⚠️ Limited | ⚠️ Basic | ✅ Yes |
| **View counts** | ✅ Built-in | ❌ No | ❌ No | ❌ No |
| **Import from Disqus** | ✅ Yes | N/A | ✅ Yes | ⚠️ Manual |
| **Spam filtering (Akismet)** | ✅ Yes | ✅ Yes | ⚠️ Basic | N/A |
| **Open source** | ✅ MIT | ❌ No | ✅ Yes | ✅ MIT |

---

## Dependencies for Waline Hosting

- Railway account — Hobby plan (~$5/month) covers Waline and PostgreSQL
- A website or blog to embed the Waline widget on (Hugo, Hexo, Astro, Jekyll, Next.js, etc.)
- Optional: SMTP relay (Resend/Brevo), Akismet key, or Telegram bot for notifications

### Deployment Dependencies

- [Waline GitHub Repository](https://github.com/walinejs/waline) — source and releases
- [Waline Documentation](https://waline.js.org/) — setup, client config, and migration guides
- [Waline Client Setup](https://waline.js.org/guide/get-started/) — embed the widget on your site
- [Waline Migration Guide](https://waline.js.org/guide/migration/) — import from Disqus and others
- [Railway Documentation](https://docs.railway.com) — deployment and variables

### Implementation Details

This template deploys the Waline server alongside a Railway-managed PostgreSQL instance over
private networking, with the database connection wired via reference variables. Using PostgreSQL
rather than Waline's default SQLite is deliberate: a SQLite file on an ephemeral container would
lose comments on redeploy, while PostgreSQL persists them independently of the app container.

Set `JWT_TOKEN` and `SITE_URL` after deploy, then register the first account to claim admin. On
your website, install `@waline/client` and set `serverURL` to your Railway domain — the widget
calls the Waline API and comments appear instantly. Set `SECURE_DOMAINS` to lock posting to your
own site.

---

## Frequently Asked Questions

**Why move off Disqus to Waline?**
Disqus loads heavy third-party trackers that slow your pages and expose reader data, and it now
inserts ads into comment sections on free plans. Waline is lightweight, tracker-free, ad-free, and
self-hosted — your readers' comments live in your own PostgreSQL. Waline's importer brings your
existing Disqus comments across so you don't lose history.

**Which sites does Waline work with?**
Any site that can embed a script — Hugo, Hexo, Astro, Jekyll, VuePress, Next.js, and plain HTML.
Install `@waline/client`, point `serverURL` at your Railway instance, and the comment box renders
where you place it.

**Do I lose comments if Railway redeploys?**
No — this template stores comments in Railway-managed PostgreSQL, which persists independently of
the app container. (This is why PostgreSQL matters: a default SQLite file inside the container
would be lost on redeploy.) Redeploys and updates don't affect your comment data.

**How do I stop spam?**
Waline enables Akismet spam filtering by default (add your `AKISMET_KEY`), supports keyword
filtering and IP blocklists, and lets you require moderation before comments appear. You can also
get email or Telegram alerts to approve or block comments quickly.

**How do I become the admin?**
The first account to register on your Waline instance becomes the admin. Register immediately
after deploy so no one else can claim it, then manage all comments from the dashboard.

**Can I migrate my existing comments?**
Yes. Waline imports from Disqus, Twikoo, Valine, Typecho, Commento, and Artalk. Export from your
current system and use Waline's migration tooling to load the comments into your PostgreSQL, per
the official migration guide.

---

## Why Deploy and Host Waline 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 Waline on Railway, you get a fast, privacy-friendly, self-hosted comment system —
Markdown, reactions, view counts, spam filtering, and a Disqus importer — backed by your own
PostgreSQL at ~$5/month flat, with no ads, no trackers, and full ownership of your readers' data.

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] 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/waline-disqus-alternative
