Skip to content

Server Installation Script

We provide a bash script that can maintain (install, upgrade, uninstall) Hysteria and its systemd service on common Linux distributions.

Note: This official script aims to achieve effects similar to package managers and will only generate example configuration files. Manual server configuration is still required to start the service properly.

If you need a "foolproof" script that can effortlessly install, configure, and start the Hysteria server, please search for third-party "Hysteria 2 scripts" via search engines.

Environment Requirements

Hysteria itself has no specific requirements related to Linux distributions, but the script is designed to run on systems that meet the following conditions:

  • Services are managed based on systemd (via the systemctl command)
  • The following programs are installed and NOT provided through busybox.
  • GNU Coreutils tools
  • bash
  • grep
  • curl

For new VPS users, please use stable versions of mainstream distributions released within the last 2 years. Avoid using CentOS 7.

If you are unfamiliar with Linux distributions, we recommend the following options:

  • Debian 11 or higher
  • Ubuntu 22.04 LTS or higher LTS versions
  • Rocky Linux 8 or higher
  • CentOS Stream 8 or higher
  • Fedora 37 or higher

Unsupported distributions:

  • OpenWrt
  • Alpine Linux
  • NixOS

Common Operations

Install or Upgrade

Install or upgrade to the latest version.

bash <(curl -fsSL

Install or upgrade to a specified version.

bash <(curl -fsSL --version v2.4.5


Remove Hysteria and its service.

bash <(curl -fsSL --remove


Install from Local File

If your VPS cannot connect to GitHub Release, you can manually transfer the Hysteria executable file to the VPS for installation.

bash <(curl -fsSL --local /path/to/hysteria-linux-amd64

Specify Architecture

Mainly for installing the AVX version.

ARCHITECTURE=amd64-avx bash <(curl -fsSL

Specify User

If you want to avoid handling permission issues (usually due to using other programs to generate and manage certificates), you can configure Hysteria's systemd service to run as root with the following command.

HYSTERIA_USER=root bash <(curl -fsSL

To reset this setting, you can remove Hysteria and reinstall it, or you can execute the following command.

HYSTERIA_USER=hysteria bash <(curl -fsSL


Edit Configuration File

nano /etc/hysteria/config.yaml

Service Management

Enable the service at startup and start it immediately.

systemctl enable --now hysteria-server.service

Restart the service, usually after modifying the configuration file.

systemctl restart hysteria-server.service

Check the service status.

systemctl status hysteria-server.service


View server logs.

journalctl --no-pager -e -u hysteria-server.service