[GH-ISSUE #1366] Docs: self-hosted ntfy serve command line arguments #964

Closed
opened 2026-05-07 00:29:11 +02:00 by BreizhHardware · 2 comments

Originally created by @lowjoel on GitHub (Jun 9, 2025).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1366

🐞 Describe the bug

The self-hosted installation docs use command line flags for providing arguments, but the Serve command exits with status code 1 when any arguments are specified

💻 Components impacted

server

💡 Screenshots and/or logs

no arguments expected, see 'ntfy serve --help' for help

🔮 Additional context

In the installation docs I wrongly spotted the Docker command line arguments (not seeing the Kubernetes link) and used the arguments there (for the persistent cache docs).

The serve handler however doesn't seem to like arguments even though the flags have them defined. I think maybe we should not stop flags to be specified on ntfy serve and instead allow them to override (config, env vars, and command line args). I think it's just removing that conditional, but I'm not familiar with the urfave/cli library.

Originally created by @lowjoel on GitHub (Jun 9, 2025). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1366 :lady_beetle: **Describe the bug** <!-- A clear and concise description of the problem. --> The self-hosted installation docs use command line flags for providing arguments, but the Serve command exits with status code 1 when any arguments are specified :computer: **Components impacted** <!-- ntfy server, Android app, iOS app, web app --> server :bulb: **Screenshots and/or logs** <!-- If applicable, add screenshots or share logs help explain your problem. To get logs from the ... - ntfy server: Enable "log-level: trace" in your server.yml file - Android app: Go to "Settings" -> "Record logs", then eventually "Copy/upload logs" - web app: Press "F12" and find the "Console" window --> ```$ kubectl logs -n ntfy ntfy-0 no arguments expected, see 'ntfy serve --help' for help ``` :crystal_ball: **Additional context** <!-- Add any other context about the problem here. --> In the [installation docs](https://docs.ntfy.sh/install/#__tabbed_7_5) I wrongly spotted the Docker command line arguments (not seeing the Kubernetes link) and used the arguments there (for the persistent cache docs). The [serve](https://github.com/binwiederhier/ntfy/blob/main/cmd/serve.go#L128) handler however doesn't seem to like arguments even though the flags have them defined. I think maybe we should not stop flags to be specified on `ntfy serve` and instead allow them to override (config, env vars, and command line args). I think it's just removing that conditional, but I'm not familiar with the urfave/cli library.
BreizhHardware 2026-05-07 00:29:11 +02:00
  • closed this issue
  • added the
    🪲 bug
    label
Author
Owner

@wunter8 commented on GitHub (Jun 9, 2025):

Just a few lines above your link to the serve.go file:

Config options can be overridden using the command line options.

And this shows how you can pass config options to the serve command:

ntfy serve --listen-http :8080 # Starts server with alternate port`

I have run ntfy serve with config arguments like this many times.

What command did you run that failed?

<!-- gh-comment-id:2955827325 --> @wunter8 commented on GitHub (Jun 9, 2025): Just a few lines above your link to the serve.go file: > Config options can be overridden using the command line options. And this shows how you can pass config options to the serve command: > ntfy serve --listen-http :8080 # Starts server with alternate port` I have run `ntfy serve` with config arguments like this many times. What command did you run that failed?
Author
Owner

@lowjoel commented on GitHub (Jun 10, 2025):

D'oh.

          args:
            - "serve"
            - "--cache-file"
            - "/var/cache/ntfy/cache.db"
            - "--attachment-cache-dir"
            - "/var/cache/ntfy/attachments"
            - "--auth-file"
            - "/var/lib/ntfy/user.db"
            -

The blank line at the end was the problem. I actually rewrote all the args to use env vars instead, but I guess this reset my "days since last YAML incident" counter back to 0...

<!-- gh-comment-id:2958163452 --> @lowjoel commented on GitHub (Jun 10, 2025): D'oh. ```yaml args: - "serve" - "--cache-file" - "/var/cache/ntfy/cache.db" - "--attachment-cache-dir" - "/var/cache/ntfy/attachments" - "--auth-file" - "/var/lib/ntfy/user.db" - ``` The blank line at the end was the problem. I actually rewrote all the args to use env vars instead, but I guess this reset my "days since last YAML incident" counter back to 0...
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#964
No description provided.