Self-hosted MTG card inventory server with multi-account support, collection tracking, deck building, statistics, and import/export. Built with FastAPI and React, deployable in minutes with Docker.
- Collection Management — Add cards by name with fuzzy Scryfall search, track quantity, condition, foil, language, price, and set printing
- Deck Builder — Build decks with mainboard, sideboard, and commander zones; export to Moxfield or JSON
- Statistics — Visual breakdowns of your collection by rarity, color, type, condition, set, and estimated value
- Price Tracking — Automatic price refreshes from Scryfall with configurable intervals and rate limiting
- Multi-Account — Admin-managed user accounts; each user has their own isolated collection
- Import / Export — Export collections and decks in multiple formats
- Quick Add — Fast card entry with live Scryfall lookup and set picker
| Layer | Technology |
|---|---|
| Backend | Python 3.12, FastAPI, SQLAlchemy, Alembic |
| Frontend | React, Vite, TanStack Query |
| Database | PostgreSQL 16 |
| Reverse Proxy | Nginx |
| Container | Docker + Docker Compose |
- Docker and Docker Compose
git clone 'https://github.com/DredBaron/OpenMTG'Copy the example and fill in your values:
cp .env.example .envEdit .env:
POSTGRES_DB=openmtg
POSTGRES_USER=openmtg
DB_PASSWORD=your_secure_password_here
JWT_SECRET=your_long_random_secret_here
DATA_PATH=./data
CONFIG_PATH=./configTip: Generate a strong JWT secret with
openssl rand -hex 32
docker compose up -dOpenMTG will be available at http://localhost:8080
On first launch you will be prompted to create an admin account. After that, only admins can create additional user accounts.
docker compose pull
docker compose up -dDatabase migrations run automatically on startup.
All configuration is done via the .env file or the admin Settings panel in the UI.
| Variable | Description | Default |
|---|---|---|
POSTGRES_DB |
Database name | openmtg |
POSTGRES_USER |
Database user | openmtg |
DB_PASSWORD |
Database password | (required) |
JWT_SECRET |
Secret key for auth tokens | (required) |
DATA_PATH |
Path for PostgreSQL data volume | ./data |
CONFIG_PATH |
Path for app config volume | ./config |
| Setting | Description | Default |
|---|---|---|
| Auto-refresh interval | How often stale prices are refreshed | 72 hours |
| Scryfall rate limit | API requests per second | 1 req/s |
By default, OpenMTG listens on port 8080. To change it, edit the nginx service in docker-compose.yml:
ports:
- "YOUR_PORT:80"git clone https://github.com/dredbaron/OpenMTG.git
cd OpenMTG
cp .env.example .env
# edit .env with your values
docker compose up -d --buildGNU Affero General Public License v3.0
You are free to use, modify, and self-host OpenMTG. If you distribute a modified version or run it as a network service, you must make your source code available under the same license.
Card data and pricing provided by Scryfall. Please respect their API guidelines and rate limits.
Small portions of this project were written with the assistance of AI tools, specifically Claude by Anthropic. All code has been reviewed, tested, and is understood by the project author. AI assistance was used as a framework development aid, not as a replacement for understanding the codebase.