UI APT Mirror - A containerized solution with UI

Notes on a containerized APT mirror I built for working offline: deb packages, an npm cache, and file hosting with a web UI.

#Linux#Docker#Homelab

I built this because the power often goes out where I live. Every time it did, I lost a workday. I wanted one box that kept serving deb packages, npm packages, and a lot of files even with no internet, and light enough to not eat the whole machine.

What it does

UI APT Mirror is a container that works as a small offline development environment. It mirrors Ubuntu/Debian packages, can cache npm, hosts files (with video and audio streaming), and serves a few developer cheatsheets. You can reach everything through a web interface.

The APT mirror keeps a local Ubuntu/Debian repository in sync by itself. The npm proxy is optional; turn it on and you get a local registry cache, which also speeds up installs on a slow connection. File hosting comes with a browser file manager that streams video and audio instead of making you download the file first. The admin panel is for monitoring, and the cheatsheets are there for when you can't reach the docs you'd normally look up online. The image runs on both ARM64 and AMD64.

On the first run, the setup script asks for a few things: the domain (default mirror.intra), how often to sync, an admin password, and whether you want the npm proxy.

Using the mirror

Once it is running, each part has its own subdomain:

  • http://mirror.intra - browse and download packages
  • http://admin.mirror.intra - admin panel for monitoring
  • http://files.mirror.intra - file hosting with media streaming
  • http://cheatsheets.mirror.intra - developer command references
  • http://npm.mirror.intra - npm proxy, if you enabled it

To point a machine at the APT mirror, add this to /etc/apt/sources.list:

deb http://mirror.intra/archive.ubuntu.com/ubuntu noble main restricted universe multiverse
Installation

Get the setup script from the project site:

  1. Visit ui-apt-mirror.dbashkatov.com
  2. Download the setup script
  3. Make it executable and run it:
./install.sh

The script goes through the configuration questions above and starts everything. One thing I learned from experience: give it enough disk space before you start the first sync. A full Ubuntu mirror is large. If the volume fills up, the sync stops halfway, and you have to start over.

Source is on GitHub.