---
title: "Deploy Anki Sync Server"
description: "Official Anki flashcard sync server: decks and media on your own volume"
category: "Other"
url: https://railway.com/deploy/anki-sync-server-1
---

# Deploy Anki Sync Server

Official Anki flashcard sync server: decks and media on your own volume

**[Deploy Anki Sync Server on Railway](https://railway.com/template/anki-sync-server-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/anki-sync-server-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Other

## Template content

### Anki Sync Server https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/anki.png

- **Source:** https://github.com/aalfath/anki-sync-server-railway-template
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host Anki Sync Server on Railway

Anki Sync Server is the official self-hosted sync server from Ankitects, the makers of the Anki flashcard app. It keeps your decks, review history and media in step between Anki Desktop, AnkiDroid and AnkiMobile, the same way AnkiWeb does, but on a server you control.

## About Hosting Anki Sync Server

This template builds Anki 26.09.4's sync server from our public GitHub repo (the official `anki` package from PyPI, pinned by version and hash) and runs it as one service. It listens on Railway's port behind an HTTPS domain, keeps every account's collection and media on a Railway volume at `/anki_data`, and passes a `/health` check before traffic is switched. The first account is created from `ANKI_USERNAME` and a password generated at deploy, so there is no default login. After deploying, copy the password from the Variables tab, set the custom sync server in each Anki client, and run the first sync.

## Common Use Cases

* Sync Anki between a computer and phones without relying on AnkiWeb, or without an AnkiWeb account at all
* Keep long study breaks safe: your collection isn't removed for inactivity
* Give a family, class or study group their own accounts on one private server

## Dependencies for Anki Sync Server Hosting

* An Anki client: Anki Desktop, AnkiDroid or AnkiMobile, ideally no newer than the server's version
* A Railway volume for collections and media (included in the template)

### Deployment Dependencies

* Anki self-hosted sync server documentation: https://docs.ankiweb.net/sync-server.html
* Anki releases: https://github.com/ankitects/anki/releases
* Template source and changelog: https://github.com/aalfath/anki-sync-server-railway-template

### Implementation Details

The template deploys one service, **Anki Sync Server** (no database needed; each account's collection is an SQLite file on the volume). Deploy-time variables:

* `ANKI_USERNAME` (default `anki`) and `ANKI_PASSWORD` (generated): the first sync account
* `PORT` (8080)

After deploy:

1. Copy `ANKI_USERNAME` and `ANKI_PASSWORD` from the service's Variables tab.
2. In Anki Desktop open Preferences → Syncing, set the self-hosted sync server to `https://YOUR-DOMAIN.up.railway.app/` (your service's public domain, trailing slash included), restart Anki, then click Sync and log in. AnkiDroid and AnkiMobile have the same custom sync server setting.
3. On the first sync choose Upload on the device that holds your collection; other devices then choose Download.

More accounts: add `SYNC_USER2=user:password`, `SYNC_USER3=…` in the Variables tab. Large collections: raise `MAX_SYNC_PAYLOAD_MEGS` (default 100). Anki's messages still say "AnkiWeb" when a custom server is set.

Updates: when we release a new Anki version in the GitHub repo, Railway offers you an update; read the repo's CHANGELOG and apply it. Keep the server at least as new as your Anki clients, because newer clients may need a newer sync protocol. Your data stays on the volume across updates and redeploys.

## Why Deploy Anki Sync Server on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Anki Sync Server on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.



## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — Self-hosted virtual tabletop for role-playing games (license required)
- [Double Commander in your browser](https://railway.com/deploy/double-commander-in-your-browser) — The Double Commander file manager in the cloud, from any device

Open this page in a browser: https://railway.com/deploy/anki-sync-server-1
