mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	Use markdown numbering so github gets it
This commit is contained in:
		
							parent
							
								
									8da029bd14
								
							
						
					
					
						commit
						6b7c74133d
					
				@ -17,13 +17,13 @@ not work with alternatives like [Podman](https://podman.io).
 | 
				
			|||||||
mkdir config
 | 
					mkdir config
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Create an empty SQlite datebase:
 | 
					2. Create an empty SQlite datebase:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
touch config/db.sqlite
 | 
					touch config/db.sqlite
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Create a `headscale` configuration:
 | 
					3. Create a `headscale` configuration:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
touch config/config.yaml
 | 
					touch config/config.yaml
 | 
				
			||||||
@ -31,7 +31,7 @@ touch config/config.yaml
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
It is strongly recommended to copy the [example configuration](../config.yaml) from the [headscale repository](../)
 | 
					It is strongly recommended to copy the [example configuration](../config.yaml) from the [headscale repository](../)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Start the headscale server:
 | 
					4. Start the headscale server:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
docker run \
 | 
					docker run \
 | 
				
			||||||
@ -48,7 +48,7 @@ docker run \
 | 
				
			|||||||
This command will mount `config/` under `/etc/headscale`, forward port 8080 out of the container so the
 | 
					This command will mount `config/` under `/etc/headscale`, forward port 8080 out of the container so the
 | 
				
			||||||
`headscale` instance becomes available and then detach so headscale runs in the background.
 | 
					`headscale` instance becomes available and then detach so headscale runs in the background.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Verify `headscale` is running:
 | 
					5. Verify `headscale` is running:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Follow the container logs:
 | 
					Follow the container logs:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -68,7 +68,7 @@ Verify `headscale` is available:
 | 
				
			|||||||
curl http://127.0.0.1:8080/metrics
 | 
					curl http://127.0.0.1:8080/metrics
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Create a namespace ([tailnet](https://tailscale.com/kb/1136/tailnet/)):
 | 
					6. Create a namespace ([tailnet](https://tailscale.com/kb/1136/tailnet/)):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
docker exec headscale -- headscale namespaces create myfirstnamespace
 | 
					docker exec headscale -- headscale namespaces create myfirstnamespace
 | 
				
			||||||
 | 
				
			|||||||
@ -15,13 +15,13 @@ wget --output-document=/usr/local/bin/headscale \
 | 
				
			|||||||
   https://github.com/juanfont/headscale/releases/download/v<HEADSCALE VERSION>/headscale_<HEADSCALE VERSION>_linux_<ARCH>
 | 
					   https://github.com/juanfont/headscale/releases/download/v<HEADSCALE VERSION>/headscale_<HEADSCALE VERSION>_linux_<ARCH>
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Make `headscale` executable:
 | 
					2. Make `headscale` executable:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
chmod +x /usr/local/bin/headscale
 | 
					chmod +x /usr/local/bin/headscale
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Prepare a direction to hold `headscale` configuration and the [SQLite](https://www.sqlite.org/) database:
 | 
					3. Prepare a direction to hold `headscale` configuration and the [SQLite](https://www.sqlite.org/) database:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
# Directory for configuration
 | 
					# Directory for configuration
 | 
				
			||||||
@ -32,13 +32,13 @@ mkdir -p /etc/headscale
 | 
				
			|||||||
mkdir -p /var/lib/headscale
 | 
					mkdir -p /var/lib/headscale
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Create an empty SQlite datebase:
 | 
					4. Create an empty SQlite datebase:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
touch /var/lib/headscale/db.sqlite
 | 
					touch /var/lib/headscale/db.sqlite
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Create a `headscale` configuration:
 | 
					5. Create a `headscale` configuration:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
touch /etc/headscale/config.yaml
 | 
					touch /etc/headscale/config.yaml
 | 
				
			||||||
@ -47,7 +47,7 @@ touch /etc/headscale/config.yaml
 | 
				
			|||||||
It is strongly recommended to copy and modifiy the [example configuration](../config.yaml)
 | 
					It is strongly recommended to copy and modifiy the [example configuration](../config.yaml)
 | 
				
			||||||
from the [headscale repository](../)
 | 
					from the [headscale repository](../)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Start the headscale server:
 | 
					6. Start the headscale server:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
  headscale serve
 | 
					  headscale serve
 | 
				
			||||||
@ -60,7 +60,7 @@ Alternatively use terminal emulators like [tmux](https://github.com/tmux/tmux) o
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
To run `headscale` in the background, please follow the steps in the [SystemD section](#running-headscale-in-the-background-with-systemd) before continuing.
 | 
					To run `headscale` in the background, please follow the steps in the [SystemD section](#running-headscale-in-the-background-with-systemd) before continuing.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Verify `headscale` is running:
 | 
					7. Verify `headscale` is running:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Verify `headscale` is available:
 | 
					Verify `headscale` is available:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -68,7 +68,7 @@ Verify `headscale` is available:
 | 
				
			|||||||
curl http://127.0.0.1:8080/metrics
 | 
					curl http://127.0.0.1:8080/metrics
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Create a namespace ([tailnet](https://tailscale.com/kb/1136/tailnet/)):
 | 
					8. Create a namespace ([tailnet](https://tailscale.com/kb/1136/tailnet/)):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
headscale namespaces create myfirstnamespace
 | 
					headscale namespaces create myfirstnamespace
 | 
				
			||||||
@ -136,26 +136,26 @@ RuntimeDirectory=headscale
 | 
				
			|||||||
WantedBy=multi-user.target
 | 
					WantedBy=multi-user.target
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. In `/etc/headscale/config.yaml`, override the default `headscale` unix socket with a SystemD friendly path:
 | 
					2. In `/etc/headscale/config.yaml`, override the default `headscale` unix socket with a SystemD friendly path:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
unix_socket: /var/run/headscale/headscale.sock
 | 
					unix_socket: /var/run/headscale/headscale.sock
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Reload SystemD to load the new configuration file:
 | 
					3. Reload SystemD to load the new configuration file:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
systemctl daemon-reload
 | 
					systemctl daemon-reload
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Enable and start the new `headscale` service:
 | 
					4. Enable and start the new `headscale` service:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
systemctl enable headscale
 | 
					systemctl enable headscale
 | 
				
			||||||
systemctl start headscale
 | 
					systemctl start headscale
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Verify the headscale service:
 | 
					5. Verify the headscale service:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```shell
 | 
					```shell
 | 
				
			||||||
systemctl status headscale
 | 
					systemctl status headscale
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user