Deploy Commento++

Fast, Lightweight Comments Box that You Can Embed in Your Static Website.

Deploy Commento++

/var/lib/postgresql/data

Just deployed

Deploy on Railway

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 running caroga/commentoplusplus:v1.8.7. It serves the admin dashboard, handles comment moderation and embedding scripts, listens internally on port 8080, and communicates with the database over Railway's private network.
  • PostgreSQL Database (postgres): A relational database container using ghcr.io/railwayapp-templates/postgres-ssl:latest. It mounts a persistent volume at /var/lib/postgresql/data to 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/data on the postgres service
  • Railway public domain mapped to port 8080 for commentoplusplus
  • Auto-generated secrets: PostgreSQL password (POSTGRES_PASSWORD)

Upstream: GitHub (caroga/commentoplusplus) · Docker Hub

Implementation Details
ServiceImageRoleInternal PortVolume Mount
commentopluspluscaroga/commentoplusplus:v1.8.7Commenting Engine & Admin Web UI8080None
postgresghcr.io/railwayapp-templates/postgres-ssl:latestPostgreSQL Database (SSL enabled)5432/var/lib/postgresql/data

Topology
ServiceRoleVolumePublicNotes
commentoplusplusMain Server & Widget APINoneYes (Port 8080)Connects to postgres using internal URI
postgresRelational Database/var/lib/postgresql/dataTCP Proxy (Port 5432)High availability template (postgres-ha)
Volumes (drives) — what to mount
ServiceMount pathWhat is stored
postgres/var/lib/postgresql/dataRelational database files, comments, user accounts, and domain settings

Warning: Do not remove or detach the /var/lib/postgresql/data volume on the postgres service — deleting this volume will permanently erase all published comments, user accounts, and site registrations during redeployments.


Quick Start
  1. Click the Deploy on Railway button above.
  2. Sign in (or create a free Railway account) and click Deploy.
  3. Wait 1–2 minutes for both the postgres database and commentoplusplus application services to provision.
  4. Open the commentoplusplus service → Settings → Networking and click the generated public domain URL.
  5. Register the initial owner account through the web dashboard. The first account created automatically gains administrative permissions.
  6. Add your website domain in the Commento++ dashboard, copy the HTML embed snippet, and paste it into your site templates.

Configuration
Commento++ Variables (commentoplusplus)
VariableDefault / SourceDescription / Notes
COMMENTO_ORIGINhttps://${{RAILWAY_PUBLIC_DOMAIN}}Public canonical origin URL where Commento++ is hosted
COMMENTO_POSTGRESpostgres://${{postgres.POSTGRES_USER}}:${{postgres.POSTGRES_PASSWORD}}@${{postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{postgres.POSTGRES_DB}}?sslmode=disableConnection string for internal PostgreSQL database
COMMENTO_ENABLE_WILDCARDStrueAllows embedding the comment widget across wildcard domains and subdomains
PORT8080Internal port the HTTP server listens on
Database Variables (postgres)
VariableDefault / SourceDescription / Notes
POSTGRES_DBpostgresName of the default database created on startup
POSTGRES_USERpostgresAdministrative database user
POSTGRES_PASSWORDAuto-generated secret (16 chars)Secure database access password
DATABASE_URLpostgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}Internal private connection URL
DATABASE_PUBLIC_URLConnection string via TCP ProxyExternal connection URL for remote database management
SSL_CERT_DAYS820Certificate validity period for SSL connections
PGDATA/var/lib/postgresql/data/pgdataSubdirectory path for PostgreSQL data files
Custom Domain
  1. Open the commentoplusplus service → Settings → Networking → Custom Domain.
  2. Add your custom domain (e.g. comments.yourdomain.com) and follow Railway’s DNS setup instructions.
  3. Update the COMMENTO_ORIGIN environment variable on the commentoplusplus service to match your new URL (https://comments.yourdomain.com).
  4. Railway provisions TLS automatically.

Updating Commento++
  1. Open the commentoplusplus service → Settings → Source.
  2. Update the image tag (e.g., caroga/commentoplusplus:v1.8.7 to a newer version).
  3. Click Redeploy.

All comments and database records remain safe inside the attached PostgreSQL volume.


Traps

Common pitfalls and failure modes:

  • COMMENTO_ORIGIN Mismatch — Commento++ relies heavily on COMMENTO_ORIGIN for security verification and CORS checks. If you attach a custom domain or change the public domain without updating COMMENTO_ORIGIN, the embedded comment widget will fail to load or throw origin error blocks.
  • Missing PostgreSQL Volume — Removing or detaching the /var/lib/postgresql/data volume on the postgres service 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 uses sslmode=disable because 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

More templates in this category

View Template
Pixelfed
Explore + Share beautiful photos and videos on the Fediverse

Evan Boehs
30
View Template
Hexo
Hexo — fast static blog framework with admin editor and S3 media storage

INAPP
1
View Template
Bluesky PDS (Atproto Spaces Alpha)
"The Atproto Spaces Alpha" version of Bluesky PDS.

mkizka
2