Running on Vercel
Vercel is the company behind the framework Next.js which is used by Umami. They also provide a free hosting service which is ideal for Next.js applications.
If you don't already have a database, you can create a Vercel Postgres database integration. You can also follow the Running on DigitalOcean guide or the Running on PlanetScale guide to get a database up and running. You can also check out the Managed databases section under Hosting.
Setup
Automate steps 1-5 using the button above
- Fork the https://github.com/umami-software/umami project to your GitHub account.
- Create an account on Vercel.
- From the dashboard page click Import Project then specify the URL to your fork of the project on GitHub.
- Add the required environment variables
DATABASE_URL
to your Vercel project. These values are defined in the Configure Umami step from Install. You can also create a Vercel Postgres database at this point.
- You should use
POSTGRES_PRISMA_URL
for umami, which is in the form ofpostgres://user:passwd@endpoint-pooler.postgres.vercel-storage.com/verceldb?pgbouncer=true&connect_timeout=10
. - The environment variable used for the database URL can be changed in the
db/postgresql/prisma.schema
file.
- Deploy and visit your application at
<deploy-id>.vercel.app
. - Follow the Getting started guide starting from the Login step and be sure to change the default password.
Proxy Umami Analytics via Vercel
Optionally, you can proxy Umami Analytics to serve Umami Analytics from your main domain. This is also useful for bypassing ad-blocker when using Umami Cloud.
See Vercel's rewrites docs.
In the root of your project, add the vercel.json
file with the following contents:
{
"rewrites": [
{
"source": "/stats/:match*",
"destination": "https://analytics.umami.is/:match*"
}
]
}
The tracking code script tag should use /stats/script.js
as src
value:
<script
async
defer
src="/stats/script.js"
data-website-id="94db1cb1-74f4-4a40-ad6c-962362670409"
></script>