-
-
Notifications
You must be signed in to change notification settings - Fork 3
Linux Proxy Servers
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to proxy servers on Linux, covering Arch Linux, CachyOS, and other distributions including Squid, and proxy server configuration.
Install Squid:
# Arch/CachyOS
sudo pacman -S squid
# Debian/Ubuntu
sudo apt install squid
# Fedora
sudo dnf install squidEdit config:
# Edit config
sudo vim /etc/squid/squid.confBasic settings:
# HTTP port
http_port 3128
# Allow local network
acl localnet src 192.168.0.0/16
http_access allow localnet
# Deny all others
http_access deny all
Start Squid:
# Enable service
sudo systemctl enable squid
# Start service
sudo systemctl start squid
# Check status
systemctl status squidConfigure ACLs:
# Edit config
sudo vim /etc/squid/squid.confAdd ACLs:
# Define networks
acl localnet src 192.168.0.0/16
acl worknet src 10.0.0.0/8
# Allow access
http_access allow localnet
http_access allow worknet
http_access deny all
Configure cache:
# Edit config
sudo vim /etc/squid/squid.confCache settings:
# Cache directory
cache_dir ufs /var/cache/squid 100 16 256
# Cache size (MB)
cache_mem 256 MB
# Maximum object size
maximum_object_size 10 MB
Configure browser:
- Open browser settings
- Network settings → Proxy
- Manual proxy configuration
- Enter: Proxy IP and port (3128)
Using environment variables:
# Set proxy
export http_proxy=http://proxy-server:3128
export https_proxy=http://proxy-server:3128
export no_proxy=localhost,127.0.0.1
# Make permanent
echo 'export http_proxy=http://proxy-server:3128' >> ~/.bashrcCheck logs:
# Check Squid logs
sudo journalctl -u squid
# Check access logs
sudo tail -f /var/log/squid/access.log
# Check cache logs
sudo tail -f /var/log/squid/cache.logTest connection:
# Test proxy
curl -x http://localhost:3128 http://example.com
# Test with environment
http_proxy=http://localhost:3128 curl http://example.comThis guide covered proxy servers for Arch Linux, CachyOS, and other distributions, including Squid setup, configuration, and troubleshooting.
- Networking - Network setup
- Web Servers - Web servers
- ArchWiki Proxy: https://wiki.archlinux.org/title/Proxy_server
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.