Running on Railway

Railway is attempting to build software development infrastructure for humans. It's founded with the core ideology that building software should be "Take what you need, leave what you don't" and that the current iteration of tools for software development is far too complicated for current generations of developers, let alone the ones that come next. As a result, Railway handles your builds, deployments, scaling, and management of infrastructure; from development to production!

Railway provides a free hosting services which allows you to deploy Umami and set up a PostgreSQL database so you can have your self-hosted version at the click of a button.

Setup Website and Database

Railway Button (Recommended)

Deploy on Railway

Click the button above to deploy your self-hosted version of the Umami website along with an automagically provisioned PostgreSQL database.

You should now be able to visit your Umami dashboard and set up sites that you want to track analytics for.

You can find the URL in your project dashboard which you can visit by running railway open.

Running on Railway from a forked repository

The previously described method is the quickest and easiest way to get Umami up and running on Railway. However, this creates a new repository with a single commit under your GitHub account. You may want to use a forked repository instead to be able to conveniently receive updates from (or contribute pull requests to) the Umami source repository via GitHub.

Set up Railway project

  • Fork the Umami repository.
  • Create an account on Railway connected to GitHub.
  • If you wish, you can give Railway permission only to your Umami fork repository when linking your GitHub account.
  • From the dashboard page click New Project > Deploy from repo.
  • Choose your forked Umami repository and select the master branch.
  • Add a second variable called PORT, set its value to a valid port number (eg: 3000). Click Add.
  • Add a third variable called DATABASE_TYPE, set its value to postgres. Click Add.
  • Add a fourth variable called HOSTNAME, set its value to 0.0.0.0. Click Add.
  • Click Deploy.

This initial deploy will fail until you follow the rest of these steps.

Database and Deploy

  • Close the settings sidebar and click New, click Database and select Add PostgreSQL.
  • On the dashboard, select your Umami service, go to the Variables tab and click New Variable.
  • Click Add Reference and select the DATABASE_URL variable from your Postgres database. Click Add.

Adding the database should trigger a re-deploy, and clicking the app link should get you to the login page of your Umami instance.

Troubleshooting

If Railway states Your project has no deploys within your dashboard.

  1. Select Set up your project locally in the bottom left hand corner.

  2. Within the umami root directory follow the instructions within the pop up.

  • Login to your Railway account with railway login
  • Link your project with railway link
  • Open your project dashboard with railway open
  • Upload and deploy your project with railway up
  1. Follow the Getting started guide starting from the Login step and be sure to change the default password.

Notes