Headscale container keeps restarting #640

Closed
opened 2025-12-29 02:21:32 +01:00 by adam · 4 comments
Owner

Originally created by @guilherme-n-l on GitHub (Feb 18, 2024).

Bug description

After installing using this docker compose code, I keep getting this in the logs before the container restarts and tries again.

version: '3.5'
services:
  headscale:
    image: headscale/headscale:latest
    container_name: headscale
    volumes:
      - {my config directory}:/etc/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:
        - 9999:80
2024-02-19 00:16:53 Error: unknown command "headscale" for "headscale"
2024-02-19 00:16:53 Run 'headscale --help' for usage.

the headscale-ui container works ok.

Environment

  • Version of headscale: latest
  • OS: Windows 11 (Docker Desktop)
  • Docker version: 4.27.2
  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container
Originally created by @guilherme-n-l on GitHub (Feb 18, 2024). <!-- Before posting a bug report, discuss the behaviour you are expecting with the Discord community to make sure that it is truly a bug. The issue tracker is not the place to ask for support or how to set up Headscale. Bug reports without the sufficient information will be closed. Headscale is a multinational community across the globe. Our language is English. All bug reports needs to be in English. --> ## Bug description After installing using this docker compose code, I keep getting this in the logs before the container restarts and tries again. ```yaml version: '3.5' services: headscale: image: headscale/headscale:latest container_name: headscale volumes: - {my config directory}:/etc/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: - 9999:80 ``` ``` 2024-02-19 00:16:53 Error: unknown command "headscale" for "headscale" 2024-02-19 00:16:53 Run 'headscale --help' for usage. ``` the headscale-ui container works ok. ## Environment <!-- Please add relevant information about your system. For example: - Version of headscale used - Version of tailscale client - OS (e.g. Linux, Mac, Cygwin, WSL, etc.) and version - Kernel version - The relevant config parameters you used - Log output --> - Version of headscale: latest - OS: Windows 11 (Docker Desktop) - Docker version: 4.27.2 <!-- We do not support running Headscale in a container nor behind a (reverse) proxy. If either of these are true for your environment, ask the community in Discord instead of filing a bug report. --> - [ ] Headscale is behind a (reverse) proxy - [x] Headscale runs in a container
adam added the bug label 2025-12-29 02:21:32 +01:00
adam closed this issue 2025-12-29 02:21:33 +01:00
Author
Owner

@fcodes0 commented on GitHub (Feb 18, 2024):

+1, running into the same error

@fcodes0 commented on GitHub (Feb 18, 2024): +1, running into the same error
Author
Owner
@tsvico commented on GitHub (Feb 18, 2024): https://github.com/juanfont/headscale/issues/1760#issuecomment-1947950051
Author
Owner

@guilherme-n-l commented on GitHub (Feb 18, 2024):

https://github.com/juanfont/headscale/issues/1760#issuecomment-1947950051

Thanks.

@fcodes0 just add to the compose file. Also change the command from "headscale serve" to "serve":

volumes:
  - ...
  - /var/run/headscale
command: serve
@guilherme-n-l commented on GitHub (Feb 18, 2024): > https://github.com/juanfont/headscale/issues/1760#issuecomment-1947950051 Thanks. @fcodes0 just add to the compose file. Also change the command from "headscale serve" to "serve": ``` volumes: - ... - /var/run/headscale command: serve ```
Author
Owner

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

#1760 (comment)

Thanks.

@fcodes0 just add to the compose file. Also change the command from "headscale serve" to "serve":

volumes:
  - ...
  - /var/run/headscale
command: serve

I have same problem and did what you did but still same, can you test it again?

@fcodes0 just add to the compose file. Also change the command from "headscale serve" to "serve":
volumes:

  • ...
  • /var/run/headscale
    command: serve

see my docker-compose.yml below as almost fully copied from yours.

`
version: '3.5'
services:
headscale:
image: headscale/headscale:latest
container_name: headscale
volumes:
- /opt/headscale:/etc/headscale
- /var/run/headscale <----------- added this line

ports:
    - 8181:8181
    - 9090:9090
command: headscale serve                    <--- changed to serve
restart: unless-stopped

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

@Kingwayer commented on GitHub (Jun 4, 2024): > > [#1760 (comment)](https://github.com/juanfont/headscale/issues/1760#issuecomment-1947950051) > > Thanks. > > @fcodes0 just add to the compose file. Also change the command from "headscale serve" to "serve": > > ``` > volumes: > - ... > - /var/run/headscale > command: serve > ``` I have same problem and did what you did but still same, can you test it again? @fcodes0 just add to the compose file. Also change the command from "headscale serve" to "serve": volumes: - ... - /var/run/headscale command: serve see my docker-compose.yml below as almost fully copied from yours. ` version: '3.5' services: headscale: image: headscale/headscale:latest container_name: headscale volumes: - /opt/headscale:/etc/headscale - /var/run/headscale <----------- added this line ports: - 8181:8181 - 9090:9090 command: headscale serve <--- changed to serve restart: unless-stopped headscale-ui: image: ghcr.io/gurucomputing/headscale-ui:latest restart: unless-stopped container_name: headscale-ui ports: - 9999:80 `
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#640