private.key: no such file or directory #423

Closed
opened 2025-12-29 01:28:45 +01:00 by adam · 1 comment
Owner

Originally created by @hhharsha36 on GitHub (Jan 30, 2023).

Bug description

Which I start the headscale docker container, I am getting the below error in the container logs

2023-01-30T17:12:26Z INF No private key file at path, creating... path=/root/docker/config/headscale/private.key
2023-01-30T17:12:26Z FTL go/src/headscale/cmd/headscale/cli/server.go:21 > Error initializing error="failed to read or create private key: failed to save private key to disk: open /root/docker/config/headscale/private.key: no such file or directory"

To Reproduce

Run the below docker command:

sudo docker run \
  --name headscale \
  --detach \
  --volume $(pwd)/config:/etc/headscale/ \
  --publish 0.0.0.0:8080:8080 \
  --publish 0.0.0.0:9090:9090 \
  --network="web" \
  headscale/headscale:0.18.0 \
  headscale serve

The no such file or directory error is obtained on the container log after the command execution

Context info

  • Version of headscale used: Both 0.18.0 and 0.19.0
  • OS Ubuntu 22.04

P.S., I am a noob, I apologies for any mistake on my end. But I have Traefik, Portainer and Python-Flask container running on the same machine without any issues which I deployed using similar command.

Originally created by @hhharsha36 on GitHub (Jan 30, 2023). **Bug description** Which I start the headscale docker container, I am getting the below error in the container logs ``` 2023-01-30T17:12:26Z INF No private key file at path, creating... path=/root/docker/config/headscale/private.key 2023-01-30T17:12:26Z FTL go/src/headscale/cmd/headscale/cli/server.go:21 > Error initializing error="failed to read or create private key: failed to save private key to disk: open /root/docker/config/headscale/private.key: no such file or directory" ``` **To Reproduce** Run the below docker command: ``` sudo docker run \ --name headscale \ --detach \ --volume $(pwd)/config:/etc/headscale/ \ --publish 0.0.0.0:8080:8080 \ --publish 0.0.0.0:9090:9090 \ --network="web" \ headscale/headscale:0.18.0 \ headscale serve ``` The `no such file or directory` error is obtained on the container log after the command execution **Context info** - Version of headscale used: Both 0.18.0 and 0.19.0 - OS Ubuntu 22.04 P.S., I am a noob, I apologies for any mistake on my end. But I have Traefik, Portainer and Python-Flask container running on the same machine without any issues which I deployed using similar command.
adam added the bug label 2025-12-29 01:28:45 +01:00
adam closed this issue 2025-12-29 01:28:45 +01:00
Author
Owner

@hhharsha36 commented on GitHub (Jan 31, 2023):

my apologies I was inside the /config/ directory which I executed the docker command.

@hhharsha36 commented on GitHub (Jan 31, 2023): my apologies I was inside the `/config/` directory which I executed the docker command.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#423