Deploying Umami from Umami's postgres container

For anyone wishing to deploy Umami on Fly now, here’s a simple method using Umami’s pre-built container for postgres instead of pulling the source and modifying the Dockerfile.

(Previously, I was using info from this thread to pull Umami source, update its Dockerfile, and deploy, but for reasons I wasn’t able to determine, this stopped working with Umami version 2.6.)

Steps

  1. In a new directory for your app, create fly.toml:
kill_signal = "SIGINT"
kill_timeout = "5s"

[experimental]
auto_rollback = true

[build]
image = "ghcr.io/umami-software/umami:postgresql-latest"

[[services]]
protocol = "tcp"
internal_port = 3000
processes = ["app"]

[[services.ports]]
port = 80
handlers = ["http"]
force_https = true

[[services.ports]]
port = 443
handlers = ["tls", "http"]

[services.concurrency]
type = "connections"
hard_limit = 25
soft_limit = 20

[[services.tcp_checks]]
interval = "15s"
timeout = "2s"
grace_period = "1s"
  1. fly launch and choose to create an app with the found fly.toml configuration.
  2. Go through the launch steps, and choose y on the step to create a connected Postgres app.
  3. Choose not to deploy the app yet.
  4. fly secrets set HASH_SALT="<any-string-minus-angle-brackets>", using whatever string you want to salt the hash.
  5. fly deploy There will be errors, but let the deployment complete.
  6. fly scale memory 512 (or higher, if needed. Umami seems to fail with less than 512 MB RAM)
  7. fly deploy
  8. Following the Umami docs, log in with user: admin and password: umami

And of course, adjust instance locations, number of machines, auto-scaling, custom domains for your Umami app, and any other Fly.io options as per Fly docs

Edits

2023-09-25: removed HOSTNAME = "0.0.0.0" from [env] as it’s no longer necessary with Umami v2.7.0

2 Likes

I can no longer edit the original post, but I hadn’t realized that since Umami version 2, HASH_SALT was replaced with APP_SECRET. So Step 5 should be:

  1. fly secrets set APP_SECRET="<any-string-minus-angle-brackets>", using whatever string you want to salt the hash.