> ## Documentation Index
> Fetch the complete documentation index at: https://getlago.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration to v1.58.0

Dear Lago Community, 👋

Lago v1.58.0 changes the Docker Compose files of the self-hosted install. **They have no default value for the secrets any more.** Installations with the Helm chart or the all-in-one image (`getlago/lago`) are not affected.

# What are the changes?

The backend services need four secrets:

* `SECRET_KEY_BASE`
* `LAGO_ENCRYPTION_PRIMARY_KEY`
* `LAGO_ENCRYPTION_DETERMINISTIC_KEY`
* `LAGO_ENCRYPTION_KEY_DERIVATION_SALT`

Before v1.58.0, the Docker Compose files used public placeholder values when a secret was not set. From v1.58.0, every `docker compose` command (also `down`, `ps` and `logs`) stops with an error until the four secrets are set:

```
error while interpolating services.api.environment.SECRET_KEY_BASE: required variable SECRET_KEY_BASE is missing a value: SECRET_KEY_BASE is required, see https://github.com/getlago/lago/blob/main/deploy/README.md#secrets
```

The install commands in the [Docker guide](https://getlago.com/docs/guide/lago-self-hosted/docker.md#run-the-app-with-advanced-docker-commands) and `deploy.sh` now generate each secret once and keep it in `.env`.

# Why are we doing this?

The placeholder values are public. An install that ran with them signed its sessions and encrypted its credentials with values that anyone can read.

# What should self-hosted users do?

> [!NOTE]
>
> Cloud users do not need to follow these instructions.

> [!WARNING]
>
> If you're using a version below `v1.57.0`, please first follow the migration steps for [v1.57.0](https://getlago.com/docs/guide/migration/migration-to-v1.57.0.md).
> Only after completing those should you proceed to v1.58.0.

If your `.env` already sets the four secrets, you have nothing to do.

If your install ran with the old defaults, do these steps before you use the new compose file.

### 1. Replace `SECRET_KEY_BASE`

Anyone can read the old value, so set a new one:

```bash theme={"dark"}
grep -q '^SECRET_KEY_BASE=.' .env || echo "SECRET_KEY_BASE=$(openssl rand -hex 64)" >> .env
```

Users log in again. Customer portal and document links that were already sent stop working. No stored data becomes unreadable.

### 2. Keep the encryption values that your data uses

If you never set them, your install used these exact strings. They are not placeholders: copy them into `.env` as they are.

```bash theme={"dark"}
LAGO_ENCRYPTION_PRIMARY_KEY=your-encryption-primary-key
LAGO_ENCRYPTION_DETERMINISTIC_KEY=your-encryption-deterministic-key
LAGO_ENCRYPTION_KEY_DERIVATION_SALT=your-encryption-derivation-salt
```

> [!WARNING]
>
> Do not generate new encryption keys for an install that has data. New keys make the existing encrypted data (for example integration and payment provider credentials, webhook signing keys) unreadable.
>
> Lago cannot rotate the encryption keys yet: it does not read previous keys, and it has no task to re-encrypt the data. Until it can, the encrypted credentials of such an install stay protected only by these public values.

### 3. Install Lago v1.58.0

Follow the [update process](https://getlago.com/docs/guide/lago-self-hosted/update-instance.md#update-process). Keep a backup of `.env`: you cannot recover encrypted data without it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.