Set up Pacman cache for multiple machines using Pacoloco
2026-05-11
In today's post we will set up a mirror cache for Pacman using pacoloco. I decided to use Docker for that, thankfully the developer of the tool provides an official docker container which we can use directly using something like the following docker compose file:
services:
pacoloco:
image: ghcr.io/anatol/pacoloco
ports:
- "9129:9129"
volumes:
- cache:/var/cache/pacoloco
- ./pacoloco.yaml:/etc/pacoloco.yaml
restart: unless-stopped
environment:
- TZ=Atlantic/Reykjavik
volumes:
cache:
What remains is to provide a config file (pacoloco.yaml) that we just referenced in the compose file. The config also uses yaml syntax and this should be a good starting point :) (here I used the worldwide CDN mirrors, you can use any Arch mirror you like).
port: 9129
cache_dir: /var/cache/pacoloco
purge_files_after: 360000 # 360000 seconds or 100 hours, 0 to disable
download_timeout: 3600 # download will timeout after 3600 seconds
repos:
archlinux:
urls:
- https://fastly.mirror.pkgbuild.com/
- https://geo.mirror.pkgbuild.com/
- https://ftpmirror.infania.net/mirror/archlinux/
- http://mirror.rackspace.com/archlinux/
- https://mirror.rackspace.com/archlinux/
user_agent: Pacoloco/1.2
Now when the service is running the only thing you need to do is to point Pacman to actually use it. Pacoloco behaves just like any other mirror for pacman so it is enough to put something along the lines of
Server = http://PACOLOCO_IP_ADDRESS:9129/repo/archlinux/$repo/os/$arch
to the top of /etc/pacman.d/mirrorlist and you're done! Now updating multiple machines at the same time will be much faster. Have fun with Arch!