Run headscale with ease.
Subprojects:
- Web interface headscale-management
- Integration layer headscale-controller
- Clone this repository and go to the directory
git clone [email protected]:parallelo3301/headscale-stack.git .
cd headscale-stack- Create a
.envfile by copying the.env.examplefile and modify it to your needs
cp .env.example .env
nano .env- Generate a encryption key and set it in
.envfile asENCRYPTION_KEYvariable
openssl rand -base64 32- Create a
config.yamlinconfigdirectory by copying theconfig.yaml.examplefile
cp config/config.yaml.example config/config.yaml
nano config/config.yamlYou will most probably want to change the following values:
server_url
- Run the stack
docker compose up -d- Obtain the API key
# note the expiration set to 1000 days, modify it to your needs
docker compose exec server headscale apikey create --expiration 1000d-
If you run it behind a reverse proxy, you may want to setup it.
-
Set the API key in web interface. You can access it at
http://localhost:5000by default (if you didn't change theMANAGEMENT_PORTvariable in.envfile), or yoursPUBLIC_SERVER_URL. -
Profit
- After step 4, you will have to uncomment following section in
docker-compose.yamlfile:
# this is still part of controller service
depends_on:
- socat
# new service
socat:
image: alpine/socat
command: tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 2375:2375-
(optional) You can comment
- /var/run/docker.sock:/var/run/docker.sockinvolumessection ofcontrollerservice indocker-compose.yamlfile. -
Uncomment line containing
USE_SOCAT=1in your.envfile.
After the setup, you can use docker compose exec server headscale in the
container:
docker compose exec server headscale <command>
# e.g.
docker compose exec server headscale help
docker compose exec server headscale users list
docker compose exec server headscale users create bob- Add PostgreSQL to the stack
- Use PostgreSQL to save ACLs in more structured way
- Auth
- Basic auth
- OIDC
- Integrate headscale-management once it's ready