Linux packages and systemd
Production walkthrough
To go from a release asset, file permissions, firewall, and systemd through verification, upgrade, and rollback, use Linux VPS production deployment.
Release packages
The release pipeline can produce:
- Debian/Ubuntu
.deb - RPM
.rpm - Arch/Pacman
.pkg.tar.zst
A package install provides:
/usr/bin/aster-core
/usr/bin/mihomo -> aster-core compatibility
/etc/mihomo/config.yaml
aster-core.service
[email protected]Verify before install
sha256sum -c checksums.txtAfter the package is installed:
sudo /usr/bin/aster-core -d /etc/mihomo -tDirectories and permissions
Recommended:
sudo install -d -m 700 /etc/mihomo
sudo chmod 600 /etc/mihomo/config.yaml
sudo chmod 600 /etc/mihomo/aster-state.json* 2>/dev/null || trueIf the service uses a dedicated user, change the owner to that account. The Aster store directory must follow the owner-only rule.
Main service
sudo systemctl enable --now aster-core
sudo systemctl status aster-core
sudo journalctl -u aster-core -fThe unit runs:
/usr/bin/aster-core -d /etc/mihomoReload:
sudo /usr/bin/aster-core -d /etc/mihomo -t
sudo systemctl reload aster-coreRun -t first, then reload, so an obviously invalid profile is not handed to the running service.
Multiple instances
sudo systemctl enable --now aster-core@edgeConfiguration directory:
/etc/mihomo/edgeEach instance must use different:
- Proxy/listener ports
- Controller address
- TUN device/name
- Aster store
- Unix socket/named resource
Do not point two instances at the same Aster state. Store generation and locking prevent some conflicts, but runtime listener ownership still does not work.
Capabilities
The package unit may grant:
CAP_NET_ADMINCAP_NET_RAWCAP_NET_BIND_SERVICECAP_SYS_TIMECAP_SYS_PTRACECAP_DAC_READ_SEARCHCAP_DAC_OVERRIDE
That set covers many Mihomo features and is high privilege. If you only run an HTTP/SOCKS client, create a custom unit with fewer capabilities.
Manual binary service
Example:
[Unit]
Description=Aster Core
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/aster-core -d /etc/mihomo
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=5
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.targetTUN/transparent proxy needs extra capabilities. If you do not need them, do not copy the full package-unit privilege set.
Geodata
The Docker image ships geodata. Binary/package deployments may download it on first use, or you may need to place it in the home directory yourself:
geoip.metadbGeoIP.datGeoSite.datASN.mmdb
If production has no outbound Internet, include and verify these in the deploy artifact.
Upgrade/rollback
- Back up
/etc/mihomo. - Keep the old binary/package.
- Run
-twith the new binary. - Stop or reload the service.
- Verify Controller, DNS, TCP, UDP, and managed users.
- On a problem, restore the binary and a compatible state/config.
An unsupported Aster state version refuses to load. Do not hand-edit the version field to bypass that.
