[GH-ISSUE #1232] can't run the docker after setup Access control #868

Closed
opened 2026-05-07 00:28:19 +02:00 by BreizhHardware · 5 comments

Originally created by @katfionn on GitHub (Dec 8, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1232

🐞 Describe the bug

After i set env for my container as it said: https://ntfy.sh/docs/config/#access-control, i can't run the ntfy container any more. here's how i set the container's env

TZ=Asia/Shanghai
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
NTFY_KEY_FILE=/etc/ntfy/privkey.key
NTFY_CERT_FILE=/etc/ntfy/fullchain.pem
NTFY_LISTEN_HTTPS=:443
NTFY_AUTH_FILE=/var/lib/ntfy/user.db
NTFY_AUTH_DEFAULT_ACCESS=read-write

but the .dbfile has not created automatically as we expected.
Any help or instructions will be helpful!

💻 Components impacted

self hosting, installed from 1panel's APP store

💡 Screenshots and/or logs

🔮 Additional context

Originally created by @katfionn on GitHub (Dec 8, 2024). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1232 :lady_beetle: **Describe the bug** <!-- A clear and concise description of the problem. --> After i set env for my container as it said: https://ntfy.sh/docs/config/#access-control, i can't run the ntfy container any more. here's how i set the container's env ``` TZ=Asia/Shanghai PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin NTFY_KEY_FILE=/etc/ntfy/privkey.key NTFY_CERT_FILE=/etc/ntfy/fullchain.pem NTFY_LISTEN_HTTPS=:443 NTFY_AUTH_FILE=/var/lib/ntfy/user.db NTFY_AUTH_DEFAULT_ACCESS=read-write ``` but the `.db`file has not `created automatically` as we expected. Any help or instructions will be helpful! :computer: **Components impacted** <!-- ntfy server, Android app, iOS app, web app --> self hosting, installed from 1panel's APP store :bulb: **Screenshots and/or logs** <!-- 2024/12/09 01:26:32 FATAL unable to open database file: no such file or directory (exit_code=1) unable to open database file: no such file or directory --> :crystal_ball: **Additional context** <!-- Add any other context about the problem here. -->
BreizhHardware 2026-05-07 00:28:19 +02:00
  • closed this issue
  • added the
    🪲 bug
    label
Author
Owner

@wunter8 commented on GitHub (Dec 8, 2024):

I'm guessing you didn't mount a volume, so /var/lib/ntfy doesn't exist in the container.

See the example docker compose files here: https://docs.ntfy.sh/config/#__tabbed_2_1

<!-- gh-comment-id:2526280868 --> @wunter8 commented on GitHub (Dec 8, 2024): I'm guessing you didn't mount a volume, so /var/lib/ntfy doesn't exist in the container. See the example docker compose files here: https://docs.ntfy.sh/config/#__tabbed_2_1
Author
Owner

@katfionn commented on GitHub (Dec 8, 2024):

See the example docker compose files here:

you're right, let me try to reinstall the container, thanks a lot

<!-- gh-comment-id:2526469679 --> @katfionn commented on GitHub (Dec 8, 2024): > See the example docker compose files here: you're right, let me try to reinstall the container, thanks a lot
Author
Owner

@katfionn commented on GitHub (Dec 9, 2024):

It was so helpful. I make it worked eventually, thanks again.

<!-- gh-comment-id:2526707953 --> @katfionn commented on GitHub (Dec 9, 2024): It was so helpful. I make it worked eventually, thanks again.
Author
Owner

@katfionn commented on GitHub (Dec 9, 2024):

If you're using 1panel to install the ntfy and you wnat to use ACL function, here's how i make it work, hope it can hope anyone is rookie as me. But if you have better idea, please let me know.

first step : install the app

Install the ntfy app from the app store
image

image

next : delete the container

App store should build a container automatically, delete it now
image

then : build a container from official doc's yaml config

  1. Open this link : https://docs.ntfy.sh/config/#__tabbed_2_1, and copy the config
    image
  2. Creat a new floder, i named it ntfy-official
  3. Cd ntfy-official and creat new file named docker-compose.yaml, and edit the file and pause the config, save the file
    image
  4. Go to command line window
    image
  5. Input this: docker-compose up -d and press Enter on your keyboard

after that : copy /var/lib/ntfy files to local path

  1. Cd to the 1Panel app's data path
    image
  2. Make dir : /lib/ntfy
    image
  3. Go to command line window
  4. Run command docker ps
  5. Copy the official container's name
    image
  6. For my situation, i should run this command: cp ntfy-official-ntfy-1:/var/lib/ntfy /home/onepanel/1panel/apps/ntfy/ntfy/data/lib/ntfy

fianl step : edit APP's yml file and rebuild the APP's container

  1. Cd to the 1Panel app's data path
    image
  2. Edit docker-compose.yml file
    image
  3. Go to command line window
    image
  4. Input this: docker-compose up -d and press Enter on your keyboard

如果你也使用1panel面板里的应用商店来安装ntfy,并且你需要用到ACL功能,这是我的经验分享,希望对同是菜鸟的你有帮助。如果你有更好的办法,麻烦也让我学习学习

首先,安装1panel里的APP

image

image

然后,删掉容器

应用商店的应用装好后会默认创建一个容器,删掉它
image

接着,用官方的配置创建一个容器

  1. 访问这个链接 : https://docs.ntfy.sh/config/#__tabbed_2_1, and copy the config
    image
  2. 在任意位置新建文件夹, 我这里是叫 ntfy-official
  3. 进去这个文件夹 ntfy-official ,然后新建一个文件名为 docker-compose.yaml, 然后编辑这个文件,把官方文档里的粘贴进去,然后保存
    image
  4. 进去命令行
    image
  5. 输入这个docker-compose up -d 然后回车

然后,把官方的容器里对应的、缺少的文件拷出来

  1. 进到1panel应用的根目录
    image
  2. 创建这目录 : /lib/ntfy
    image
  3. 进去命令行
  4. 运行这个命令: docker ps
  5. 复制用官方配置跑起来的容器名字
    image
  6. 接着要把文件复制出来,对于我的情况是这样: cp ntfy-official-ntfy-1:/var/lib/ntfy /home/onepanel/1panel/apps/ntfy/ntfy/data/lib/ntfy

最后,编辑1panel的APP yml配置,然后重建容器

  1. 进到1panel应用的根目录
    image
  2. 编辑 docker-compose.yml 文件
    image
  3. 进去命令行
    image
  4. 输入: docker-compose up -d 然后回车
<!-- gh-comment-id:2526979438 --> @katfionn commented on GitHub (Dec 9, 2024): If you're using 1panel to install the ntfy and you wnat to use ACL function, here's how i make it work, hope it can hope anyone is rookie as me. But if you have better idea, please let me know. ## first step : install the app Install the ntfy app from the app store ![image](https://github.com/user-attachments/assets/a31248bd-c690-467d-867d-9111f11a4043) ![image](https://github.com/user-attachments/assets/1ba87635-c63e-4b6a-8090-4b0f1ae3545f) ## next : delete the container App store should build a container automatically, delete it now ![image](https://github.com/user-attachments/assets/b07d26ab-7600-4087-98d5-9819f707573b) ## then : build a container from official doc's yaml config 1. Open this link : https://docs.ntfy.sh/config/#__tabbed_2_1, and copy the config ![image](https://github.com/user-attachments/assets/39557fdd-bdda-41ba-ade1-6a4bee5685a2) 2. Creat a new floder, i named it `ntfy-official` 3. Cd `ntfy-official` and creat new file named `docker-compose.yaml`, and edit the file and pause the config, save the file ![image](https://github.com/user-attachments/assets/6db6a7d9-76f8-43b1-9370-e561db2a70ff) 4. Go to command line window ![image](https://github.com/user-attachments/assets/4ac7cda0-6b80-4bc3-9d12-c9fc64c7b333) 5. Input this: `docker-compose up -d` and press `Enter` on your keyboard ## after that : copy `/var/lib/ntfy` files to local path 1. Cd to the 1Panel app's data path ![image](https://github.com/user-attachments/assets/4257d9dd-5291-403c-8ede-8078e4cae28d) 2. Make dir : /lib/ntfy ![image](https://github.com/user-attachments/assets/77289dc8-e06a-4880-8155-fd7f47b86e41) 3. Go to command line window 4. Run command `docker ps` 5. Copy the official container's name ![image](https://github.com/user-attachments/assets/1c6099c4-c20a-4396-a7e6-e20e8557aa22) 6. For my situation, i should run this command: `cp ntfy-official-ntfy-1:/var/lib/ntfy /home/onepanel/1panel/apps/ntfy/ntfy/data/lib/ntfy` ## fianl step : edit APP's yml file and rebuild the APP's container 1. Cd to the 1Panel app's data path ![image](https://github.com/user-attachments/assets/4257d9dd-5291-403c-8ede-8078e4cae28d) 2. Edit `docker-compose.yml` file ![image](https://github.com/user-attachments/assets/d15199f2-bbf7-4c79-83e7-5bf3485dbd50) 3. Go to command line window ![image](https://github.com/user-attachments/assets/36b300eb-640a-415c-a306-a12b75794793) 4. Input this: `docker-compose up -d` and press `Enter` on your keyboard --- 如果你也使用1panel面板里的应用商店来安装ntfy,并且你需要用到ACL功能,这是我的经验分享,希望对同是菜鸟的你有帮助。如果你有更好的办法,麻烦也让我学习学习 ## 首先,安装1panel里的APP ![image](https://github.com/user-attachments/assets/a31248bd-c690-467d-867d-9111f11a4043) ![image](https://github.com/user-attachments/assets/1ba87635-c63e-4b6a-8090-4b0f1ae3545f) ## 然后,删掉容器 应用商店的应用装好后会默认创建一个容器,删掉它 ![image](https://github.com/user-attachments/assets/b07d26ab-7600-4087-98d5-9819f707573b) ## 接着,用官方的配置创建一个容器 1. 访问这个链接 : https://docs.ntfy.sh/config/#__tabbed_2_1, and copy the config ![image](https://github.com/user-attachments/assets/39557fdd-bdda-41ba-ade1-6a4bee5685a2) 2. 在任意位置新建文件夹, 我这里是叫 `ntfy-official` 3. 进去这个文件夹 `ntfy-official` ,然后新建一个文件名为 `docker-compose.yaml`, 然后编辑这个文件,把官方文档里的粘贴进去,然后保存 ![image](https://github.com/user-attachments/assets/6db6a7d9-76f8-43b1-9370-e561db2a70ff) 4. 进去命令行 ![image](https://github.com/user-attachments/assets/4ac7cda0-6b80-4bc3-9d12-c9fc64c7b333) 5. 输入这个`docker-compose up -d` 然后回车 ## 然后,把官方的容器里对应的、缺少的文件拷出来 1. 进到1panel应用的根目录 ![image](https://github.com/user-attachments/assets/4257d9dd-5291-403c-8ede-8078e4cae28d) 2. 创建这目录 : /lib/ntfy ![image](https://github.com/user-attachments/assets/77289dc8-e06a-4880-8155-fd7f47b86e41) 3. 进去命令行 4. 运行这个命令: `docker ps` 5. 复制用官方配置跑起来的容器名字 ![image](https://github.com/user-attachments/assets/1c6099c4-c20a-4396-a7e6-e20e8557aa22) 6. 接着要把文件复制出来,对于我的情况是这样: `cp ntfy-official-ntfy-1:/var/lib/ntfy /home/onepanel/1panel/apps/ntfy/ntfy/data/lib/ntfy` ## 最后,编辑1panel的APP yml配置,然后重建容器 1. 进到1panel应用的根目录 ![image](https://github.com/user-attachments/assets/4257d9dd-5291-403c-8ede-8078e4cae28d) 2. 编辑 `docker-compose.yml` 文件 ![image](https://github.com/user-attachments/assets/d15199f2-bbf7-4c79-83e7-5bf3485dbd50) 3. 进去命令行 ![image](https://github.com/user-attachments/assets/36b300eb-640a-415c-a306-a12b75794793) 4. 输入: `docker-compose up -d` 然后回车
Author
Owner

@gongfuture commented on GitHub (Jan 16, 2026):

@katfionn I'm facing the same issue and have been struggling to find a solution. Your response inspired me to look more closely at the differences between the two. The 1panel store version's Docker Compose has an additional permission restriction: user: ${PUID}:${PGID}. In the .env file, PGID=1000 PUID=1000, which restricts ntfy to a regular user. However, the default mounted path in 1panel is /opt/1panel/apps/ which has root permissions, so it cannot create a database, leading to an error.

@katfionn 遇到一样的问题,苦寻无果。看到你的回答受到了启发,详细看了一下两个之间的区别,1panel商店版本的docker compose多了一个权限限制,user: ${PUID}:${PGID},.env文件内PGID=1000 PUID=1000,限制了ntfy为普通用户。但是1panel默认挂在的/opt/1panel/apps/路径下是root权限,所以不能创建数据库导致报错

This is my personal opinion, and I'm just a beginner user. If you have other perspectives, feel free to point them out

这是我个人的看法,我也只是一个小白用户,有其他看法欢迎指点

<!-- gh-comment-id:3759063918 --> @gongfuture commented on GitHub (Jan 16, 2026): @katfionn I'm facing the same issue and have been struggling to find a solution. Your response inspired me to look more closely at the differences between the two. The 1panel store version's Docker Compose has an additional permission restriction: `user: ${PUID}:${PGID}`. In the .env file, `PGID=1000 PUID=1000`, which restricts ntfy to a regular user. However, the default mounted path in 1panel is `/opt/1panel/apps/` which has `root` permissions, so it cannot create a database, leading to an error. @katfionn 遇到一样的问题,苦寻无果。看到你的回答受到了启发,详细看了一下两个之间的区别,1panel商店版本的docker compose多了一个权限限制,`user: ${PUID}:${PGID}`,.env文件内`PGID=1000 PUID=1000`,限制了ntfy为普通用户。但是1panel默认挂在的`/opt/1panel/apps/`路径下是`root`权限,所以不能创建数据库导致报错 This is my personal opinion, and I'm just a beginner user. If you have other perspectives, feel free to point them out 这是我个人的看法,我也只是一个小白用户,有其他看法欢迎指点
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/ntfy#868
No description provided.