---
title: Deploying Umami web analytics on Scaleway Serverless Containers
description: Discover how to deploy Umami web analytics on Scaleway Serverless Containers.
tags: Umami analytics
hero: assets/scaleway-umami.webp
products:
  - instances
  - containers
  - container-registry
  - postgresql-and-mysql
dates:
  validation: 2025-03-27
  posted: 2021-04-21
  validation_frequency: 12
difficulty: beginner
usecase:
  - application-hosting
ecosystem:
  - third-party
---
import image from './assets/scaleway-umami-namespace-public.webp'
import image2 from './assets/scaleway-serverless-containers-namesp-list.webp'
import image3 from './assets/scaleway-serverless-secrets.webp'
import image4 from './assets/scaleway-container-information.webp'
import image5 from './assets/scaleway-umami-dashboard.webp'
import image6 from './assets/scaleway-serverless-endpoint.webp'
import image7 from './assets/scaleway-serverless-custom-endpoint.webp'

import Requirements from '@macros/iam/requirements.mdx'


Umami is a simple, easy-to-use, self-hosted web analytics solution. It provides an easy-to-use, open-source, and privacy-focused alternative to paid solutions such as Google Analytics. The tool collects only the metrics relevant to you and displays everything on a single page.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- An [SSH key](/organizations-and-projects/how-to/create-ssh-key/)
- A valid [API key](/iam/how-to/create-api-keys/)
- A [Container Registry](/container-registry/quickstart/)
- A [Database for PostgreSQL](/managed-databases-for-postgresql-and-mysql/quickstart/)
- Installed [Docker](/tutorials/install-docker-ubuntu-bionic/) on your local computer

## Preparating the database

1. Create a [database user](/managed-databases-for-postgresql-and-mysql/how-to/manage-users/) and [grant permissions](/managed-databases-for-postgresql-and-mysql/how-to/manage-users/#set-permissions-for-an-existing-user/) to the PostgreSQL database you want to use for Umami.
2. Clone the Umami project locally and enter the project's directory:
    ```
    git clone https://github.com/mikecao/umami.git
    cd umami
    ```
3. Install the required tables from the script shipped with Umami:
    ```md
    psql -h <postgresql-ip>:<port> -U username -d databasename -f sql/schema.postgresql.sql
    ```

## Preparing the Container Registry

1. Sign in to your namespace in your terminal:
    ```
    docker login rg.fr-par.scw.cloud/<umami-namespace> -u nologin -p $SCW_SECRET_TOKEN
    ```

    <Message type="important">
      To run this example, you must first create a secret token from the credentials page, and replace `$SCW_SECRET_TOKEN` with the created token.
    </Message>
2. Download the Umami Docker container on your local machine:
    ```
    docker pull ghcr.io/mikecao/umami:postgresql-latest
    ```
3. Tag the local container:
    ```
    docker tag ghcr.io/mikecao/umami:postgresql-latest rg.fr-par.scw.cloud/<umami-namespace>/umami:postgresql-latest
    ```
4. Push the local container to your Container Registry namespace:
    ```
    docker push rg.fr-par.scw.cloud/<umami-namespace>/umami:postgresql-latest
    ```
5. Click the **Namespace settings** tab in the **Container Registry** section of the Scaleway console and make sure your namespace privacy policy is set to **Public**.
    <Lightbox image={image} alt="" />

## Deploying the Serverless Container

1. Select the namespace you want to use to deploy the application in the **Serverless Containers** section of the Scaleway console. If you do not have a Serverless Containers namespace yet, click **+ Create a namespace** to create a new one.
    <Lightbox image={image2} alt="" />
2. Click **+ Deploy a Container**. The container deployment wizard displays.
3. Choose the namespace you pushed the image to and select the `umami:postgresql-latest` image. Set the value for the port to `3000`.
4. Enter a name for your container. Optionally, you can enter a container description.
5. Select the resources you want to allocate to the container. The resources to allocate depend on the intended load of your application. In this tutorial we use **128 MB - 70 mvCPU**.
6. Configure the minimum and maximum values to autoscale the number of available instances for your container.
7. Set the Secrets. Secrets are an extra-secure type of environment variables that are injected into your container and stored securely:
    <Lightbox image={image3} alt="" />


    Click **+ Add a new secret** to add a secret. Configure the following two secrets:
    * `DATABASE_URL`: The URL of your PostgreSQL database in the format:

       ```md
       postgres://<db-user>:<db-password>@<postgresql-ip>:<port>/<db-name>?sslmode=require
       ```
    * `HASH_SALT`: A random hash. To generate it, run `openssl rand -hex 32` in your terminal and post the output in the form.
8. Verify that the container privacy policy is set to **Public**.
9. Click **Deploy a Container**.

## Accessing the Umami dashboard

1. Click the **Container Settings** tab, to display container information.
2. Copy the URL displayed for **Container Endpoint** and paste it into a web browser. The Umami login screen displays.
    <Lightbox image={image4} alt="" />
3. Log in to the Umami interface using the following credentials:
    * User: `admin`
    * Password: `umami`

    <Lightbox image={image5} alt="" />

    The Umami dashboard displays and you can add websites to monitor. For more information about Umami refer to the [official documentation](https://umami.is/docs/).

## Customizing the endpoint name (optionally)

Your Serverless Functions come with a default endpoint name. You can customize this to a name of your choice using the **Endpoints** feature.

1. Click the **Endpoints** tab. The endpoint information displays.
2. Click **+ Add new Endpoints**. A pop-up displays.
3. Enter the name of your endpoint. You can use any domain or subdomain that you own. Click **Add Endpoint** to validate.
    <Lightbox image={image6} alt="" />

    <Message type="note">
      Make sure you have configured a valid CNAME record for your domain and activated TLS before adding the endpoint.
    </Message>

The new endpoint displays in the list of endpoints. You can now access your application using your custom endpoint name.

<Lightbox image={image7} alt="" />