This repository provides an automated, multi-architecture Docker build for the Anki Official Synchronization Server. This server allows Anki users to host their flashcard synchronization data privately, offering an alternative to the official AnkiWeb server.
The image is automatically built based on the latest stable Anki Git tag from the official ankitects/anki repository, ensuring you always run the most recent code.
linux/amd64 and linux/arm64 architectures (using Buildx/QEMU), ideal for running on Raspberry Pi, Apple Silicon servers, or standard cloud environments.Before running the server, you need to create a persistent volume or directory for the server's data (user profiles, database).
mkdir -p /path/to/your/anki/data
Use the following command to pull and run the container. Replace /path/to/your/anki/data with the host directory you created.
docker run -d \
--name anki-sync \
-p 8080:8080 \
-v /path/to/your/anki/data:/anki_data \
maogxer/anki-sync-server:latest
Create a docker-compose.yml file:
services:
anki-sync:
image: maogxer/anki-sync-server:latest
container_name: anki-sync
ports:
- "8080:8080"
volumes:
# Mount the data directory for persistence
- /path/to/your/anki/data:/anki_data
restart: always
docker compose up -d
Your server is configured with pre-defined users via the SYNC_USER1 (and optional SYNC_USER2, etc.) environment variables set during the Docker run command.
To successfully connect your Anki client to the self-hosted server, you must modify the synchronization settings within the client application.
If you encounter frequent synchronization interruptions on AnkiDroid (e.g., due to screen lock or sleep mode), it is mandatory to apply the following battery optimization fix:
Go to Android Settings > Apps > AnkiDroid > Battery.
Set AnkiDroid's battery usage permission to "Unrestricted" or "Allow Optimization" (the exact wording varies by manufacturer, but the goal is to prevent the OS from restricting the app's network activity).
This repository uses two main tags:
| Tag Name | Description |
|---|---|
latest | The image built from the most recent stable Anki Git tag. |
25.09.2 (Example) | Specific version tags corresponding to the official Anki release (e.g., maogxer/anki-sync-server:25.09.2). |
Content type
Image
Digest
sha256:0cc2e34d2…
Size
11.5 MB
Last updated
23 days ago
docker pull maogxer/anki-sync-server