Deploying Self-Hosted Hysteria 2 Proxy on Debian-Based Linux VPS via Terminal

A detailed guide explains how to set up a personal Hysteria 2 proxy server on a KVM VPS running Debian or Ubuntu without any web panels. The process begins with generating ed25519 SSH keys, hardening the sshd_config file, and restricting access with ufw to only TCP port 22 and UDP port 443. Hysteria 2 is downloaded from GitHub, made executable, and configured using a TOML file that enables salamander obfuscation and a self-signed TLS certificate. A custom systemd unit ensures the service restarts on failure. The client configuration includes SHA256 pinning of the server certificate to prevent MITM attacks. The guide emphasizes manual CLI operations that apply equally to other services such as Nginx and stresses checking local laws before deployment.

HabrTranslated from Russian

Read at source

A comprehensive tutorial demonstrates how to deploy a personal Hysteria 2 proxy entirely from the terminal on a KVM VPS. The author focuses on core Linux administration tasks including handling executable binaries, managing open ports, configuring SSH keys, and applying basic security hardening.

The guide targets Debian and Ubuntu systems; users of AlmaLinux or similar distributions are instructed to substitute apt commands with dnf equivalents. After connecting via the hoster-provided password, the first recommended step is to generate an ed25519 key pair locally with ssh-keygen and copy the public key to the server’s authorized_keys file.

Password authentication is then disabled in /etc/ssh/sshd_config, the SSH service is restarted, and future logins require the private key. The server is updated, ufw is installed, and rules are set to deny all incoming traffic except TCP 22 and UDP 443.

Hysteria 2 is downloaded from the official GitHub releases, moved to /usr/local/bin, and marked executable. A self-signed certificate is generated with openssl and placed in /etc/hysteria. The server configuration in TOML format enables the salamander obfuscation method together with a password-based authenticator.

A minimal systemd unit is created to manage the service, after which it is enabled and started. On the client side, the same binary is used with a configuration that pins the SHA256 hash of the server certificate and specifies a local SOCKS5 listener.

The author notes that QUIC requires a kernel no older than 5.4 for proper Brutal BBR operation and that the resulting setup provides a single-user, self-hosted proxy rather than a multi-tenant VPN service.

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in Other

Mail.ru Reduces Lifetime 1TB Cloud Storage Promo to Standard 8GB Quota for Select Users
Kimi K3 Open Model Surpasses Closed AI Leaders with Million-Token Context and 896 Experts
Innostage Completes Functional Testing of PT NGFW 1.10.3 Across 156 Criteria