2023-11-09 17:04:08 +08:00
---
icon: material/package
---
# Package Manager
2024-03-12 22:01:18 +08:00
## :material-tram: Repository Installation
=== ":material-debian: Debian / APT"
```bash
2024-04-10 19:43:29 +08:00
sudo curl -fsSL https://sing-box.app/gpg.key -o /etc/apt/keyrings/sagernet.asc
2024-03-12 22:01:18 +08:00
sudo chmod a+r /etc/apt/keyrings/sagernet.asc
echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/sagernet.asc] https://deb.sagernet.org/ * * " | \
sudo tee /etc/apt/sources.list.d/sagernet.list > /dev/null
sudo apt-get update
sudo apt-get install sing-box # or sing-box-beta
```
=== ":material-redhat: Redhat / DNF"
```bash
sudo dnf -y install dnf-plugins-core
2024-04-10 19:43:29 +08:00
sudo dnf config-manager --add-repo https://sing-box.app/sing-box.repo
2024-03-12 22:01:18 +08:00
sudo dnf install sing-box # or sing-box-beta
```
2024-08-20 22:23:24 +08:00
(This applies to any distribution that uses `dnf` as the package manager: Fedora, CentOS, even OpenSUSE with DNF installed.)
2024-03-12 22:01:18 +08:00
2023-11-09 17:04:08 +08:00
## :material-download-box: Manual Installation
=== ":material-debian: Debian / DEB"
```bash
bash < (curl -fsSL https://sing-box.app/deb-install.sh)
```
=== ":material-redhat: Redhat / RPM"
```bash
bash < (curl -fsSL https://sing-box.app/rpm-install.sh)
```
2024-08-20 22:23:24 +08:00
(This applies to any distribution that uses `rpm` and `systemd` . Because of how `rpm` defines dependencies, if it installs, it probably works.)
2023-11-09 17:04:08 +08:00
=== ":simple-archlinux: Archlinux / PKG"
```bash
bash < (curl -fsSL https://sing-box.app/arch-install.sh)
```
## :material-book-lock-open: Managed Installation
=== ":material-linux: Linux"
2024-04-30 07:33:49 +08:00
| Type | Platform | Command | Link |
|----------|---------------|------------------------------|---------------------------------------------------------------------------------------------------------------|
| AUR | Arch Linux | `? -S sing-box` | [][aur] |
| nixpkgs | NixOS | `nix-env -iA nixos.sing-box` | [][nixpkgs] |
| Homebrew | macOS / Linux | `brew install sing-box` | [][brew] |
| APK | Alpine | `apk add sing-box` | [][alpine] |
2024-08-21 11:39:01 +08:00
| DEB | AOSC | `apt install sing-box` | [][aosc] |
2023-11-09 17:04:08 +08:00
=== ":material-apple: macOS"
2024-04-30 07:33:49 +08:00
| Type | Platform | Command | Link |
|----------|----------|-------------------------|------------------------------------------------------------------------------------------------|
| Homebrew | macOS | `brew install sing-box` | [][brew] |
2023-11-09 17:04:08 +08:00
=== ":material-microsoft-windows: Windows"
2024-04-30 07:33:49 +08:00
| Type | Platform | Command | Link |
|------------|----------|---------------------------|-----------------------------------------------------------------------------------------------------|
| Scoop | Windows | `scoop install sing-box` | [][scoop] |
| Chocolatey | Windows | `choco install sing-box` | [][choco] |
| winget | Windows | `winget install sing-box` | [][winget] |
2023-11-09 17:04:08 +08:00
=== ":material-android: Android"
2024-04-30 07:33:49 +08:00
| Type | Platform | Command | Link |
|--------|----------|--------------------|----------------------------------------------------------------------------------------------|
| Termux | Android | `pkg add sing-box` | [][termux] |
2023-11-09 17:04:08 +08:00
2023-12-19 19:17:44 +08:00
=== ":material-freebsd: FreeBSD"
2024-04-30 07:33:49 +08:00
| Type | Platform | Command | Link |
|------------|----------|------------------------|--------------------------------------------------------------------------------------------|
| FreshPorts | FreeBSD | `pkg install sing-box` | [][ports] |
2023-12-19 19:17:44 +08:00
2024-08-21 11:39:01 +08:00
## :material-alert: Problematic Sources
| Type | Platform | Link | Promblem(s) |
|------------|----------|-------------------------------------------------------------------------------------------|------------------------------------------------------------------|
| DEB | AOSC | [aosc-os-abbs ](https://github.com/AOSC-Dev/aosc-os-abbs/tree/stable/app-network/sing-box ) | Problematic build tag list modification; Not actively maintained |
| Homebrew | / | [homebrew-core][brew] | Problematic build tag list modification |
| Termux | Android | [termux-packages][termux] | Problematic build tag list modification |
| FreshPorts | FreeBSD | [FreeBSD ports][ports] | Old Go (go1.20) |
If you are a user of them, please report issues to them:
1. Please do not modify release build tags without full understanding of the related functionality: enabling non-default
labels may result in decreased performance; the lack of default labels may cause user confusion.
2. sing-box supports compiling with some older Go versions, but it is not recommended (especially versions that are no
longer supported by Go).
2023-11-09 17:04:08 +08:00
## :material-book-multiple: Service Management
For Linux systems with [systemd][systemd], usually the installation already includes a sing-box service,
you can manage the service using the following command:
| Operation | Command |
|-----------|-----------------------------------------------|
| Enable | `sudo systemctl enable sing-box` |
| Disable | `sudo systemctl disable sing-box` |
| Start | `sudo systemctl start sing-box` |
| Stop | `sudo systemctl stop sing-box` |
| Kill | `sudo systemctl kill sing-box` |
| Restart | `sudo systemctl restart sing-box` |
| Logs | `sudo journalctl -u sing-box --output cat -e` |
| New Logs | `sudo journalctl -u sing-box --output cat -f` |
[alpine]: https://pkgs.alpinelinux.org/packages?name=sing-box
[aur]: https://aur.archlinux.org/packages/sing-box
[nixpkgs]: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/tools/networking/sing-box/default.nix
[brew]: https://formulae.brew.sh/formula/sing-box
2023-12-19 19:17:44 +08:00
[openwrt]: https://github.com/openwrt/packages/tree/master/net/sing-box
[immortalwrt]: https://github.com/immortalwrt/packages/tree/master/net/sing-box
2023-11-09 17:04:08 +08:00
[choco]: https://chocolatey.org/packages/sing-box
[scoop]: https://github.com/ScoopInstaller/Main/blob/master/bucket/sing-box.json
[winget]: https://github.com/microsoft/winget-pkgs/tree/master/manifests/s/SagerNet/sing-box
2023-12-19 19:17:44 +08:00
[termux]: https://github.com/termux/termux-packages/tree/master/packages/sing-box
[ports]: https://www.freshports.org/net/sing-box
2024-08-21 11:39:01 +08:00
[aosc]: https://packages.aosc.io/packages/sing-box
2023-12-19 19:17:44 +08:00
[systemd]: https://systemd.io/