Home

Awesome

Anki Sync Server with Docker

<img title="" src="ac_header.png" alt="Easy-to-use container configurations brought to you by Anki Community" width="898" data-align="center">

Repository contents

ServicesDescription
djankiservAn self-hosted Anki server with a complete API.
anki-sync-serverAn self-hosted Anki server with basic Sync functionality.
<p><sup>*Instructions: these notes describe the options of the particular setup. For a generic tutorial on how to use Docker, you may follow [our guide for beginners at ankicommunity.github.io](https://ankicommunity.github.io/Tutorials/Docker/Howto/).</sup></p>

Configuration files

You may find various files under the config/ directory:

Community support

For detailed tutorials and news, visit us at ankicommunity.github.io!

We're also happy to help you on Gitter.

Limitation of responsibility

<p><sup>*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*</sup></p>

Tested and works on

DateAnkiDesktop versionAnkiDroid versionankisyncd versionTester
2020-02-062.1.192.9.12.1.0 + 2bfccf7fkuklinistvan

Learn more about what "tested" means here.

About this Docker image

An example setup with docker-compose:

version: "3"

services:
    anki-container:
        image: kuklinistvan/anki-sync-server:latest
        container_name: anki-container

        restart: always
        ports:
        - "27701:27701"
        volumes:
        - data:/app/data

volumes:
data:

Rebuilding the image

First to clone the repository and update the anki-sync-server:

git clone https://github.com/ankicommunity/docker-anki-sync-server
cd docker-anki-sync-server
git submodule update --init --recursive

Then apply the following patch to anki-sync-server/Docker/anki-sync-server:

diff --git a/src/requirements.txt b/src/requirements.txt
index 77ba117346c8..f78905c62e23 100644
--- a/src/requirements.txt
+++ b/src/requirements.txt
@@ -1,8 +1,5 @@
-THE FILE WAS GENERATED BY POETRY, DO NOT EDIT!
-
-Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.
-anki==2.1.36; python_version >= "3.7"
-ankirspy==2.1.36; python_version >= "3.7"
+anki==2.1.35; python_version >= "3.7"
+ankirspy==2.1.35; python_version >= "3.7"
 beautifulsoup4==4.9.1
 certifi==2020.6.20; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
 chardet==3.0.4; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"

Enter the Docker directory and alter build.sh to suit your use case. Run it to build the image on the current platform.

cd Docker
vi build.sh
./build.sh

Tested client downloads

MainMirrorSizeSHA256
AnkiDesktop for GNU/Linux2.1.192.1.19127.7 MBada59237b8b3774712d6309821db4b6cb1d2c625284302aa09bc7313ada76fc0
AnkiDroid APK for Android2.9.12.9.110.7 MB511ef65b8dcb65a7f99f9942c4fcee5134f137ce23c677cf1ea3b26c7c3f34c5
AnkiDesktop for Windows2.1.192.1.1997,3 MB90be6a3e5a6f4373ba3342bd3dfbe61e9013bb2a4acced2fcdd594b4c651a665
AnkiDesktop for Mac OS X2.1.192.1.19127,5 MB9be3e3bdf884f865e15f308e72b1ed0213c061d27102f80d01897d5355eef8e7

Administration interface is reachable through the container shell

# docker exec -it anki-container /bin/sh
/app/anki-sync-server # ./ankisyncctl.py --help
usage: ./ankisyncctl.py <command> [<args>]

Commands:
  adduser <username> - add a new user
  deluser <username> - delete a user
  lsuser             - list users
  passwd <username>  - change password of a user
/app/anki-sync-server # ./ankisyncctl.py adduser kuklinistvan
Enter password for kuklinistvan:
/app/anki-sync-server #

Does not work? Submit an issue!

I highly encourage you contacting me if you feel it is "broken again" - it frustrates me too and I'd like to take the effort to fix the bugs on my side.

Even if it is not a bug but rather something to be clarified, I'm happy to answer questions (if I can), so if you have one, just submit an issue.