[GH-ISSUE #4313] [bug]: Error: Error: "DATA_ENCRYPTION_KEY" is not present in .env file #1569

Closed
opened 2026-03-16 20:52:47 +03:00 by kerem · 2 comments
Owner

Originally created by @musuyaba on GitHub (Aug 31, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4313

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Current Behavior

I am trying to set up the Hoppscotch AIO container by following the instructions provided here. After pulling all commits and attempting to run the container, I encounter the following error:

Error: Error: "DATA_ENCRYPTION_KEY" is not present in .env file
Exiting process because Backend Server exited with code 1

Expected Behavior

I expected the Hoppscotch AIO container to start without issues after following the setup instructions, assuming all necessary environment variables and configurations are correctly in place.

Steps to reproduce

Steps to reproduce

  1. Create a Docker network:
docker network create hoppscotch-network
  1. Run the PostgreSQL database container:
docker run -d --name hoppscotch-db --network hoppscotch-network --env-file .env -p 5432:5432 --health-cmd='pg_isready -U $POSTGRES_USER -d $POSTGRES_DB' --health-interval=5s --health-timeout=5s --health-retries=10 -v pgdata:/var/lib/postgresql/data postgres:15
  1. Deploy Prisma migrations using the Hoppscotch backend container:
docker run --rm --name hoppscotch-be --network hoppscotch-network -it --env-file .env --entrypoint sh hoppscotch/hoppscotch-backend -c "pnpx prisma migrate deploy"

Note: In step 3, hoppscotch-backend is used to deploy Prisma migrations as the migrations cannot be deployed using the hoppscotch-app container.

  1. Run the Hoppscotch application container:
docker run --name hoppscotch-app --network hoppscotch-network -p 3000:3000 -p 3100:3100 -p 3170:3170 --env-file .env --restart unless-stopped hoppscotch/hoppscotch

Environment

Production

Version

Self-hosted

Originally created by @musuyaba on GitHub (Aug 31, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4313 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior ## Current Behavior I am trying to set up the Hoppscotch AIO container by following the instructions provided [here](https://docs.hoppscotch.io/documentation/self-host/community-edition/install-and-build). After pulling all commits and attempting to run the container, I encounter the following error: ```bash Error: Error: "DATA_ENCRYPTION_KEY" is not present in .env file Exiting process because Backend Server exited with code 1 ``` ## Expected Behavior I expected the Hoppscotch AIO container to start without issues after following the setup instructions, assuming all necessary environment variables and configurations are correctly in place. ### Steps to reproduce ## Steps to reproduce 1. Create a Docker network: ```bash docker network create hoppscotch-network ``` 2. Run the PostgreSQL database container: ```bash docker run -d --name hoppscotch-db --network hoppscotch-network --env-file .env -p 5432:5432 --health-cmd='pg_isready -U $POSTGRES_USER -d $POSTGRES_DB' --health-interval=5s --health-timeout=5s --health-retries=10 -v pgdata:/var/lib/postgresql/data postgres:15 ``` 3. Deploy Prisma migrations using the Hoppscotch backend container: ```bash docker run --rm --name hoppscotch-be --network hoppscotch-network -it --env-file .env --entrypoint sh hoppscotch/hoppscotch-backend -c "pnpx prisma migrate deploy" ``` >Note: In step 3, hoppscotch-backend is used to deploy Prisma migrations as the migrations cannot be deployed using the hoppscotch-app container. 4. Run the Hoppscotch application container: ```bash docker run --name hoppscotch-app --network hoppscotch-network -p 3000:3000 -p 3100:3100 -p 3170:3170 --env-file .env --restart unless-stopped hoppscotch/hoppscotch ``` ### Environment Production ### Version Self-hosted
kerem 2026-03-16 20:52:47 +03:00
Author
Owner

@liyasthomas commented on GitHub (Aug 31, 2024):

You need to set a value to the environment variable DATA_ENCRYPTION_KEY in the .env file.

This is described in the documentation, in Install and build page under the Configuring the environment section.

DATA_ENCRYPTION_KEY: A 32-character key used for encrypting sensitive data stored in the database.

<!-- gh-comment-id:2322865851 --> @liyasthomas commented on GitHub (Aug 31, 2024): You need to set a value to the environment variable `DATA_ENCRYPTION_KEY` in the `.env` file. This is described in the documentation, in [Install and build](https://docs.hoppscotch.io/documentation/self-host/community-edition/install-and-build) page under the [Configuring the environment](https://docs.hoppscotch.io/documentation/self-host/community-edition/install-and-build#configuring-the-environment) section. > `DATA_ENCRYPTION_KEY`: A 32-character key used for encrypting sensitive data stored in the database.
Author
Owner

@musuyaba commented on GitHub (Sep 1, 2024):

Thank you for your response, it seems that I am still using the old .env file.

<!-- gh-comment-id:2323123946 --> @musuyaba commented on GitHub (Sep 1, 2024): Thank you for your response, it seems that I am still using the old .env file.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1569
No description provided.