How to use self hosted anki server on Linux and Windows Anki Client

Hi Anki Community

I’ve just created a anki sync server using docker (locally). How can I authenticate to the server locally in my network to sync my decks and view them on tablet and notebook. Can someone help me to setup the self-hosted sync server on desktop and mobile client (Images are welcome).

Greedings

From your post I can’t tell whether you’ve read the instructions in the manual – specifically about “Client Setup.” Sync Server - Anki Manual

2 Likes

@Danika_Dakika Thanks for the reply! I have read the manual. But how can I enter the credentials to log in to the sync server. A login prompt is not displayed.

Once you’ve pointed your client at the sync server, can you use the standard syncing login steps (also in the manual)?

Can you send me some screenshot please. I’m questioned

This is my configuration:

Server

docker-compose.yml
Screenshot 2024-09-11 194142

Dockerfile:
Screenshot 2024-09-11 194231

.env:
Screenshot 2024-09-11 194320

Client

.bashrc

USER1=username1:password

Anki:

Could you help me?

I can’t help you with any of the sync-server setup. The manual has all the answers for that. But you seem to be asking – “it’s set up, so what now?”

What happens when you click Sync? Or when you try to add “AnkiWeb” log-in information in Preferences? That’s how you cause an initial sync in Anki.

image

image

Did you know that there is an example Dockerfile for Self-Hosted Sync Server in Anki’s GitHub repository? If you haven’t tried it yet, you might want to give it a try first.

Here is a screencast of me trying out the Dockerfile in the repository. (Incidentally, this is my first time trying out the Self-Hosted Sync Server feature.)

The compose.yaml used in the video is below. I am not familiar with Docker at all, so there may be a more appropriate way to write compose.yaml.

compose.yaml

services:
  anki-sync-server:
    container_name: anki-sync-server
    build:
      context: .
      args:
        ANKI_VERSION: 24.06.3
    tty: true
    environment:
      - SYNC_USER1=username:password
      - SYNC_BASE=/.syncserver
    volumes:
      - ./.syncserver:/.syncserver
    ports:
      - "8080:8080"

Just FYI, when posting code, commands, or configuration files (like Dockerfile or docker-compose.yml), it’s generally more helpful to paste them as text rather than screenshots. This way, it’s easier for others to copy, test, and provide accurate answers. Plus, text can be searched, which is a huge benefit for anyone looking at the thread in the future.

For more tips on how to ask technical questions effectively, you might find Stack Overflow’s How to create a Minimal, Reproducible Example page useful.

5 Likes

Thanks a lot for your time and effort! It helps me a lot.I don’t realised to time in the credentials in the normal Login frame. Thanks again!

2 Likes