A lightweight web interface for managing your Headscale server.
1.7K
Important
First on production...
A lightweight web interface for managing your Headscale server, built with Go (Backend) and React (Frontend). It acts as a secure proxy to the Headscale API.
While this UI covers most daily operations, please keep the following in mind:
The easiest way to deploy Headscale UI is using Docker:
docker run -d \
--name headscale-ui \
-p 3050:3050 \
-e HEADSCALE_SERVER="https://your-headscale-domain.com" \
-e SERVER_LISTEN=":3050" \
ernestoyoofi/headscale-ui:latest
Warning
This project is optimized for Docker. Running it directly on a host machine is possible using the method below, but it is **not recommended** for production environments.
Clone the Repository
git clone https://github.com/ernestoyoofi/headscale-ui.git
cd headscale-ui
You need a golang, bun/nodejs and C to build this.
Build the Backend.
cd backend
go build -o headscaleui-host ./cmd/server
chmod +x ./headscaleui-host
sudo cp ./headscaleui-host /usr/local/bin/headscale-ui
cd ..
Build the frontend.
Using Node.js/NPM:
cd frontend
npm install
npm run build
sudo mkdir -p /root/headscale-ui/app/
sudo mkdir -p /var/www/headscale-ui
sudo cp -r ./dist/* /var/www/headscale-ui/
rm -r ./dist
cd ..
Using Bun:
cd frontend
bun install
bun run build
sudo mkdir -p /root/headscale-ui/app/
sudo mkdir -p /var/www/headscale-ui
sudo cp -r ./dist/* /var/www/headscale-ui/
rm -r ./dist
cd ..
Systemd Service Configuration
Create a service file at /etc/systemd/system/headscale-ui.service:
[Unit]
Description=Headscale UI Service
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/var/lib/headscale-ui
ExecStart=/usr/local/bin/headscale-ui
Restart=on-failure
RestartSec=2s
# Environment Configurations
Environment=SQLITE_LOCATION=/var/lib/headscale-ui/database.db
Environment=UNJWT_SECRET=/var/lib/headscale-ui/jwt-token
Environment=DIST_FRONTEND=/var/www/headscale-ui
Environment=HEADSCALE_SERVER=http://localhost:8080
Environment=SERVER_LISTEN=:3050
[Install]
WantedBy=multi-user.target
Enable and Start Service
sudo mkdir -p /var/lib/headscale-ui
sudo systemctl daemon-reload
sudo systemctl enable --now headscale-ui
Access the dashboard via your IP or domain (Port 3050).
Complete the Admin Account setup on the first run.
Input your Headscale API Key in the settings menu.
Add the headscale-ui service to your existing docker-compose.yml. You can see a full example here.
headscale_ui:
image: ernestoyoofi/headscale-ui:latest
container_name: headscale-ui
restart: unless-stopped
networks:
- headscale
volumes:
- ${PWD}/headscale-ui/database:/app/database
- ${PWD}/headscale-ui/secret:/app/secret
environment:
- JWT_SECRET="PleaseAddYourSecretJwtToken" # Jwt Token
- SERVER_LISTEN=":3050" # Server Listening
- HEADSCALE_SERVER="headscale:8080" # Headscale Service Network
labels:
# If Usage Traefik Proxy
- "traefik.enable=true"
- "traefik.http.routers.headscale-ui.rule=Host(`login.tailscale.yourdomain.com`)"
- "traefik.http.routers.headscale-ui.entrypoints=websecure"
- "traefik.http.routers.headscale-ui.tls.certresolver=cloudflare"
- "traefik.http.services.headscale-ui.loadbalancer.server.port=3050"
Run docker-compose up -d.
Access the dashboard via your configured domain or IP.
On the first run, set up your Admin Account (Username & Password).
Input your Headscale API Key in the settings menu to start managing your network.
| Variable | Description | Requirement |
|---|---|---|
JWT_SECRET | Secret key for signing JSON Web Tokens | Optional (Recommended) |
SERVER_LISTEN | The address and port the UI listens on (e.g., :3050) | Required |
HEADSCALE_SERVER | Address of your Headscale API (e.g., headscale:8080) | Required |
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)Distributed under the Apache 2.0. See LICENSE for more information.
Content type
Image
Digest
sha256:f006d98cb…
Size
12.6 MB
Last updated
9 months ago
docker pull ernestoyoofi/headscale-ui