Special thanks to the Logseq developers, the Discord community and especially @yshalsager for creating the Docker for Logseq Sync and @zetashift for problem solving with me.
This guide is intended for users who want to run a Logseq sync server from home–for instance on a laptop–and then access it remotely when they are away from their home network.
Set up Tailscale
- Install Tailscale on all devices (server + clients).
- Note the Tailscale IP of the device that will host the sync server.
Install Docker and Git
- Install Docker Engine and the Compose plugin on the device that will host the Logseq sync server. On Linux, follow the official Docker installation guide; on macOS/Windows, Docker Desktop includes everything you need.
- Install Git.
Clone the repo and configure
- Create a directory on your server device where you will store Dockers. From that directory:
git clone https://github.com/yshalsager/logseq-selfhost.git
cd logseq-selfhost/images/sync
cp .env.example .envEdit the .env file
- Change the line
DB_SYNC_BASE_URL=https://sync.example.com- to
DB_SYNC_BASE_URL=http://<your.tailscale.ip>:8787Start the server
docker compose pull
docker compose up -dVerify the server is running
curl http://localhost:8787/health # should return {"ok":true}Connect Logseq clients to Your Local Sync Server
- On Android it’s necessary to be a Logseq supporter in order for sync to work, so first log in with your Logseq credentials.
- For Logseq Desktop go to Settings → General → Custom Sync Server URL
For Logseq Android from the home menu, click on the hamburger icon, and look for sync settings.
Change to http://YOUR_TAILSCALE_IP:8787
Create or Sync an Existing Graph
- On one device, go the “Graphs” page, create a new graph and check “Use Logseq Sync Beta” (optionally enable encryption).
- Alternatively, sync an existing graph by clicking on “…” and selecting “Use Logeq Sync Beta”. If the graph is large, wait some time for the upload to finish.
- On the other devices, go to the “Graphs” page and select the graph you just uploaded.