- Docker and Docker Compose installed
- SSH access to your server (if running remotely)
- Clone this repository and navigate to the directory:
git clone https://github.com/Yukaii/gakuon.git
cd gakuon
-
If you plan to use Anki's built-in sync service (recommended for first-time setup), you'll need to configure X11 forwarding:
a. Either:
-
Add these lines to your SSH config (
~/.ssh/config
):ForwardX11 yes ForwardX11Trusted yes
-
Or use the
-X
flag when connecting via SSH:ssh -X user@your-server
b. Prepare X11 authentication:
cp ~/.Xauthority /tmp/container-xauth chmod 644 /tmp/container-xauth
c. Edit
docker-compose.yml
and uncomment these lines:# - /tmp/container-xauth:/home/anki/.Xauthority:rw # environment: # - DISPLAY=${DISPLAY} # - QT_QPA_PLATFORM=xcb # - XAUTHORITY=/home/anki/.Xauthority # network_mode: host
-
-
Start the services:
docker compose up -d
-
For first-time setup with GUI:
- The Anki window should appear
- Create a new profile if needed
- Go to Tools -> Add-ons to verify AnkiConnect is installed
- Set up your AnkiWeb account in Tools -> Preferences -> Network
- Sync your collection
-
After initial setup is complete:
- Stop the containers:
docker compose down
- Comment out the X11 forwarding lines in docker-compose.yml
- Restart the containers:
docker compose up -d
- Stop the containers:
Once initial setup is complete, you can access:
- Gakuon web interface at
http://localhost:4989
- AnkiConnect API at
http://localhost:8765
Your Anki data will persist in Docker volumes between restarts.
If you encounter permission issues:
- Ensure X11 forwarding is properly configured in your SSH session
- Check that
/tmp/container-xauth
has the correct permissions (644) - Verify your DISPLAY environment variable is set correctly