This installation method is designed for macOS and Linux users who have already installed Homebrew.
If you don't have Homebrew installed, you can install it with:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install 0xjacky/tools/nginx-ui
This command will:
0xjacky/tools
tap to your HomebrewAfter installation, you can verify that Nginx UI is installed correctly:
nginx-ui --version
Nginx UI can be managed as a system service using Homebrew's service management features.
# Start the service and enable it to start at boot
brew services start nginx-ui
# Or start the service for the current session only
brew services run nginx-ui
brew services stop nginx-ui
brew services restart nginx-ui
brew services list | grep nginx-ui
If you prefer to run Nginx UI manually instead of as a service:
# Run in foreground
nginx-ui
# Run with custom config
nginx-ui serve -config /path/to/your/app.ini
# Run in background
nohup nginx-ui serve &
The configuration file is automatically created during installation and located at:
/opt/homebrew/etc/nginx-ui/app.ini
/usr/local/etc/nginx-ui/app.ini
/home/linuxbrew/.linuxbrew/etc/nginx-ui/app.ini
Data is stored in:
/opt/homebrew/var/nginx-ui/
/usr/local/var/nginx-ui/
/home/linuxbrew/.linuxbrew/var/nginx-ui/
The default configuration includes:
[app]
PageSize = 10
[server]
Host = 0.0.0.0
Port = 9000
RunMode = release
[cert]
HTTPChallengePort = 9180
[terminal]
StartCmd = login
brew upgrade nginx-ui
brew update && brew upgrade
# Stop the service first
brew services stop nginx-ui
# Uninstall the package
brew uninstall nginx-ui
If you no longer need the tap:
brew untap 0xjacky/tools
::: warning
This will permanently delete all your configurations, sites, certificates, and data. Make sure to backup any important data before proceeding.
:::
# macOS (Apple Silicon)
sudo rm -rf /opt/homebrew/etc/nginx-ui/
sudo rm -rf /opt/homebrew/var/nginx-ui/
# macOS (Intel)
sudo rm -rf /usr/local/etc/nginx-ui/
sudo rm -rf /usr/local/var/nginx-ui/
# Linux
sudo rm -rf /home/linuxbrew/.linuxbrew/etc/nginx-ui/
sudo rm -rf /home/linuxbrew/.linuxbrew/var/nginx-ui/
If you encounter port conflicts (default port is 9000), you need to modify the configuration file:
Edit the configuration file:
# macOS (Apple Silicon)
sudo nano /opt/homebrew/etc/nginx-ui/app.ini
# macOS (Intel)
sudo nano /usr/local/etc/nginx-ui/app.ini
# Linux
sudo nano /home/linuxbrew/.linuxbrew/etc/nginx-ui/app.ini
Change the port in the [server]
section:
[server]
Host = 0.0.0.0
Port = 9001
RunMode = release
Restart the service:
brew services restart nginx-ui
To troubleshoot service issues, you can view the logs using these commands:
Nginx UI's Homebrew formula includes proper log configuration:
# View service status and log file paths
brew services info nginx-ui
# View standard output logs
tail -f $(brew --prefix)/var/log/nginx-ui.log
# View error logs
tail -f $(brew --prefix)/var/log/nginx-ui.err.log
# View both logs simultaneously
tail -f $(brew --prefix)/var/log/nginx-ui.log $(brew --prefix)/var/log/nginx-ui.err.log
For Linux systems using systemd:
# View service logs
journalctl -u homebrew.mxcl.nginx-ui -f
# View recent logs
journalctl -u homebrew.mxcl.nginx-ui --since "1 hour ago"
If you need to debug service issues, you can run manually to see output:
# Run in foreground to see all output
nginx-ui serve -config $(brew --prefix)/etc/nginx-ui/app.ini
# Check if the service is running
ps aux | grep nginx-ui
If you encounter permission issues when managing Nginx configurations:
Check file permissions:
# Check configuration file permissions
ls -la $(brew --prefix)/etc/nginx-ui/app.ini
# Check data directory permissions
ls -la $(brew --prefix)/var/nginx-ui/
If the service fails to start:
Check the service status:
brew services list | grep nginx-ui
Verify the configuration file exists and is valid:
# Check if config file exists
ls -la $(brew --prefix)/etc/nginx-ui/app.ini
# Test configuration
nginx-ui serve -config $(brew --prefix)/etc/nginx-ui/app.ini --help
Try running manually to see error messages:
nginx-ui serve -config $(brew --prefix)/etc/nginx-ui/app.ini
Check for port conflicts:
# Check if port 9000 is already in use
lsof -i :9000
# Check if HTTP challenge port is in use
lsof -i :9180
If you encounter any issues:
After installation, you can:
http://localhost:9000