Featured image of post setup Squid proxy with docker

setup Squid proxy with docker

I use proxies very often as a way to do split tunneling on Linux, as easy split-tunneling with WireGuard or OpenVPN isn’t there yet.

The quickest way to set up anything IMO is with docker, and here is a quick guide for squid proxy setup using the official Ubuntu-squid image, which seems to be the only up-to-date docker image on Docker hub.

docker-compose.yml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
version: "3"
services:
  proxy:
    image: ubuntu/squid
    ports:
      - "3128:3128"
    environment:
      - TZ=UTC
    volumes:
      - ./squid.conf:/etc/squid/squid.conf
    configs:
      - source: squid
        target: /etc/squid/squid.conf

  configs:
    squid:
      file: ./squid.conf

I used configs to prevent any permission issues popping up.

squid.conf

1
2
http_port 3128
http_access allow all

This is a simple setup for a local transparent proxy, it allows all connections, and it doesn’t cache or log anything.

sources

https://medium.com/setup-a-web-proxy-server-with-docker-d5c6942b5575

https://hub.docker.com/r/ubuntu/squid

FarisZR
Built with Hugo
Theme Stack designed by Jimmy