CLI
TunGuard can be managed directly from the command line or through systemd when installed as a service.
Install⚓
Install TunGuard on a Linux server with:
The installer installs TunGuard as a systemd service and starts it automatically.
Service Management⚓
Check the service status:
Start TunGuard:
Stop TunGuard:
Restart TunGuard:
Enable TunGuard to start automatically on boot:
Logs⚓
View the TunGuard service logs:
Follow the logs in real time:
Show logs from the current boot:
Show the most recent logs:
Reset Dashboard Credentials⚓
If you forget the dashboard username or password, stop TunGuard first:
Run the reset command:
The reset restores:
Start TunGuard again:
The complete procedure is:
This resets the stored dashboard login without removing the configured peers or other persistent TunGuard data.
Manual Run⚓
TunGuard can also be started directly from the command line.
Enable the web dashboard when running manually:
Enable the SSH Gateway:
Enable both:
When using the systemd service installed by the installer, these options are configured through the service configuration rather than being required for normal operation.
SSH Gateway⚓
The optional SSH Gateway allows you to reach devices connected to TunGuard through the VPN.
The default SSH Gateway port is:
For example, to connect to a WireGuard peer at 10.100.0.2:
The SSH Gateway uses the TunGuard dashboard credentials for authentication.
The jump host can be used without exposing SSH directly on the VPN device.
See SSH Access for the browser SSH terminal, the built-in ssh
client, and the jump command.
Domains (HTTPS Reverse Proxy)⚓
TunGuard can publish a domain with automatic HTTPS in front of a TRP mapping or a tunneled service. Manage mappings from the console:
domain list mappings: domain, backend, target, state
domain add app.example.com --trp 3 behind an existing TRP mapping
domain add api.example.com --wg 10.100.0.2 8080 behind a tunneled WireGuard service
domain update app.example.com --disable pause without deleting
domain remove app.example.com by id or domain name
See Domains & HTTPS Proxy for the full guide.
AdGuard Home⚓
The built-in AdGuard Home can filter DNS for devices in an AdGuard-enabled policy group:
adguard status state, DNS/Web listen addresses, upstream, adult filter
adguard start launch the managed AdGuard Home instance
adguard stop stop it
adguard config binary, data dir and all ADGUARD_* settings
See AdGuard DNS Filtering for the full guide.
SSH Gateway With a Custom Port⚓
If the SSH Gateway is configured to use another port, specify that port in the jump host:
Check the SSH Gateway⚓
Check whether TunGuard is running:
Then check that the SSH Gateway is listening on port 2222:
Check the Dashboard/API⚓
The default dashboard and API port is:
Check whether TunGuard is listening:
The health endpoint can be checked locally with:
Check the WireGuard Port⚓
The default WireGuard port is:
Check whether TunGuard is listening:
Update TunGuard⚓
Run the installer again to update an existing installation:
The installer replaces the TunGuard binary while preserving the existing persistent data and service configuration.
Backup⚓
Create a backup of the TunGuard data directory:
The persistent data contains the server key, peer configuration, dashboard credentials, API key, and other TunGuard state.
Useful Service Commands⚓
A quick reference:
# Status
sudo systemctl status tanguard
# Start
sudo systemctl start tanguard
# Stop
sudo systemctl stop tanguard
# Restart
sudo systemctl restart tanguard
# Enable at boot
sudo systemctl enable tanguard
# Follow logs
sudo journalctl -u tanguard -f
# Last 100 log entries
sudo journalctl -u tanguard -n 100