Install
Pick the way that suits you. All three give the same app.
Windows
- Download
magic-db.exefrom the latest release and put it in a folder of its own, for exampleC:\magic-db. - Double-click it. Windows may show a blue “Windows protected your PC” box, because the program is not signed: choose More info, then Run anyway.
- Your browser opens on
http://127.0.0.1:8080. The first start downloads the card catalog (about 80 MB) and builds it: a few minutes, with progress shown on the page.
Everything AMTG writes goes in a data folder next to the program. To stop it, close its window.
Updating: open Administration. When a newer version is out it says so, and one button downloads it, checks it, swaps it in and restarts. Your data folder is kept.
Reaching it from your phone: start it listening on your network, for example from a start.bat file:
set MAGICDB_HOST=0.0.0.0
magic-db.exe
Then open http://<the PC's address>:8080 on the phone.
Docker
curl -O https://raw.githubusercontent.com/ac-me-git/magic-db/main/compose.yaml
docker compose up -d
Open http://localhost:8080. Data lives in the magic-db-data volume. Set TZ in compose.yaml to your time zone, so the nightly jobs run at night for you.
Updating: docker compose pull, then docker compose up -d.
Trying what is not released yet: in compose.yaml write magic-db:edge instead of magic-db:latest, then pull and up as above. edge is rebuilt at every change to the program: newer and less tried than a release; the Administration page says that it is the development version. Make a backup first (Administration). To go back, write latest again, pull and up.
From source
You need uv (or Python 3.12+ with pip).
git clone https://github.com/ac-me-git/magic-db.git
cd magic-db
uv sync
uv run magicdb
Configuration
Everything is optional and set with environment variables.
| Variable | Default | Meaning |
|---|---|---|
MAGICDB_DATA_DIR | ./data (Docker: /data) | Where the catalog, collection, cached images and backups are kept |
MAGICDB_BACKUP_DIR | <data>/backups | Where backups are written. Point it at a folder that is itself backed up or synced |
MAGICDB_HOST | 127.0.0.1 (Docker: 0.0.0.0) | Address to listen on. 0.0.0.0 makes it reachable from other devices |
MAGICDB_PORT | 8080 | Port to listen on |
MAGICDB_PASSWORD | none | If set, every page asks for it (HTTP Basic: any user name, this password) |
MAGICDB_UPDATE_HOUR | 3 | Hour of the nightly catalog update, 0–23, local time |
MAGICDB_BACKUP_HOUR | 4 | Hour of the nightly backup, 0–23, local time |
MAGICDB_LANG | en | Default interface language (en or it) |
MAGICDB_CURRENCY | eur | eur or usd, for prices and values |
MAGICDB_SCHEDULER | on | off stops the automatic nightly update and backup |
MAGICDB_UPDATE_CHECK | on | off stops the Administration page from asking GitHub for a newer version |
Reaching it from outside your home
AMTG is meant for one household. Do not put it on the open internet as it is. Put something in front of it that decides who gets in: a VPN such as Tailscale or WireGuard, or an access gateway such as Cloudflare Access. At the very least, set MAGICDB_PASSWORD and serve it over HTTPS through a reverse proxy.
Behind a reverse proxy, pass the public host name to the app (Host or X-Forwarded-Host): AMTG refuses changes that do not come from its own pages, and recognises its own pages by that name. The safety lock is not access control; it stops accidents, not people.
Limits
- Card names, text and images are in English. A copy in another language is recorded on the English printing, with its language as an attribute.
- Prices are the latest from Scryfall (Cardmarket for euro, TCGplayer for dollars); there is no price history.
- One collection per installation; no user accounts.
- A physical deck box is a location; a deck is a list. Putting a card in a deck list does not move it.