Deploy Cusdis on Railway

Aug 6, 2021

In this post, we go over the process of deploying a Cusdis (a privacy-first, open-source comment system) instance connected to a PostgreSQL database on Railway!

Cusdis is a privacy-first, open-source, and lightweight (~5kb gzipped) comment system. You can think of it as a self-hosted alternative to Disqus that does not track you or your users. It also comes with a dashboard for moderating comments, email notifications, and webhook support for staying up-to-date with new comments on your blog or website.

At Railway, we provide a free one-click deploy for Cusdis using a PostgreSQL database which we automagically provision for you.

Deploying on Railway

To deploy your Cusdis instance on Railway, simply click this button (source code), enter the prompted environment variables and hit deploy. The required PostgreSQL database will be automagically provisioned and the required database migrations will be run for you.

The required environment variables are:

  • USERNAME: The username you'd like to use to log in to the Cusdis dashboard.
  • PASSWORD: The password you'd like to use to log in to the Cusdis dashboard.
  • NEXTAUTH_URL: This is used for redirections on authentication. You will have to change this once you first deploy your application.
  • PORT: This value is already set for you to 3000. Do not change this as 3000 is the default port for Cusdis.
  • JWT_SECRET: To sign JWTs.
Pro-tip: You can hit CMD+K on the dashboard and use our secret generator.

Updating the URL

When you use the Railway button to deploy your self-hosted Cusdis instance, you don't receive a deployment URL until the deployment is complete. So, after you've deployed for the first time, you'd have to update the NEXTAUTH_URL environment variable to your deployment domain (or a custom domain if you set one).

Once you update the variable, a re-deployment should be automatically triggered for you and you should be able to use your Cusdis instance!

Cusdis dashboard
Cusdis dashboard

Once your Cusdis instance is live, you can create projects for your websites and add commenting functionality to them!


And with that, you should have all the information you need to deploy your own Cusdis instance on Railway! You should be able to create new projects and add the comments widget to your websites.

If you have any suggestions for more open-source self-hosted solutions you'd like to see guides for, let us know on Discord. Or even better, submit a pull request to our starters repository on Github!