[GH-ISSUE #800] PWA Docker #566

Closed
opened 2026-05-07 00:25:29 +02:00 by BreizhHardware · 5 comments

Originally created by @mmojadad on GitHub (Jul 1, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/800

Hello
I am usinf ntfy in docker via persistent cache mode.
What will be steps to enable progressive web app (PWA), What exact command i must to use to generate VAPID keys?

Originally created by @mmojadad on GitHub (Jul 1, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/800 Hello I am usinf ntfy in docker via persistent cache mode. What will be steps to enable progressive web app (PWA), What exact command i must to use to generate VAPID keys?
BreizhHardware 2026-05-07 00:25:29 +02:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@nimbleghost commented on GitHub (Jul 1, 2023):

Hi @mmojadad, please follow the instructions here: https://docs.ntfy.sh/config/#web-push

You can generate the keys like this:

docker run --rm -it binwiederhier/ntfy webpush keys

Then copy them to your config file. Don't forget to also add a base-url along with the generate values if you don't have one already.

(That command just runs a new container since the webpush keys command doesn't depend on anything else. You can also run commands against an existing container or definition (e.g. docker compose exec <service name> ntfy webpush keys or docker exec <container> ntfy webpush keys) but I don't know your setup.)

<!-- gh-comment-id:1615772413 --> @nimbleghost commented on GitHub (Jul 1, 2023): Hi @mmojadad, please follow the instructions here: <https://docs.ntfy.sh/config/#web-push> You can generate the keys like this: ```sh docker run --rm -it binwiederhier/ntfy webpush keys ``` Then copy them to your config file. Don't forget to also add a `base-url` along with the generate values if you don't have one already. _(That command just runs a new container since the webpush keys command doesn't depend on anything else. You can also run commands against an existing container or definition (e.g. `docker compose exec <service name> ntfy webpush keys` or `docker exec <container> ntfy webpush keys`) but I don't know your setup.)_
Author
Owner

@nimbleghost commented on GitHub (Jul 1, 2023):

@gedw99 what do you mean :D

Screenshot of docs.ntfy.sh/config/#web-push, highlighting the section with ntfy webpush keys


I think the trouble with config web UIs is that you either make the config part of the database, or need to have a way to restart the server itself to reload the new files + have to make sure configs are writeable etc. I think it's not really worth the effort for minimal gain, especially since people hosting ntfy are running their own servers and shouldn't have trouble figuring out some YAML/commands

<!-- gh-comment-id:1615876644 --> @nimbleghost commented on GitHub (Jul 1, 2023): @gedw99 what do you mean :D ![Screenshot of docs.ntfy.sh/config/#web-push, highlighting the section with `ntfy webpush keys`](https://github.com/binwiederhier/ntfy/assets/132819643/33c06ca0-2442-4df2-aaf1-7945d735a61e) --- I think the trouble with config web UIs is that you either make the config part of the database, or need to have a way to restart the server itself to reload the new files + have to make sure configs are writeable etc. I think it's not really worth the effort for minimal gain, especially since people hosting ntfy are running their own servers and shouldn't have trouble figuring out some YAML/commands
Author
Owner

@mmojadad commented on GitHub (Jul 2, 2023):

@nimbleghost Thank you!
I did it but still PWA not showing, My installation environment is as following:

persistent cache (configured as command line arguments):

docker run
-v /var/cache/ntfy:/var/cache/ntfy
-p 80:80
-it
binwiederhier/ntfy
serve
--cache-file /var/cache/ntfy/cache.db

I am using Portainer and after generate keys i edit and add environment variables followings to the container :

web-push-public-key : ///
web-push-private-key : ///
web-push-file : /var/cache/ntfy/webpush.db
web-push-email-address : myemail@gmail.com
base-url : https://mydomain.com

<!-- gh-comment-id:1616584953 --> @mmojadad commented on GitHub (Jul 2, 2023): @nimbleghost Thank you! I did it but still PWA not showing, My installation environment is as following: -------------------- persistent cache (configured as command line arguments): docker run \ -v /var/cache/ntfy:/var/cache/ntfy \ -p 80:80 \ -it \ binwiederhier/ntfy \ serve \ --cache-file /var/cache/ntfy/cache.db --------------------- I am using Portainer and after generate keys i edit and add environment variables followings to the container : web-push-public-key : /// web-push-private-key : /// web-push-file : /var/cache/ntfy/webpush.db web-push-email-address : myemail@gmail.com base-url : https://mydomain.com
Author
Owner

@nimbleghost commented on GitHub (Jul 2, 2023):

You're probably mixing up the key for the config file and the env vars. If you want to set them up as environment variables you need to use the equivalents1, for example NTFY_WEB_PUSH_PUBLIC_KEY. Look at the list for the rest.

<!-- gh-comment-id:1616586876 --> @nimbleghost commented on GitHub (Jul 2, 2023): You're probably mixing up the key for the config file and the env vars. If you want to set them up as environment variables you need to use the equivalents[^1], for example `NTFY_WEB_PUSH_PUBLIC_KEY`. Look at the list for the rest. [^1]: https://docs.ntfy.sh/config/#config-options
Author
Owner

@mmojadad commented on GitHub (Jul 2, 2023):

@binwiederhier Thank you for corrections, Yes i fixed the keys and now its working fine :)

<!-- gh-comment-id:1616601390 --> @mmojadad commented on GitHub (Jul 2, 2023): @binwiederhier Thank you for corrections, Yes i fixed the keys and now its working fine :)
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#566
No description provided.