Setting up an Arch Linux mirror (2026)
Ever get annoyed by slow download speeds because mirrors near you are shit? And you’ve got a homeserver or VPS just sitting there?
Yeah, me too. So let’s set up your own Arch mirror.
Getting the mirror files
First thing you gonna do is make a directory for it:
mkdir -p /var/www/mirrors/archlinux/
Now you gonna want to grab a tier 1 mirror (since others suck) from https://archlinux.org/mirrors/tier/1/
Pick one and run this:
rsync -rlptH --safe-links --delete-delay --delay-updates rsync://your-mirror-here/archlinux/ /var/www/mirrors/archlinux/
This gonna take a while depending on your connection. Full mirror is like 70-80GB so grab coffee or something.
Cool! Now we got a copy of Arch. But you need to keep it synced right? Add this to your crontab (syncs every 6 hours):
0 */6 * * * rsync -rlptH --safe-links --delete-delay --delay-updates rsync://your-mirror-here/archlinux/ /var/www/mirrors/archlinux/
Nginx setup
Now for the webserver part. I use nginx so here’s my config. Make or edit /etc/nginx/sites-available/mirror.example.com:
server {
listen 80;
listen [::]:80;
server_name mirror.example.com;
root /var/www/mirrors;
location / {
try_files $uri $uri/ =404;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name mirror.example.com;
root /var/www/mirrors;
location / {
try_files $uri $uri/ =404;
}
ssl_prefer_server_ciphers off;
ssl_certificate /etc/letsencrypt/live/mirror.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mirror.example.com/privkey.pem;
}
Enable the site:
ln -s /etc/nginx/sites-available/mirror.example.com /etc/nginx/sites-enabled/mirror.example.com
Test if config is right:
nginx -t
And reload nginx:
sudo systemctl reload nginx
Using your mirror
Done! Now just point your /etc/pacman.d/mirrorlist to your mirror:
Server = https://mirror.example.com/archlinux/$repo/os/$arch
Enjoy your stay! See you later!