headscale docker keep restarting #722

Closed
opened 2025-12-29 02:22:50 +01:00 by adam · 11 comments
Owner

Originally created by @Kingwayer on GitHub (Jun 4, 2024).

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

after docker compose up -d, headscale container keep restarting, please referring to
https://github.com/juanfont/headscale/issues/1775

Expected Behavior

keep working after container created.

Steps To Reproduce

nano docker-compose.yml and in put below then docker compose up -d

version: '3.5'
services:
  headscale:
    image: headscale/headscale:0.22.3
    container_name: headscale
    volumes:
      - /var/run/headscale
    ports:
        - 8181:8181
        - 9090:9090
    command: headscale serve
    restart: unless-stopped
  headscale-ui:
    image: ghcr.io/gurucomputing/headscale-ui:latest
    restart: unless-stopped
    container_name: headscale-ui
    ports:
        - 3838:80

Environment

- OS: debian12
- Headscale version:0.22.3
- Tailscale version:

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Anything else?

No response

Edit: Add code block

Originally created by @Kingwayer on GitHub (Jun 4, 2024). ### Is this a support request? - [X] This is not a support request ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Behavior after docker compose up -d, headscale container keep restarting, please referring to https://github.com/juanfont/headscale/issues/1775 ### Expected Behavior keep working after container created. ### Steps To Reproduce nano docker-compose.yml and in put below then docker compose up -d ``` version: '3.5' services: headscale: image: headscale/headscale:0.22.3 container_name: headscale volumes: - /var/run/headscale ports: - 8181:8181 - 9090:9090 command: headscale serve restart: unless-stopped headscale-ui: image: ghcr.io/gurucomputing/headscale-ui:latest restart: unless-stopped container_name: headscale-ui ports: - 3838:80 ``` ### Environment ```markdown - OS: debian12 - Headscale version:0.22.3 - Tailscale version: ``` ### Runtime environment - [ ] Headscale is behind a (reverse) proxy - [X] Headscale runs in a container ### Anything else? _No response_ Edit: Add code block
adam added the question label 2025-12-29 02:22:50 +01:00
adam closed this issue 2025-12-29 02:22:50 +01:00
Author
Owner

@ohdearaugustin commented on GitHub (Jun 4, 2024):

There is currently no docker container with the latest tag.

Use specific version like headscale/headscale: 0.22.3 with a command headscale serve or a unstable alpha version
with headscale/headscale:0.23.0-alpha12 and a command serve.

@ohdearaugustin commented on GitHub (Jun 4, 2024): There is currently no docker container with the latest tag. Use specific version like `headscale/headscale: 0.22.3` with a command `headscale serve` or a unstable alpha version with `headscale/headscale:0.23.0-alpha12` and a command `serve`.
Author
Owner

@Kingwayer commented on GitHub (Jun 4, 2024):

There is currently no docker container with the latest tag.

Use specific version like headscale/headscale: 0.22.3 with a command headscale serve or a unstable alpha version with headscale/headscale:0.23.0-alpha12 and a command serve.

Actually just did all your mentioned difference version combination, all is the same, can you do a test to verify?

@Kingwayer commented on GitHub (Jun 4, 2024): > There is currently no docker container with the latest tag. > > Use specific version like `headscale/headscale: 0.22.3` with a command `headscale serve` or a unstable alpha version with `headscale/headscale:0.23.0-alpha12` and a command `serve`. Actually just did all your mentioned difference version combination, all is the same, can you do a test to verify?
Author
Owner

@ohdearaugustin commented on GitHub (Jun 5, 2024):

For 0.22.3 just follow the docs

@ohdearaugustin commented on GitHub (Jun 5, 2024): For 0.22.3 just follow the [docs](https://headscale.net/running-headscale-container/#configure-and-run-headscale)
Author
Owner

@Kingwayer commented on GitHub (Jun 5, 2024):

For 0.22.3 just follow the docs

that's the standard installation step I have followed, you didn't answer or give me any hints at all.

@Kingwayer commented on GitHub (Jun 5, 2024): > For 0.22.3 just follow the [docs](https://headscale.net/running-headscale-container/#configure-and-run-headscale) that's the standard installation step I have followed, you didn't answer or give me any hints at all.
Author
Owner

@Kingwayer commented on GitHub (Jun 5, 2024):

@ohdearaugustin why removed bug label? I think this is a bug and actually after months it's not been fixed yet.

@Kingwayer commented on GitHub (Jun 5, 2024): @ohdearaugustin why removed bug label? I think this is a bug and actually after months it's not been fixed yet.
Author
Owner

@ohdearaugustin commented on GitHub (Jun 5, 2024):

There is no config file what you are using. There are no logs.
And you claim that you followed the standard installation.

In my opinion this is a user error and not a bug in headscale.
It is a misconfiguration and therefore not a bug.
You reedited the docker-compose.

This docker-compose doesn't look like the one in the documentation.
Sorry, but it seems to me that you don't really understand docker.

@ohdearaugustin commented on GitHub (Jun 5, 2024): There is no config file what you are using. There are no logs. And you claim that you followed the standard installation. In my opinion this is a user error and not a bug in headscale. It is a misconfiguration and therefore not a bug. You reedited the docker-compose. This docker-compose doesn't look like the one in the documentation. Sorry, but it seems to me that you don't really understand docker.
Author
Owner

@ohdearaugustin commented on GitHub (Jun 5, 2024):

Add your config file and the log output.

@ohdearaugustin commented on GitHub (Jun 5, 2024): Add your config file and the log output.
Author
Owner

@Kingwayer commented on GitHub (Jun 5, 2024):

docker-compose.yml

version: "3.7"

services:
  headscale:
    image: headscale/headscale:0.22.3
    restart: unless-stopped
    container_name: headscale
    ports:
      - "0.0.0.0:8080:8080"
      - "127.0.0.1:9090:9090"
    volumes:
      # pls change [config_path] to the fullpath of the config folder just created
      - /opt/headscale:/etc/headscale
      - /var/lib/headscale:/var/lib/headscale
      - /var/run/headscale:/var/run/headscale
    command: headscale serve


  headscale-ui:
    image: ghcr.io/gurucomputing/headscale-ui:latest
    restart: unless-stopped
    container_name: headscale-ui
    ports:
        - 3838:80

config.yaml

# Change to your hostname or host IP
server_url: https://mx.xxx.com:8080
# Listen to 0.0.0.0 so it's accessible outside the container
metrics_listen_addr: 0.0.0.0:9090
# The default /var/lib/headscale path is not writable in the container
noise:
  private_key_path: /var/lib/headscale/noise_private.key
# The default /var/lib/headscale path is not writable in the container
derp:
  private_key_path: /var/lib/headscale/private.key
# The default /var/run/headscale path is not writable  in the container
unix_socket: /var/run/headscale/headscale.sock
# The default /var/lib/headscale path is not writable  in the container
database.type: sqlite3
database.sqlite.path: /opt/headscale/config/db.sqlite

docker logs --follow headscale

2024-06-05T13:12:39Z FTL go/src/headscale/cmd/headscale/cli/root.go:48 > Error loading config error="fatal error reading config file: Config File \"config\" Not Found in \"[/etc/headscale /root/.headscale /]\""
2024-06-05T13:12:53Z WRN Failed to read configuration from disk error="Config File \"config\" Not Found in \"[/etc/headscale /root/.headscale /]\""
2024-06-05T13:12:53Z FTL go/src/headscale/cmd/headscale/cli/root.go:48 > Error loading config error="fatal error reading config file: Config File \"config\" Not Found in \"[/etc/headscale /root/.headscale /]\""
2024-06-05T13:13:19Z WRN Failed to read configuration from disk error="Config File \"config\" Not Found in \"[/etc/headscale /root/.headscale /]\""
2024-06-05T13:13:19Z FTL go/src/headscale/cmd/headscale/cli/root.go:48 > Error loading config error="fatal error reading config 
@Kingwayer commented on GitHub (Jun 5, 2024): docker-compose.yml ```` version: "3.7" services: headscale: image: headscale/headscale:0.22.3 restart: unless-stopped container_name: headscale ports: - "0.0.0.0:8080:8080" - "127.0.0.1:9090:9090" volumes: # pls change [config_path] to the fullpath of the config folder just created - /opt/headscale:/etc/headscale - /var/lib/headscale:/var/lib/headscale - /var/run/headscale:/var/run/headscale command: headscale serve headscale-ui: image: ghcr.io/gurucomputing/headscale-ui:latest restart: unless-stopped container_name: headscale-ui ports: - 3838:80 ```` config.yaml ```` # Change to your hostname or host IP server_url: https://mx.xxx.com:8080 # Listen to 0.0.0.0 so it's accessible outside the container metrics_listen_addr: 0.0.0.0:9090 # The default /var/lib/headscale path is not writable in the container noise: private_key_path: /var/lib/headscale/noise_private.key # The default /var/lib/headscale path is not writable in the container derp: private_key_path: /var/lib/headscale/private.key # The default /var/run/headscale path is not writable in the container unix_socket: /var/run/headscale/headscale.sock # The default /var/lib/headscale path is not writable in the container database.type: sqlite3 database.sqlite.path: /opt/headscale/config/db.sqlite ```` docker logs --follow headscale ```` 2024-06-05T13:12:39Z FTL go/src/headscale/cmd/headscale/cli/root.go:48 > Error loading config error="fatal error reading config file: Config File \"config\" Not Found in \"[/etc/headscale /root/.headscale /]\"" 2024-06-05T13:12:53Z WRN Failed to read configuration from disk error="Config File \"config\" Not Found in \"[/etc/headscale /root/.headscale /]\"" 2024-06-05T13:12:53Z FTL go/src/headscale/cmd/headscale/cli/root.go:48 > Error loading config error="fatal error reading config file: Config File \"config\" Not Found in \"[/etc/headscale /root/.headscale /]\"" 2024-06-05T13:13:19Z WRN Failed to read configuration from disk error="Config File \"config\" Not Found in \"[/etc/headscale /root/.headscale /]\"" 2024-06-05T13:13:19Z FTL go/src/headscale/cmd/headscale/cli/root.go:48 > Error loading config error="fatal error reading config ````
Author
Owner

@eMoonT commented on GitHub (Jun 6, 2024):

You can refer to my configuration, which might provide you with some help.

version: '3.7'
services:
  headscale:
    image: headscale/headscale:0.23.0-alpha9
    container_name: headscale
    volumes:
      - ./config:/etc/headscale/
      - /var/run/headscale
    ports:
      - 8080:8080
      - 9090:9090
    command: serve
    restart: always
@eMoonT commented on GitHub (Jun 6, 2024): You can refer to my configuration, which might provide you with some help. ```yaml version: '3.7' services: headscale: image: headscale/headscale:0.23.0-alpha9 container_name: headscale volumes: - ./config:/etc/headscale/ - /var/run/headscale ports: - 8080:8080 - 9090:9090 command: serve restart: always ```
Author
Owner

@ohdearaugustin commented on GitHub (Jun 6, 2024):

2024-06-05T13:13:19Z WRN Failed to read configuration from disk error="Config File "config" Not Found in "[/etc/headscale /root/.headscale /]""

Obviously your config is not loaded, this will cause headscale to restart.

Going to close this issue as it is clearly not a bug. For further support please join the discord server, people are always ready to help there.

Edit: Typo

@ohdearaugustin commented on GitHub (Jun 6, 2024): > 2024-06-05T13:13:19Z WRN Failed to read configuration from disk error="Config File \"config\" Not Found in \"[/etc/headscale /root/.headscale /]\"" Obviously your config is not loaded, this will cause headscale to restart. Going to close this issue as it is clearly not a bug. For further support please join the discord server, people are always ready to help there. Edit: Typo
Author
Owner

@thormaxx commented on GitHub (Jan 5, 2025):

I have the same trouble。So, this is because config is not loaded?

I am an unlucky new hand about docker and headscale, can anyone explained how to deal this problem clearly?

Thank you!!!

@thormaxx commented on GitHub (Jan 5, 2025): I have the same trouble。So, this is because config is not loaded? I am an unlucky new hand about docker and headscale, can anyone explained how to deal this problem clearly? Thank you!!!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#722