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.
Install or upgrade to a specified version.
Uninstall
Remove Hysteria and its service.
Advanced
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.
Specify Architecture
Mainly for installing the AVX version.
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.
To reset this setting, you can remove Hysteria and reinstall it, or you can execute the following command.
Miscellaneous
Edit Configuration File
Service Management
Enable the service at startup and start it immediately.
Restart the service, usually after modifying the configuration file.
Check the service status.
Logs
View server logs.