English | Русский
Automated installation script for Passwall2 on OpenWrt routers. It installs Passwall2 from the official GitHub releases of Openwrt-Passwall/openwrt-passwall2, using either opkg or apk depending on the OpenWrt release.
Run this on your OpenWrt device:
cd /tmp && rm -f passwall2.sh && wget -O passwall2.sh https://raw.githubusercontent.com/enxy0/passwall2_install/main/passwall2.sh && sh passwall2.sh- GitHub release installation: installs the latest release by default or a specific release when provided
- Package manager detection: uses
apkon OpenWrt 25.x builds andopkgon older builds - Automatic architecture detection: detects the device architecture automatically
- Dependency management: installs required packages such as
dnsmasq-full, kernel modules,curl,unzip, andjsonfilter - Configuration backup: backs up the existing Passwall2 configuration before installation
- Clean install option: removes existing packages before reinstalling
- LuCI-only mode: installs only the web interface
- Error reporting: shows installation errors and common recovery hints
Install the latest release:
./passwall2.shInstall a specific release:
./passwall2.sh 26.6.3-1Usage: ./passwall2.sh [OPTIONS] [VER]
Options:
[VER] Optional release version (e.g., 26.6.3-1)
-c, --clean Clean install (remove old packages first)
-l, --only-luci Install only LuCI interface (skip binaries)
-h, --help Show help message
Examples:
./passwall2.sh Install latest release
./passwall2.sh 26.6.3-1 Install a specific release
./passwall2.sh -c Clean install of latest release
./passwall2.sh -l LuCI-only install
- Checks internet connectivity, free space, and basic device information
- Detects
apkoropkgand installs required tools such ascurl,unzip, andjsonfilter - Ensures
kmod-nft-tproxyandkmod-nft-socketare installed - Replaces basic
dnsmasqwithdnsmasq-fullwhen needed - Detects the OpenWrt architecture automatically
- Backs up the existing
/etc/config/passwall2configuration if present - Downloads the matching LuCI package and runtime package archive from GitHub releases
- Installs Passwall2 and bundled runtime packages such as Xray, sing-box, chinadns-ng, Hysteria, HAProxy, microsocks, and NaiveProxy when present in the release archive
- Cleans up temporary files
- Open the LuCI web interface
- Go to
Services -> Passwall2 - Configure your proxy settings
Not enough space
Use -c to remove existing packages before reinstalling:
./passwall2.sh -cNo compatible binary package
Use -l for a LuCI-only installation:
./passwall2.sh -lInstallation fails
Check internet connectivity, DNS settings, available storage, and whether the selected Passwall2 release has assets for your architecture.
- Passwall2: original project by the OpenWrt Passwall team
This installation script is provided as-is for personal and educational use.