This example shows how to deploy Umami, an open-source, privacy-focused web analytics platform, on Clever Cloud from source using a Node.js runtime and a PostgreSQL add-on.
Umami is a simple, fast, privacy-focused alternative to Google Analytics. It uses:
- Next.js for the web application
- Prisma as the ORM with automatic migrations
- PostgreSQL as the database
- Privacy-focused analytics (no cookies, GDPR compliant)
- Real-time dashboard
- Visitor insights (pages, referrers, browsers, OS, devices, countries)
- Custom events tracking
- Multiple website support
- Lightweight tracking script (~2KB)
- Node.js 18.18+ - JavaScript runtime
- PostgreSQL 12.14+ - Database
- pnpm - Package manager
- A Clever Cloud account
- Clever Tools CLI installed
- Git
You have two options to deploy your application on Clever Cloud: using the Web Console or using the Clever Tools CLI.
If you don't already have an account, go to the Clever Cloud console and follow the registration instructions.
- Log in to the Clever Cloud console
- Click on "Create" and select "An add-on"
- Choose "PostgreSQL"
- Select a plan that fits your needs (Dev plan works for testing)
- Name your add-on (e.g.,
umami-db)
- Click on "Create" and select "An application"
- Select "Create from a GitHub repository" and use
https://github.com/umami-software/umami.git- Alternatively, fork the repository first, then select your fork
- Choose "Node.js" as the runtime environment
- Configure your application settings (name, region, instance size)
- Link the PostgreSQL add-on created in the previous step
In your application's dashboard, go to "Environment variables" and set:
DATABASE_URL=$POSTGRESQL_ADDON_URI
APP_SECRET=<a-random-secret-string>
PORT=8080
NODE_ENV=production
CC_NODE_DEV_DEPENDENCIES=install
CC_POST_BUILD_HOOK=pnpm build
Note:
$POSTGRESQL_ADDON_URIis automatically set when you link the PostgreSQL add-on. You can reference it directly.
In your application's dashboard, go to "Scalability" and set the build instance size to M (Next.js builds need more memory).
Deploy the application from the console or using Git:
# Add Clever Cloud as a remote repository
git remote add clever git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/app_<your-app-id>.git
# Push your code to deploy
git push clever masterInstall the Clever Tools CLI following the official documentation:
# Using npm
npm install -g clever-tools
# Or using Homebrew (macOS)
brew install clever-toolsclever logingit clone https://github.com/umami-software/umami.git .# Create a Node.js application
clever create --type node umami
# Create a PostgreSQL add-on and link it
clever addon create postgresql-addon umami-db --link umami
# Set required environment variables
clever env set DATABASE_URL "\$POSTGRESQL_ADDON_URI"
clever env set APP_SECRET $(openssl rand -hex 32)
clever env set PORT 8080
clever env set NODE_ENV "production"
clever env set CC_NODE_DEV_DEPENDENCIES "install"
clever env set CC_POST_BUILD_HOOK "pnpm build"
# Use a M instance for building (Next.js build needs more memory)
clever scale --build-flavor Mclever deployOnce deployed, access your Umami instance:
clever openLog in with the default credentials:
- Username:
admin - Password:
umami
Important: Change the default password immediately after your first login.
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL |
Yes | - | PostgreSQL connection string |
APP_SECRET |
Yes | - | Unique random string for the installation |
PORT |
Yes | 3000 |
Server port (must be 8080 on Clever Cloud) |
DISABLE_LOGIN |
No | 0 |
Disable the login page |
DISABLE_TELEMETRY |
No | 0 |
Opt out of Umami telemetry |
PRIVATE_MODE |
No | 0 |
Disable all external network calls |
CLIENT_IP_HEADER |
No | - | HTTP header for real client IP (e.g. X-Forwarded-For) |
TRACKER_SCRIPT_NAME |
No | script.js |
Custom name for the tracking script |
COLLECT_API_ENDPOINT |
No | /api/send |
Custom collection endpoint |
BASE_PATH |
No | / |
Subdirectory path (build-time only) |
For the full list, see the Umami environment variables documentation.
Once deployed, you can monitor your application through:
- Web Console: The Clever Cloud console provides logs, metrics, and other tools to help you manage your application.
- CLI: Use
clever logsto view application logs andclever statusto check the status of your application.