The official dockercompose is good, but a bit too heavy for me, and the scripts are complicated:
$ docker compose stats --no-stream --format "table {{.Name}}\t{{.MemUsage}}"
NAME MEM USAGE
any-sync-dockercompose-netcheck-1 19.05MiB
any-sync-dockercompose-any-sync-node-1-1 31.32MiB
any-sync-dockercompose-any-sync-filenode-1 43.5MiB
any-sync-dockercompose-any-sync-consensusnode-1 33.27MiB
any-sync-dockercompose-any-sync-coordinator-1 35.17MiB
any-sync-dockercompose-generateconfig-processing-1 20.54MiB
any-sync-dockercompose-generateconfig-anyconf-1 25.71MiB
any-sync-dockercompose-any-sync-node-3-1 31.77MiB
any-sync-dockercompose-any-sync-node-2-1 32MiB
any-sync-dockercompose-minio-1 183.1MiB
any-sync-dockercompose-mongo-1-1 308.5MiB
any-sync-dockercompose-redis-1 26.3MiB
By applying some modifications and workarounds, I can run a self-hosted instance without Minio and MongoDB, using only one sync node:
$ docker compose stats --no-stream --format 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}'
NAME CPU % MEM USAGE / LIMIT
anytype-all-any-sync-node-1-1 0.00% 13.29MiB / 128MiB
anytype-all-any-sync-filenode-1 0.00% 12.88MiB / 128MiB
anytype-all-any-sync-consensusnode-1 0.00% 8.09MiB / 128MiB
anytype-all-redis-1 0.16% 3.934MiB / 128MiB
anytype-all-any-sync-coordinator-1 0.00% 9.477MiB / 128MiB
This is the directory size within a new space:
$ du --max-depth=1 -h ./storage
20K ./storage/any-sync-coordinator
1.1M ./storage/redis
12K ./storage/any-sync-consensusnode
2.0M ./storage/any-sync-filenode
716K ./storage/any-sync-node-1
3.7M ./storage
- anytype-ts: v0.49.1
- anytype-swift: v0.39.2
It's highly personalized, use at your own risk.
- Replace
s3StorewithfileDevStoreforany-sync-filenode. Due to the design, I think it won't cause race conditions for personal use. - Replace
MongoDBwith afakeDBbased on JSON files forany-sync-consensusnode. It handles few requests for personal use, so I think it's acceptable. - Replace
mongowithgithub.com/256dpi/lungoforany-sync-coordinator. I'm not sure about this, but it works. - Do not rely on the P2P feature because Tailscale does not support mDNS, although there is a feature request for it.
- Hardening the containers (distroless, non-root, CVE-less)
- Remove redis
- Combine all nodes (filenode, sync node, coordinator, consensusnode) to one node, publish a single port
- Initialize the
.envfile:
cp .env.template .envEdit ANY_EXTERNAL_HOST is the host you want to use to access the instance. Examples include: 127.0.0.1, 192.168.10.101, or home.foo.ts.net.
- Install
github.com/anyproto/any-sync-tools/anyconf@latest:
You can install it in any way you prefer. I use Docker and an alias:
docker build -t anyconf:latest -f ./docker/anyconf.Dockerfile .
alias anyconf='docker run --rm --network none --env-file .env --user "$(id -u):$(id -g)" -v "$(pwd)":/app -w /app anyconf:latest'- Generate nodes and accounts:
source .env
anyconf create-network --account account-coordinator.yml --output nodes.yml --address $ANY_SYNC_COORDINATOR_HOST:$ANY_SYNC_COORDINATOR_PORT
anyconf add-node --t consensus --n nodes.yml --account account-consensusnode.yml --address $ANY_SYNC_CONSENSUSNODE_HOST:$ANY_SYNC_CONSENSUSNODE_PORT
anyconf add-node --t file --n nodes.yml --account account-filenode.yml --address $ANY_SYNC_FILENODE_HOST:$ANY_SYNC_FILENODE_PORT
anyconf add-node --t tree --n nodes.yml --account account-node-1.yml --address $ANY_SYNC_NODE_1_HOST:$ANY_SYNC_NODE_1_PORT- Edit
.envagain:
Run uv run scripts/setup_env.py to apply new config to .env
- Generate config files:
Run uv run scripts/generate_config.py
- Start the Docker Compose setup:
docker compose up --build --remove-orphans -d- Use the generated
client.ymlwith clients:
For more details, see the documentation.
- https://tech.anytype.io/how-to/self-hosting
- https://github.com/orgs/anyproto/discussions/categories/self-hosting?discussions_q=category%3ASelf-hosting+
- https://github.com/orgs/anyproto/discussions/17
- https://github.com/anyproto/any-sync-dockercompose
- https://github.com/anyproto/ansible-anysync
- https://forge.puppetlabs.com/modules/anyproto/anysync/readme