After deploying Dify, I was unable to create an administrator account; clicking "create" resulted in an error, whereas it had been working normally before. #20759

Closed
opened 2026-02-21 20:08:50 -05:00 by yindo · 2 comments
Owner

Originally created by @kejilion on GitHub (Dec 2, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.10.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

			mkdir -p  /home/docker/ && cd /home/docker/ && git clone https://github.com/langgenius/dify.git && cd dify/docker && cp .env.example .env
			sed -i "s/^EXPOSE_NGINX_PORT=.*/EXPOSE_NGINX_PORT=${docker_port}/; s/^EXPOSE_NGINX_SSL_PORT=.*/EXPOSE_NGINX_SSL_PORT=8858/" /home/docker/dify/docker/.env

			docker compose up -d

Unable to create administrator account after deployment. It worked fine before, but now it's throwing an error.

Image

✔️ Expected Behavior

You should access the console after creating an administrator account normally.

Actual Behavior

Setup failed: PermissionDenied (persistent) at write => permission denied Context: service: fs path: privkeys/b4fb3346-20f2-4772-86d8-1987d53ca47d/private.pem Source: Permission denied (os error 13)

Originally created by @kejilion on GitHub (Dec 2, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.10.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ``` mkdir -p /home/docker/ && cd /home/docker/ && git clone https://github.com/langgenius/dify.git && cd dify/docker && cp .env.example .env sed -i "s/^EXPOSE_NGINX_PORT=.*/EXPOSE_NGINX_PORT=${docker_port}/; s/^EXPOSE_NGINX_SSL_PORT=.*/EXPOSE_NGINX_SSL_PORT=8858/" /home/docker/dify/docker/.env docker compose up -d ``` Unable to create administrator account after deployment. It worked fine before, but now it's throwing an error. <img width="1920" height="919" alt="Image" src="https://github.com/user-attachments/assets/a130ba50-c312-4829-9f9c-334efd871175" /> ### ✔️ Expected Behavior You should access the console after creating an administrator account normally. ### ❌ Actual Behavior Setup failed: PermissionDenied (persistent) at write => permission denied Context: service: fs path: privkeys/b4fb3346-20f2-4772-86d8-1987d53ca47d/private.pem Source: Permission denied (os error 13)
yindo added the 🐞 bug label 2026-02-21 20:08:50 -05:00
yindo closed this issue 2026-02-21 20:08:51 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 2, 2025):

Hi @kejilion! I'm Dosu and I’m helping the dify team.

This error is caused by the Dify API container trying to write a private key file to the privkeys directory inside the mounted storage volume, but the host directory (./volumes/app/storage) isn't writable by the container's user. To fix this, ensure that the storage directory and its subdirectories on your host system have permissions that allow the Docker container (typically running as root) to write files.

You can do this by running:

sudo chown -R 0:0 ./volumes/app/storage
sudo chmod -R 755 ./volumes/app/storage

Then restart your containers:

docker compose down
docker compose up -d

After adjusting the permissions, try creating the administrator account again. If you still see errors, check the container logs for more details.

For more on how Dify handles key generation and storage, see the relevant code for key generation and file writing and Docker volume mounts.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 2, 2025): <!-- Greeting --> Hi @kejilion! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This error is caused by the Dify API container trying to write a private key file to the `privkeys` directory inside the mounted storage volume, but the host directory (`./volumes/app/storage`) isn't writable by the container's user. To fix this, ensure that the storage directory and its subdirectories on your host system have permissions that allow the Docker container (typically running as root) to write files. You can do this by running: ```bash sudo chown -R 0:0 ./volumes/app/storage sudo chmod -R 755 ./volumes/app/storage ``` Then restart your containers: ```bash docker compose down docker compose up -d ``` After adjusting the permissions, try creating the administrator account again. If you still see errors, check the container logs for more details. For more on how Dify handles key generation and storage, see the relevant code for [key generation and file writing](https://github.com/langgenius/dify/blob/9b9588f20df3c4c0f650324c8c9a6f041233b4bb/api/libs/rsa.py#L13-L24) and [Docker volume mounts](https://github.com/langgenius/dify/blob/9b9588f20df3c4c0f650324c8c9a6f041233b4bb/docker/docker-compose.yaml#L639-L711). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/ec1eb58a-8765-4b38-8d6c-9e6dcb008d59?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/ec1eb58a-8765-4b38-8d6c-9e6dcb008d59?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/ec1eb58a-8765-4b38-8d6c-9e6dcb008d59?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/ec1eb58a-8765-4b38-8d6c-9e6dcb008d59?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ec1eb58a-8765-4b38-8d6c-9e6dcb008d59?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/ec1eb58a-8765-4b38-8d6c-9e6dcb008d59?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ec1eb58a-8765-4b38-8d6c-9e6dcb008d59?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20error%20is%20caused%20by%20the%20Dify%20API%20container%20trying%20to%20write%20a%20private%20key%20file%20to%20the%20%60privkeys%60%20directory%20inside%20the%20mounted%20storage%20volume%2C%20but%20the%20host%20directory%20%28%60./volumes/app/storage%60%29%20isn%27t%20writable%20by%20the%20container%27s%20user.%20To%20fix%20this%2C%20ensure%20that%20the%20storage%20directory%20and%20its%20subdirectories%20on%20your%20host%20system%20have%20permissions%20that%20allow%20the%20Docker%20container%20%28typically%20running%20as%20root%29%20to%20write%20files.%0A%0AYou%20can%20do%20this%20by%20running%3A%0A%0A%60%60%60bash%0Asudo%20chown%20-R%200%3A0%20./volumes/app/storage%0Asudo%20chmod%20-R%20755%20./volumes/app/storage%0A%60%60%60%0A%0AThen%20restart%20your%20containers%3A%0A%0A%60%60%60bash%0Adocker%20compose%20down%0Adocker%20compose%20up%20-d%0A%60%60%60%0A%0AAfter%20adjusting%20the%20permissions%2C%20try%20creating%20the%20administrator%20account%20again.%20If%20you%20still%20see%20errors%2C%20check%20the%20container%20logs%20for%20more%20details.%0A%0AFor%20more%20on%20how%20Dify%20handles%20key%20generation%20and%20storage%2C%20see%20the%20relevant%20code%20for%20%5Bkey%20generation%20and%20file%20writing%5D%28https%3A//github.com/langgenius/dify/blob/9b9588f20df3c4c0f650324c8c9a6f041233b4bb/api/libs/rsa.py%23L13-L24%29%20and%20%5BDocker%20volume%20mounts%5D%28https%3A//github.com/langgenius/dify/blob/9b9588f20df3c4c0f650324c8c9a6f041233b4bb/docker/docker-compose.yaml%23L639-L711%29.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/29055)
Author
Owner

@crazywoola commented on GitHub (Dec 2, 2025):

Please read the release log first.

@crazywoola commented on GitHub (Dec 2, 2025): Please read the release log first.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20759