Deploy Commento++
Fast, Lightweight Comments Box that You Can Embed in Your Static Website.
Just deployed
/var/lib/postgresql/data
commentoplusplus
Just deployed
Deploy and Host Commento++ on Railway
Commento++ is a fast, lightweight, privacy-focused open-source commenting engine. Designed as a modern community-driven continuation of Commento, it allows website owners to embed privacy-conscious, ad-free comment sections into blogs, static sites, and documentation portals. This Railway template deploys the core Commento++ application (commentoplusplus) paired with a high-availability PostgreSQL database (postgres) with persistent storage.
About Hosting Commento++
Hosting Commento++ on Railway provisions a two-tier container architecture:
- Commento++ (
commentoplusplus): The main web server and comment widget API runningcaroga/commentoplusplus:v1.8.7. It serves the admin dashboard, handles comment moderation and embedding scripts, listens internally on port8080, and communicates with the database over Railway's private network. - PostgreSQL Database (
postgres): A relational database container usingghcr.io/railwayapp-templates/postgres-ssl:latest. It mounts a persistent volume at/var/lib/postgresql/datato ensure all comments, registered user profiles, and site domain configurations persist across deployments.
Common Use Cases
- Privacy-focused commenting engine: Replace invasive commenting platforms like Disqus with an ad-free, tracking-free commenting system.
- Static site & blog integration: Easily embed comment sections on Hugo, Jekyll, Astro, Next.js, Gatsby, or WordPress sites.
- Multi-domain support: Enable wildcard domain matching (
COMMENTO_ENABLE_WILDCARDS=true) to embed comment widgets across multiple subdomains or external sites. - Self-hosted community discussions: Maintain full ownership of user data, comments, and moderation logs on your own cloud infrastructure.
Dependencies for Commento++ Hosting
- Commento++ image:
caroga/commentoplusplus:v1.8.7 - PostgreSQL image:
ghcr.io/railwayapp-templates/postgres-ssl:latest - One persistent volume mounted at
/var/lib/postgresql/dataon thepostgresservice - Railway public domain mapped to port
8080forcommentoplusplus - Auto-generated secrets: PostgreSQL password (
POSTGRES_PASSWORD)
Upstream: GitHub (caroga/commentoplusplus) · Docker Hub
Implementation Details
| Service | Image | Role | Internal Port | Volume Mount |
|---|---|---|---|---|
| commentoplusplus | caroga/commentoplusplus:v1.8.7 | Commenting Engine & Admin Web UI | 8080 | None |
| postgres | ghcr.io/railwayapp-templates/postgres-ssl:latest | PostgreSQL Database (SSL enabled) | 5432 | /var/lib/postgresql/data |
Topology
| Service | Role | Volume | Public | Notes |
|---|---|---|---|---|
| commentoplusplus | Main Server & Widget API | None | Yes (Port 8080) | Connects to postgres using internal URI |
| postgres | Relational Database | /var/lib/postgresql/data | TCP Proxy (Port 5432) | High availability template (postgres-ha) |
Volumes (drives) — what to mount
| Service | Mount path | What is stored |
|---|---|---|
| postgres | /var/lib/postgresql/data | Relational database files, comments, user accounts, and domain settings |
Warning: Do not remove or detach the
/var/lib/postgresql/datavolume on thepostgresservice — deleting this volume will permanently erase all published comments, user accounts, and site registrations during redeployments.
Quick Start
- Click the Deploy on Railway button above.
- Sign in (or create a free Railway account) and click Deploy.
- Wait 1–2 minutes for both the
postgresdatabase andcommentoplusplusapplication services to provision. - Open the commentoplusplus service → Settings → Networking and click the generated public domain URL.
- Register the initial owner account through the web dashboard. The first account created automatically gains administrative permissions.
- Add your website domain in the Commento++ dashboard, copy the HTML embed snippet, and paste it into your site templates.
Configuration
Commento++ Variables (commentoplusplus)
| Variable | Default / Source | Description / Notes |
|---|---|---|
COMMENTO_ORIGIN | https://${{RAILWAY_PUBLIC_DOMAIN}} | Public canonical origin URL where Commento++ is hosted |
COMMENTO_POSTGRES | postgres://${{postgres.POSTGRES_USER}}:${{postgres.POSTGRES_PASSWORD}}@${{postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{postgres.POSTGRES_DB}}?sslmode=disable | Connection string for internal PostgreSQL database |
COMMENTO_ENABLE_WILDCARDS | true | Allows embedding the comment widget across wildcard domains and subdomains |
PORT | 8080 | Internal port the HTTP server listens on |
Database Variables (postgres)
| Variable | Default / Source | Description / Notes |
|---|---|---|
POSTGRES_DB | postgres | Name of the default database created on startup |
POSTGRES_USER | postgres | Administrative database user |
POSTGRES_PASSWORD | Auto-generated secret (16 chars) | Secure database access password |
DATABASE_URL | postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}} | Internal private connection URL |
DATABASE_PUBLIC_URL | Connection string via TCP Proxy | External connection URL for remote database management |
SSL_CERT_DAYS | 820 | Certificate validity period for SSL connections |
PGDATA | /var/lib/postgresql/data/pgdata | Subdirectory path for PostgreSQL data files |
Custom Domain
- Open the commentoplusplus service → Settings → Networking → Custom Domain.
- Add your custom domain (e.g.
comments.yourdomain.com) and follow Railway’s DNS setup instructions. - Update the
COMMENTO_ORIGINenvironment variable on thecommentoplusplusservice to match your new URL (https://comments.yourdomain.com). - Railway provisions TLS automatically.
Updating Commento++
- Open the commentoplusplus service → Settings → Source.
- Update the image tag (e.g.,
caroga/commentoplusplus:v1.8.7to a newer version). - Click Redeploy.
All comments and database records remain safe inside the attached PostgreSQL volume.
Traps
Common pitfalls and failure modes:
COMMENTO_ORIGINMismatch — Commento++ relies heavily onCOMMENTO_ORIGINfor security verification and CORS checks. If you attach a custom domain or change the public domain without updatingCOMMENTO_ORIGIN, the embedded comment widget will fail to load or throw origin error blocks.- Missing PostgreSQL Volume — Removing or detaching the
/var/lib/postgresql/datavolume on thepostgresservice will permanently erase all user accounts, comments, and registered site settings. - Initial Registration Security — Anyone can register the first account on a fresh Commento++ instance to claim administrator privileges. Ensure you access the domain immediately after deployment and complete the registration step.
- Database Connection
sslmode— The connection string usessslmode=disablebecause communication takes place over Railway's isolated internal private network (${{postgres.RAILWAY_PRIVATE_DOMAIN}}). Altering this parameter without configuring database certificates may prevent Commento++ from connecting to PostgreSQL.
Why Deploy Commento++ on Railway?
Railway delivers a seamless environment for running containerized web services and databases. Deploying Commento++ on Railway provides private service networking, persistent volume mounts, automated HTTPS certificates, and effortless single-click deployments without complex server maintenance.
Template Content
commentoplusplus
caroga/commentoplusplus:v1.8.7