Sign inSign up

maogxer/anki-sync-server

By maogxer

•Updated 23 days ago

Image
1

3.6K

maogxer/anki-sync-server repository overview

⁠⚓ Anki Sync Server (Multi-Arch)

Docker Pulls GitHub Workflow Status


⁠📖 Overview

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.

⁠✨ Features
  • Multi-Architecture Support: Images are built for both linux/amd64 and linux/arm64 architectures (using Buildx/QEMU), ideal for running on Raspberry Pi, Apple Silicon servers, or standard cloud environments.
  • Automated Updates: A GitHub Actions workflow automatically checks for new stable Anki releases and pushes updated images to Docker Hub.
  • Dependencies Fixed: The build process automatically updates the outdated Rust version in the official Anki Dockerfile to ensure successful compilation.

⁠🚀 How to Use

⁠Requirements

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
⁠Running with Docker CLI

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

⁠🔑 Configuration

⁠📱 Anki Client Configuration

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.

⁠1. Anki Desktop
  • Go to Tools > Preferences.
  • Navigate to the Syncing tab.
  • Fill in the Self-hosted sync server field.
  • Enter the server address and port, for example: http://[Your Server IP]:8080.
⁠2. AnkiDroid (Android)
  • Go to Settings > Sync.
  • Find Custom Sync Server.
  • In the Sync URL field, enter: http://[Your Server IP]:8080/
  • Return to the synchronization screen and enter the username and password you set in the Docker environment variables.
⁠⚠️ Important Note: Solving Sync Interruption Issues

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).


⁠🏷️ Tags

This repository uses two main tags:

Tag NameDescription
latestThe 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).

Tag summary

Content type

Image

Digest

sha256:0cc2e34d2…

Size

11.5 MB

Last updated

23 days ago

docker pull maogxer/anki-sync-server