This repository contains helper scripts to install prerequisites, configure WireGuard, and manage a Qubetics dVPN node via systemd.
install-go.sh: Installs a recent Go toolchain for building/running tooling if not present.setup_wireguard.sh: Installs WireGuard, generates/uses keys, and writes a minimal/etc/wireguard/wg0.confwith NAT rules.start-node.sh: All-in-one node manager with commands:init,start,stop,restart,status,uninstall-wireguard,uninstall-service.
Notes:
- The script writes a systemd unit
dvpn-node.servicethat runs the node as the current user.
- Ubuntu 20.04/22.04/24.04 with
systemdandapt - Root privileges for installing packages and writing
/etc/wireguard - Internet connectivity
cd /dev-dvpn-node-script
./install-go.sh
source ~/.bashrc
source ~/.profileThis updates your shell profile so go is on your PATH in new sessions.
You must have a working WireGuard interface (wg0) before initializing the node.
sudo ./setup_wireguard.sh
# or provide your own private key (base64):
sudo ./setup_wireguard.sh --private-key "<YOUR_BASE64_PRIVATE_KEY>"sudo ./setup_wireguard.sh --uninstallWhat the script does:
- Installs
wireguardandwireguard-tools - Generates or imports keys under
/etc/wireguard - Writes
/etc/wireguard/wg0.confwith defaults:- Address:
10.8.0.1/24 - ListenPort:
51820 - NAT via iptables
- Address:
- Shows your public key and basic usage tips
Start and enable WireGuard:
sudo systemctl enable --now wg-quick@wg0
sudo wg showinit prepares the node home, downloads the correct binary for your Ubuntu version, creates config and keys, and sets your account.
./start-node.sh initBehavior:
- Verifies WireGuard is installed (
wg,wg-quick) - Installs Go if missing by running
install-go.sh - Detects your Ubuntu version and downloads
qubetics-dvpnxto your Go bin directory - Creates
~/.qubetics-dvpnx, asks for node name and account name - Writes
config.tomlwith default prices and timers - Sets
from_nameto your chosen account inconfig.toml
The start command writes/updates the systemd unit and enables it. Then start the service manually.
./start-node.sh start
sudo systemctl start dvpn-node.serviceCheck status and logs:
./start-node.sh status
# or directly
sudo systemctl status dvpn-node.service --no-pager | cat
journalctl -u dvpn-node.service -n 50 --no-pager | catRestart/stop:
./start-node.sh restart
./start-node.sh stopUninstall:
# Remove systemd unit and node data (~/.qubetics-dvpnx)
./start-node.sh uninstall-service
# Remove WireGuard packages and /etc/wireguard
./start-node.sh uninstall-wireguardOn start, the script reads /etc/wireguard/wg0.conf and updates the [wireguard] section of ~/.qubetics-dvpnx/config.toml with:
ipv4_addr->Addressport>ListenPortprivate_key>PrivateKey
Ensure your wg0.conf is correct before starting the node.
cd /dev-dvpn-node-script
sudo bash ./setup_wireguard.sh
sudo systemctl enable --now wg-quick@wg0
./start-node.sh init
./start-node.sh start
sudo systemctl start dvpn-node.service
./start-node.sh status- If
dvpn-node.serviceis enabled but not started, run:sudo systemctl start dvpn-node.service. - If the node cannot read WireGuard values, verify
/etc/wireguard/wg0.confexists and containsAddress,ListenPort, andPrivateKey. - Make sure outbound UDP/51820 and your selected API port are not blocked by a firewall or cloud rules.
- After editing
config.toml, re-run./start-node.sh startthensudo systemctl restart dvpn-node.service.