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
.env
file by copying the.env.example
file and modify it to your needs
cp .env.example .env
nano .env
- Generate a encryption key and set it in
.env
file asENCRYPTION_KEY
variable
openssl rand -base64 32
- Create a
config.yaml
inconfig
directory by copying theconfig.yaml.example
file
cp config/config.yaml.example config/config.yaml
nano config/config.yaml
You 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:5000
by default (if you didn't change theMANAGEMENT_PORT
variable in.env
file), or yoursPUBLIC_SERVER_URL
. -
Profit
- After step 4, you will have to uncomment following section in
docker-compose.yaml
file:
# 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.sock
involumes
section ofcontroller
service indocker-compose.yaml
file. -
Uncomment line containing
USE_SOCAT=1
in your.env
file.
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