f:: Self-Hosted

Running on Supabase

git clone https://github.com/umami-software/umami.git
cd umami
vim .env
DATABASE_URL=postgres://postgres:[YOUR-PASSWORD]@host:6543/postgres?pgbouncer=true
HASH_SALT=any-random-string
pgsql -h hostname -U postgres -d postgres -f sql/schema.postgresql.sql
Password for user postgres:
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
INSERT 0 1

Running on Railway

Execution Time Limit: Exclusively on the Starter Plan, Railway limits accounts to 500 hours of uptime. Each service counts against this limit. In practice, if a user only has one service running, they expend the hours at a standard rate. (Around 21 days of continuous uptime) If they have two services running, such as a DB and a service, the hours consume twice the rate. (Around ten and a half days of continuous uptime).

Create database tables

  • Once you’ve deployed your project, clone it locally using Git.
  • Use the Railway CLI to link your local setup to your Railway project by running railway link.
brew install railwayapp/railway/railway
{
railway login
railway link
}
  • Use railway run psql -h hostname -U username -d databasename -f sql/schema.postgresql.sql
    • You can view your hostname, username, and databasename using railway variables or from your project dashboard
    • This command installs all the tables with the required scripts and creates a login account with the username admin and password umami
railway variables
# railway run psql -h hostname -U username -d databasename -f sql/schema.postgresql.sql
psql:sql/schema.postgresql.sql:1: NOTICE:  table "event" does not exist, skipping
DROP TABLE
psql:sql/schema.postgresql.sql:2: NOTICE:  table "pageview" does not exist, skipping
DROP TABLE
psql:sql/schema.postgresql.sql:3: NOTICE:  table "session" does not exist, skipping
DROP TABLE
psql:sql/schema.postgresql.sql:4: NOTICE:  table "website" does not exist, skipping
DROP TABLE
psql:sql/schema.postgresql.sql:5: NOTICE:  table "account" does not exist, skipping
DROP TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
INSERT 0 1
 
đźš„ Looks good? Then put it on the train and deploy with `railway up`!
  • 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

Notes

How to Backup and Restore Your Postgres Database

railway variables

Backing Up Your Database

pg_dump

Restoring Your Database Backup

pg_restore

crontab