Arch Linux Repository


It’s extremely convenient to have self-hosted repository for your own packages and deliver it to your machines.


  • Ubuntu Server with Nginx and Docker

Creating repository

Repository database is managed via repo-add script bundled with Arch Linux pacman package manager. Since pacman is not available in Ubuntu repository I use docker archlinux image for managing repository. This guide assumes that repository located in /srv/arch-repo. First of all move all your packages into /srv/arch-repo. Following command will create or update repository database.
docker run -v ${REPO_PATH}:/repo --rm archlinux \
bash -c "repo-add /repo/${REPO_URL}.db.tar.gz /repo/*pkg.tar.zst"

Important aspect

Name of the database should be REPO_URL.db.tar.gz, in this case REPO_URL is

Sharing repository via HTTPS

Nginx config. (See how to setup Nginx)

server {
    listen [::]:443 ssl;
    listen 443 ssl;
    include security.conf;
    include letsencrypt.conf;
    root /srv/arch-repo;
    location / {
        autoindex on;
        try_files $uri $uri/ =404;
    access_log /var/log/nginx/logs/ custom;
    error_log /var/log/nginx/logs/;

Configure repo on yours machines

Add your repo to /etc/pacman.conf:

Server =

Periodically database update

I use systemd timer for that. Service:

Description=Updating arch linux repository database for %I

ExecStart=/usr/bin/docker run -v /srv/arch-repo:/repo --rm archlinux bash -c "repo-add /repo/%i.db.tar.gz /repo/*pkg.tar.zst"



Description=Schedule arch repo database update for %I

# every 15 minutes


Activate timer:
systemctl enable [email protected]${REPO_URL}.timer

Leave a Reply

Your email address will not be published.