2025 macOS Proxy Setup Guide (System Proxy + Terminal Proxy)

Complete 2025 macOS proxy setup guide covering system preferences proxy settings, terminal export commands, and tool-level configuration.

16Yun Engineering TeamApr 11, 20256 min read

When to Use This

In 2025, macOS is the mainstream operating system for Mac computers. Setting up a proxy on macOS is a frequent requirement: routing traffic through a corporate proxy on the office network, using proxy IPs for data collection and web scraping, or managing multiple store accounts with different IPs in cross-border e-commerce.

macOS proxy configuration operates at two independent levels. System-level proxy settings affect GUI applications such as Safari, Chrome, and Mail. Terminal-level proxy settings affect command-line tools such as curl, git, and npm. This guide covers both approaches.

Prerequisites

Before you begin, confirm the following proxy information is ready:

ItemDescriptionExample
Proxy server addressIP address or domain nameproxy.16yun.cn
Port numberHTTP proxy commonly uses 8888, SOCKS5 uses 10808888
UsernameFor proxy authentication (leave blank if not required)your-username
PasswordFor proxy authenticationyour-password
Proxy typeHTTP / HTTPS / SOCKS5HTTP

Method 1: System Proxy Settings (GUI)

System proxy settings affect most GUI applications, including Safari, Chrome, Mail, and other network-aware Mac apps.

Step 1: Open System Settings Click the Apple menu in the top-left corner and select System Settings. You can also click the System Settings icon in the Dock.

Step 2: Navigate to Network In System Settings, locate and click Network. The Network settings are listed in the sidebar.

Step 3: Select Your Network Connection Choose the network connection you are currently using. There are two options: WiFi (wireless) or Ethernet (wired). Select the active one.

Step 4: Open Proxy Settings Click the Details button (or Advanced on older macOS versions), then select the Proxies tab.

Step 5: Select Proxy Protocols macOS supports multiple proxy protocols. Check the ones you need:

  • Web Proxy (HTTP): For HTTP traffic
  • Secure Web Proxy (HTTPS): For HTTPS traffic
  • SOCKS Proxy: For SOCKS traffic (if required)

Typically, check both Web Proxy (HTTP) and Secure Web Proxy (HTTPS), entering the same proxy address and port for both.

Step 6: Enter Proxy Information Fill in the proxy server address and port number. If the proxy requires authentication, check Proxy server requires password and enter your credentials.

Step 7: Apply Settings Click OK to close the detail window, then click Apply for the settings to take effect.

Verification

Open Safari and visit httpbin.org/ip. If the page shows your proxy IP address, the configuration is successful.

Method 2: Terminal Proxy (CLI)

If you use command-line tools in the terminal (curl, wget, git, npm, etc.), you need to configure terminal proxy separately. Terminal proxy does not follow system proxy settings.

Temporary Setup (current session only):

export http_proxy=http://proxy.16yun.cn:8888
export https_proxy=http://proxy.16yun.cn:8888
export HTTP_PROXY=http://proxy.16yun.cn:8888
export HTTPS_PROXY=http://proxy.16yun.cn:8888

Run these commands in the terminal. The proxy applies only to the current terminal window. Close the terminal or open a new window and the settings are lost.

Permanent Setup (recommended):

Add the following lines to your shell profile (~/.zshrc for zsh on macOS, or ~/.bashrc for bash):

# Proxy settings
export http_proxy=http://proxy.16yun.cn:8888
export https_proxy=http://proxy.16yun.cn:8888
export HTTP_PROXY=http://proxy.16yun.cn:8888
export HTTPS_PROXY=http://proxy.16yun.cn:8888
# Bypass proxy for local addresses
export no_proxy=localhost,127.0.0.1,10.*

After adding the lines, run source ~/.zshrc to apply the changes immediately.

SOCKS5 Proxy Configuration:

If you are using a SOCKS5 proxy, set the environment variable differently:

export ALL_PROXY=socks5://proxy.16yun.cn:1080
export all_proxy=socks5://proxy.16yun.cn:1080

Tool-Level Configuration

Some tools support independent proxy settings alongside environment variables:

Git:

git config --global http.proxy http://proxy.16yun.cn:8888
git config --global https.proxy http://proxy.16yun.cn:8888
git config --global --unset http.proxy  # Remove proxy

npm:

npm config set proxy http://proxy.16yun.cn:8888
npm config set https-proxy http://proxy.16yun.cn:8888
npm config delete proxy  # Remove proxy

curl:

curl -x http://proxy.16yun.cn:8888 https://httpbin.org/ip

Common Issues

Issue 1: Safari and Chrome use the proxy but terminal tools do not

macOS system proxy settings apply only to GUI applications. Terminal tools require the export commands described in Method 2. If you run curl, git, or npm through the terminal and need them to use a proxy, run the export commands or add them to your shell profile.

Issue 2: Some apps bypass the system proxy

macOS system proxy only affects applications that respect system proxy settings. Some third-party applications ignore them. For truly global proxy coverage, install a proxy client like Proxifier.

Issue 3: Terminal proxy is set but does not take effect

Verify the proxy address and port in the export commands. Pay attention to the difference between http_proxy (HTTP requests) and https_proxy (HTTPS requests). Many programs only recognize lowercase variants, so set both lowercase and uppercase. After setting, confirm with echo $http_proxy.

Configuration Method Comparison

MethodScopeAdvantageDisadvantage
System proxy (GUI)GUI applicationsOne-time setup, Safari/Chrome auto-configDoes not affect terminal tools
Terminal exportCurrent terminalCommand-line tools use proxy automaticallyMust re-set for each new terminal
Shell profileAll terminalsPermanent, no repeat configurationRequires editing a config file
Tool-level configSingle toolDoes not affect other toolsMust configure each tool individually

Important Notes

  1. System proxy and terminal proxy are independent and must be configured separately
  2. Back up your shell profile before editing it to avoid configuration errors
  3. Always set no_proxy so that local addresses bypass the proxy
  4. SOCKS5 proxy on macOS requires tool-level configuration or a dedicated proxy client
  5. Disable proxy in System Settings or unset environment variables when proxy is no longer needed
  6. If the proxy server disconnects unexpectedly, disable the system proxy in Network settings or run unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY in the terminal to restore direct connectivity

Proxy Script Automation

If you frequently switch between proxy configurations, add these functions to your ~/.zshrc for quick toggling:

# Enable proxy
function proxy_on() {
    export http_proxy=http://proxy.16yun.cn:8888
    export https_proxy=http://proxy.16yun.cn:8888
    export HTTP_PROXY=http://proxy.16yun.cn:8888
    export HTTPS_PROXY=http://proxy.16yun.cn:8888
    echo "Proxy enabled"
}
 
# Disable proxy
function proxy_off() {
    unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
    echo "Proxy disabled"
}

After adding the functions, run source ~/.zshrc, then use proxy_on or proxy_off in the terminal for instant switching.

macOS Version Differences

macOS VersionSettings EntryNotes
macOS 10.15 (Catalina)System Preferences, Network, Advanced, ProxiesClassic interface
macOS 11-12 (Big Sur / Monterey)System Preferences, Network, Advanced, ProxiesSlightly adjusted UI
macOS 13+ (Ventura and later)System Settings, Network, Details, ProxiesNewer Settings interface

The core configuration options and the way you enter proxy information remain the same across all versions. If your version differs from the example, follow the corresponding navigation path.

Security Tips

  1. Avoid using unencrypted HTTP proxies on public WiFi networks
  2. Prefer proxies with username and password authentication over open (anonymous) proxies
  3. After setting terminal proxy, avoid running commands that involve sensitive information in the same session
  4. Regularly review your no_proxy settings to ensure local traffic does not accidentally route through the proxy
  5. Clear environment variables with unset or disable system proxy when it is no longer needed
  • Android proxy setup guide (2025)
  • Windows system proxy setup guide (2025)
  • Linux terminal proxy setup guide (2025)

Need an enterprise proxy plan?

We can tailor architecture to your target domains, concurrency, and reliability goals.