Before you start
Gather your proxy's host, port, protocol (HTTP or SOCKS5) and credentials. Proxy settings on macOS are configured per network service (Wi-Fi, Ethernet), so set them on the connection you actually use.
macOS System Settings (Ventura and later)
- Open System Settings → Network.
- Select your connection (for example Wi-Fi) and click Details… next to the network you're connected to.
- Choose Proxies in the sidebar.
- Enable the protocol(s) you need:
- Web proxy (HTTP) for HTTP traffic.
- Secure web proxy (HTTPS) for HTTPS traffic. With most commercial proxies, use the same HTTP proxy host and port here.
- SOCKS proxy for SOCKS.
- Enter the server and port. If the proxy needs credentials, enable Proxy server requires password and enter them.
- Add hosts to Bypass proxy settings for these hosts & domains if needed.
- Click OK.
On older macOS versions the path is System Preferences → Network → Advanced… → Proxies.
Automatic proxy configuration (PAC)
In the same Proxies panel, enable Automatic proxy configuration and enter the PAC URL. See proxy PAC files.
Command line: networksetup
networksetup configures the same settings from Terminal:
networksetup -listallnetworkservices
networksetup -setwebproxy "Wi-Fi" gate.example.com 7777 on USER PASS
networksetup -setsecurewebproxy "Wi-Fi" gate.example.com 7777 on USER PASS
networksetup -setsocksfirewallproxy "Wi-Fi" socks.example.com 1080
networksetup -setproxybypassdomains "Wi-Fi" localhost 127.0.0.1 "*.local"
networksetup -getwebproxy "Wi-Fi"
networksetup -setwebproxystate "Wi-Fi" off
networksetup -setsecurewebproxystate "Wi-Fi" offThese commands may need administrator privileges.
Which apps use the macOS proxy?
- Safari and Chrome use system proxy settings.
- Firefox has its own settings but can use the system ones. See browser proxy settings.
- Many apps respect system settings; some don't.
- Terminal tools use environment variables.
Terminal environment variables
export https_proxy="http://USER:PASS@gate.example.com:7777"
export http_proxy="$https_proxy"
export no_proxy="localhost,127.0.0.1"
curl https://api.ipify.orgAdd them to ~/.zshrc to make them persistent. See curl proxy.
Verify
Check your IP in a browser or with curl https://api.ipify.org. See how to check if a proxy works.
Proxy tip: If you need a working proxy to test these steps with, Geonode generates endpoints in host:port:username:password format, supports IP whitelisting, and has a Chrome extension for quick switching. See using Geonode in your browser.
Troubleshooting
| Problem | Fix |
|---|---|
| Proxy ignored | Configure the active network service (Wi-Fi vs Ethernet) |
| Password prompts | Enable "requires password" and save credentials, or use IP whitelisting |
| Local devices unreachable | Add them to the bypass list |
| Terminal ignores system proxy | Set environment variables |
See common proxy errors.
Per-app proxies on macOS
If you only want certain apps to use a proxy, avoid system settings and configure apps directly:
- Firefox: its own Network Settings. See browser proxy settings.
- Chrome: launch with
--proxy-serverand a separate profile. - Terminal tools: environment variables in that shell only.
- Developer tools: many (git, npm, pip) have their own proxy configuration.
Examples:
git config --global http.proxy http://USER:PASS@gate.example.com:7777
npm config set proxy http://USER:PASS@gate.example.com:7777
npm config set https-proxy http://USER:PASS@gate.example.com:7777
pip install --proxy http://USER:PASS@gate.example.com:7777 requestsRemove them when you're done (git config --global --unset http.proxy, npm config delete proxy).
Switching quickly between proxy setups
macOS Locations (in older macOS versions, under Network) let you save different network configurations, for example "Office" with a corporate proxy and "Home" without. In newer macOS versions, networksetup scripts or third-party tools can toggle settings quickly:
#!/bin/zsh
# proxy-on.sh
networksetup -setwebproxy "Wi-Fi" gate.example.com 7777 on USER PASS
networksetup -setsecurewebproxy "Wi-Fi" gate.example.com 7777 on USER PASS#!/bin/zsh
# proxy-off.sh
networksetup -setwebproxystate "Wi-Fi" off
networksetup -setsecurewebproxystate "Wi-Fi" offVerifying which apps use the proxy
Run curl https://api.ipify.org in Terminal (uses env vars, not system settings), then check your IP in Safari (uses system settings). Different results tell you which layer is configured. See how to check if a proxy works.
Common macOS gotchas
| Issue | Explanation |
|---|---|
| Proxy works on Wi-Fi, not Ethernet | Settings are per network service |
| Some apps ignore the proxy | They don't read system settings |
| Credentials prompts in every app | Some apps don't use the saved password |
| Local services break | Add them to the bypass list |
| VPN apps override proxy settings | Disconnect the VPN or configure it to allow the proxy |
For Windows instructions, see proxy setup on Windows.
Using a SOCKS5 proxy system-wide on macOS
The SOCKS proxy setting in macOS applies to apps that honour system SOCKS settings. For a quick SOCKS5 proxy through your own server:
ssh -N -D 1080 user@your-server
networksetup -setsocksfirewallproxy "Wi-Fi" 127.0.0.1 1080Turn it off with networksetup -setsocksfirewallproxystate "Wi-Fi" off. See SOCKS5 proxies and self-hosted Squid proxy.
Checking what macOS is actually using
System Settings shows the configuration for each network service, but it's not always obvious which one is in effect. scutil prints the proxy configuration macOS is actually applying right now:
scutil --proxyLook for HTTPEnable, HTTPSEnable and SOCKSEnable (1 means on), the matching proxy host and port entries, ProxyAutoConfigURLString if a PAC file is set, and ExceptionsList for bypassed hosts.
Common surprises this reveals:
- The wrong network service. Proxy settings are per service. If you configured Wi-Fi but you're on Ethernet or a USB adapter, nothing applies.
- A PAC file you forgot about, which overrides what you expected.
- A configuration profile. On managed Macs, a device management profile can set proxies. Check the Device Management or Profiles section of System Settings.
- Terminal variables.
scutilshows system settings only; runenv | grep -i proxyto see what command-line tools will use.
Apple's guide to changing proxy settings on Mac covers the System Settings side. For the bigger picture of which apps honour the system proxy, see the sections above, and for browsers in particular, browser proxy settings. If you're comparing behaviour with a Windows machine, see proxy setup on Windows.
Key takeaways
- macOS proxy settings are per network service (Wi-Fi, Ethernet), under System Settings → Network → Details → Proxies.
- Web, Secure Web and SOCKS proxies are configured separately; most commercial proxies use the same HTTP host and port for both web fields.
networksetupscripts let you switch proxies on and off from Terminal.- Terminal tools use environment variables, not system settings.
- For per-app proxying, configure Firefox, Chrome flags, git, npm or pip individually. See browser proxy settings.
FAQ
Does macOS support SOCKS5?
Yes, via the SOCKS proxy setting. Authentication support varies by app.
How do I disable the proxy?
Untick the proxy protocols in Network → Details → Proxies, or use networksetup -set...state off.
Editorial note: Proxy providers change their pools, features and prices often, so treat any figures here as typical ranges at the time of writing and confirm current terms with the provider before you buy.