Failed to set up gRPC socket | permission denied #369

Closed
opened 2025-12-29 01:27:48 +01:00 by adam · 4 comments
Owner

Originally created by @lue30499 on GitHub (Nov 11, 2022).

Bug description

When running the headscale binary under the headscale user I get:

2022-11-11T00:41:49Z FTL ../runner/work/headscale/headscale/cmd/headscale/cli/server.go:26 > Error starting server error="failed to set up gRPC socket: listen unix /var/run/headscale.sock: bind: permission denied"

I am using the default port for gRPC 50443 listening on 0.0.0.0
Its my understanding that creating files in /var/run is for pid 0 processes, so root.
This error doesn't occur when run as root.

How does one run the headscale binary as a non root user?

To Reproduce

Follow the installation setup and systemd instructions

System

  • Version of headscale used: 0.16.4
  • OS: Linux debian
Originally created by @lue30499 on GitHub (Nov 11, 2022). <!-- Headscale is a multinational community across the globe. Our common language is English. Please consider raising the bug report in this language. --> **Bug description** When running the headscale binary under the headscale user I get: ``` 2022-11-11T00:41:49Z FTL ../runner/work/headscale/headscale/cmd/headscale/cli/server.go:26 > Error starting server error="failed to set up gRPC socket: listen unix /var/run/headscale.sock: bind: permission denied" ``` I am using the default port for gRPC 50443 listening on 0.0.0.0 Its my understanding that creating files in /var/run is for pid 0 processes, so root. This error doesn't occur when run as root. How does one run the headscale binary as a non root user? **To Reproduce** Follow the installation setup and systemd instructions **System** - Version of headscale used: 0.16.4 - OS: Linux debian
adam added the bug label 2025-12-29 01:27:48 +01:00
adam closed this issue 2025-12-29 01:27:48 +01:00
Author
Owner

@lue30499 commented on GitHub (Nov 11, 2022):

I didn't read docs properly...

@lue30499 commented on GitHub (Nov 11, 2022): I didn't read docs properly...
Author
Owner

@camaeel commented on GitHub (Nov 23, 2022):

@lue30499 Can you, please, tell me what was the solution here?

@camaeel commented on GitHub (Nov 23, 2022): @lue30499 Can you, please, tell me what was the solution here?
Author
Owner

@lue30499 commented on GitHub (Nov 28, 2022):

@camaeel I didn't follow this part of the docs

Point 2 is what snagged me

@lue30499 commented on GitHub (Nov 28, 2022): @camaeel I didn't follow [this part of the docs](https://github.com/juanfont/headscale/blob/main/docs/running-headscale-linux.md#running-headscale-in-the-background-with-systemd) Point 2 is what snagged me
Author
Owner

@camaeel commented on GitHub (Nov 28, 2022):

Thanx. I solved it in the mean time, and it was the same reason for me.

@camaeel commented on GitHub (Nov 28, 2022): Thanx. I solved it in the mean time, and it was the same reason for me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#369