Sign inSign up

chrislongros/anki-sync-server-enhanced

By chrislongros

•Updated about 23 hours ago

Image
1

10K+

chrislongros/anki-sync-server-enhanced repository overview

⁠Anki Sync Server Enhanced

Docker Hub GitHub Actions Anki Version

Production-ready Docker image for self-hosted Anki sync server with backups, monitoring, dashboard, and security features.

Dashboard

⁠Why This Image?

The official Anki project provides sync server source code but no pre-built Docker images. This project provides:

  • Zero build time - Pre-compiled for amd64, arm64, and arm/v7
  • Auto-updates - Daily builds automatically track the latest Anki release
  • Enterprise features - Backups, monitoring, alerts, and security out of the box
  • NAS-ready - Works on TrueNAS SCALE, Unraid, Synology, and any Docker host

⁠Features

FeatureThis Image
Pre-built Docker image✅
Auto-updates (daily builds)✅
Multi-arch (amd64, arm64, arm/v7)✅
Automated backups with retention✅
S3/MinIO backup upload✅
Prometheus metrics✅
Web dashboard✅
Discord/Telegram/Slack/Email alerts✅
Docker secrets support✅
Hashed passwords✅
Fail2ban integration✅
Rate limiting✅
Built-in TLS (Let's Encrypt/self-signed)✅
User management CLI✅
PUID/PGID support✅

⁠Quick Start

docker run -d \
  --name anki-sync \
  -p 8080:8080 \
  -e SYNC_USER1=user:password \
  -v anki_data:/data \
  chrislongros/anki-sync-server-enhanced:26.05

Then configure your Anki client to sync to http://your-server:8080/

⁠Docker Compose

services:
  anki-sync-server:
    image: chrislongros/anki-sync-server-enhanced:26.05
    container_name: anki-sync
    ports:
      - "8080:8080"   # Sync server (HTTP)
      - "8443:8443"   # Sync server (HTTPS, if TLS_ENABLED)
      - "8081:8081"   # Dashboard (optional)
      - "9090:9090"   # Metrics (optional)
    environment:
      - SYNC_USER1=alice:password1
      - SYNC_USER2=bob:password2
      - TZ=Europe/Berlin
      - BACKUP_ENABLED=true
      - METRICS_ENABLED=true
      - DASHBOARD_ENABLED=true
    volumes:
      - anki_data:/data
      - anki_backups:/backups
    restart: unless-stopped

volumes:
  anki_data:
  anki_backups:

⁠Web Dashboard

Enable with DASHBOARD_ENABLED=true and access at http://server:8081/

Features:

  • Overview - Server status, uptime, user count, data size, sync operations
  • Users - Per-user statistics with data size and last sync time
  • Backups - List backups, create new backups with one click
  • Logs - View sync, auth, and backup logs with color-coded entries
  • System - Disk usage, memory usage, load average

Protect with basic auth using DASHBOARD_AUTH=admin:password

⁠Configuration Reference

⁠Core
VariableDescriptionDefault
SYNC_USER1-SYNC_USER99User credentials (user:pass)Required
SYNC_HOSTListen address0.0.0.0
SYNC_PORTListen port8080
LOG_LEVELdebug/info/warn/errorinfo
TZTimezoneUTC
PUID / PGIDFile permissions1000
PASSWORDS_HASHEDSet to true to supply pbkdf2 password hashes instead of plain text (generate with user-manager.sh hash); leave unset otherwiseunset
⁠Backups
VariableDescriptionDefault
BACKUP_ENABLEDEnable backupsfalse
BACKUP_SCHEDULECron schedule0 3 * * *
BACKUP_RETENTION_DAYSKeep days7
⁠S3 Upload
VariableDescriptionDefault
S3_BACKUP_ENABLEDUpload to S3false
S3_ENDPOINTS3 endpoint (MinIO/Garage)-
S3_BUCKETBucket name-
S3_ACCESS_KEYAccess key-
S3_SECRET_KEYSecret key-
S3_REGIONRegionus-east-1
⁠Monitoring
VariableDescriptionDefault
METRICS_ENABLEDPrometheus metricsfalse
METRICS_PORTMetrics port9090
DASHBOARD_ENABLEDWeb dashboardfalse
DASHBOARD_PORTDashboard port8081
DASHBOARD_AUTHAuth (user:pass)-
⁠Notifications
VariableDescriptionDefault
NOTIFY_ENABLEDEnable webhooksfalse
NOTIFY_TYPEdiscord/telegram/slack/ntfydiscord
NOTIFY_WEBHOOK_URLWebhook URL-
EMAIL_ENABLEDEnable emailfalse
EMAIL_HOSTSMTP host-
EMAIL_PORTSMTP port587
EMAIL_USER / EMAIL_PASSSMTP credentials-
EMAIL_FROM / EMAIL_TOEmail addresses-
⁠Security
VariableDescriptionDefault
FAIL2BAN_ENABLEDEnable fail2banfalse
FAIL2BAN_MAX_RETRIESMax failures5
FAIL2BAN_BAN_TIMEBan seconds3600
⁠TLS / HTTPS

Built-in TLS support via Caddy reverse proxy. Three modes available:

VariableDescriptionDefault
TLS_ENABLEDEnable TLSfalse
TLS_PORTHTTPS port8443
TLS_DOMAINDomain for Let's Encrypt-
TLS_EMAILEmail for Let's Encrypt-
TLS_CERTPath to manual certificate-
TLS_KEYPath to manual private key-

Mode 1: Let's Encrypt (automatic)

docker run -d \
  -p 80:80 -p 443:443 \
  -e SYNC_USER1=user:password \
  -e TLS_ENABLED=true \
  -e TLS_DOMAIN=anki.yourdomain.com \
  -e [email protected] \
  -v anki_data:/data \
  -v anki_config:/config \
  chrislongros/anki-sync-server-enhanced:26.05

Mode 2: Manual certificates

docker run -d \
  -p 8443:8443 \
  -e SYNC_USER1=user:password \
  -e TLS_ENABLED=true \
  -e TLS_CERT=/config/certs/fullchain.pem \
  -e TLS_KEY=/config/certs/privkey.pem \
  -v ./certs:/config/certs:ro \
  -v anki_data:/data \
  chrislongros/anki-sync-server-enhanced:26.05

Mode 3: Self-signed (local/testing)

docker run -d \
  -p 8080:8080 -p 8443:8443 \
  -e SYNC_USER1=user:password \
  -e TLS_ENABLED=true \
  -v anki_data:/data \
  chrislongros/anki-sync-server-enhanced:26.05

Then configure clients to use https://your-server:8443/

Note: Self-signed certificates will show browser warnings. For local networks, you may prefer using HTTP or a proper certificate.

⁠CLI Tools

# User management
docker exec anki-sync user-manager.sh list
docker exec anki-sync user-manager.sh add john
docker exec anki-sync user-manager.sh add john mypassword
docker exec anki-sync user-manager.sh reset john newpass
docker exec anki-sync user-manager.sh hash mypassword
docker exec anki-sync user-manager.sh stats

# Backup management
docker exec anki-sync backup.sh
docker exec anki-sync restore.sh --list
docker exec anki-sync restore.sh --list-s3
docker exec anki-sync restore.sh backup_file.tar.gz
docker exec anki-sync restore.sh --s3 backup_file.tar.gz

⁠Client Configuration

⁠Desktop (Windows/Mac/Linux)
  1. Open Anki
  2. Go to Tools → Preferences → Syncing
  3. Set custom sync server to: http://your-server:8080/
  4. Click Sync and enter your credentials
⁠AnkiDroid (Android)
  1. Open AnkiDroid
  2. Go to Settings → Sync → Custom sync server
  3. Set sync URL: http://your-server:8080/
  4. Set media URL: http://your-server:8080/msync/
  5. Sync with your credentials
⁠AnkiMobile (iOS)
  1. Open AnkiMobile
  2. Go to Settings → Sync → Custom server
  3. Enter: http://your-server:8080/
  4. Sync with your credentials

Tip: Enable built-in TLS with TLS_ENABLED=true or use a reverse proxy (Traefik, Caddy, nginx) for secure remote access.

⁠Prometheus Metrics

Available at http://server:9090/metrics when METRICS_ENABLED=true:

MetricDescription
anki_sync_users_totalConfigured user count
anki_sync_data_bytesTotal data size
anki_sync_backup_countNumber of backups
anki_sync_uptime_secondsServer uptime
anki_sync_operations_totalTotal sync operations
anki_auth_success_totalSuccessful logins
anki_auth_failed_totalFailed logins

⁠Docker Secrets

For secure credential management:

services:
  anki-sync-server:
    image: chrislongros/anki-sync-server-enhanced:26.05
    environment:
      - SYNC_USER1_FILE=/run/secrets/anki_user1
    secrets:
      - anki_user1

secrets:
  anki_user1:
    file: ./secrets/user1.txt  # Contains: username:password

⁠Image Sources

RegistryImage
Docker Hubchrislongros/anki-sync-server-enhanced:26.05

⁠NAS Installation

⁠Troubleshooting

Can't connect to server:

  • Ensure port 8080 is exposed and not blocked by firewall
  • Check container logs: docker logs anki-sync
  • Verify the sync URL ends with / (e.g., http://server:8080/)

Sync fails with large collections:

  • If using a reverse proxy, increase client_max_body_size (nginx) or equivalent
  • Set MAX_SYNC_PAYLOAD_MEGS environment variable if needed

Authentication issues:

  • Ensure username doesn't contain special characters
  • Check auth log: docker exec anki-sync cat /var/log/anki/auth.log
  • Try resetting password: docker exec anki-sync user-manager.sh reset username newpassword

Dashboard not loading:

  • Ensure DASHBOARD_ENABLED=true is set
  • Check port 8081 is exposed
  • View logs: docker logs anki-sync | grep dashboard

⁠Building Locally

# Auto-detect latest Anki version
docker build -t anki-sync-server-enhanced .

# Specify Anki version
docker build --build-arg ANKI_VERSION=26.05 -t anki-sync-server-enhanced:26.05 .

⁠Credits

Built from the official Anki⁠ sync server by Ankitects.

⁠License

AGPL-3.0 - © 2026 Christos Longros - see LICENSE⁠

Tag summary

Content type

Image

Digest

sha256:195621423…

Size

266.7 MB

Last updated

about 23 hours ago

docker pull chrislongros/anki-sync-server-enhanced