How to install Appwrite on Synology NAS
1. Install Container Manager package
In DiskStation Manager, Open Package Center and install Container Manger package.
2. Create directory for Docker’s project
Open File Station and create directory to store Appwrite. For this example:
/volume1/docker/appwrite.Then, create the following directories:
/volume1/docker/appwrite/storage/builds /volume1/docker/appwrite/storage/cache /volume1/docker/appwrite/storage/certificates /volume1/docker/appwrite/storage/config /volume1/docker/appwrite/storage/functions /volume1/docker/appwrite/storage/influxdb /volume1/docker/appwrite/storage/mariadb /volume1/docker/appwrite/storage/redis /volume1/docker/appwrite/storage/uploads
3. Setup Docker Compose file.
Download Appwrite base
docker-compose.ymland.envfilesOpen
docker-compose.ymlin code editor, undertraefik:edit the following from:ports: - 80:80 - 443:443To
ports: - 8080:80 - 8443:443For this example, port
8080and8443is use to gain access to Appwrite. You can change it to other ports that you want to use.Edit
volumes:from:volumes: - /var/run/docker.sock:/var/run/docker.sock - appwrite-config:/storage/config:ro - appwrite-certificates:/storage/certificates:roTo:
volumes: - /var/run/docker.sock:/var/run/docker.sock - /volume1/docker/appwrite/storage/config:/storage/config:ro - /volume1/docker/appwrite/storage/certificates:roUnder
appwrite:edit the followingvolumes:from:volumes: - appwrite-uploads:/storage/uploads:rw - appwrite-cache:/storage/cache:rw - appwrite-config:/storage/config:rw - appwrite-certificates:/storage/certificates:rw - appwrite-functions:/storage/functions:rwTo
volumes: - /volume1/docker/appwrite/storage/uploads:/storage/uploads:rw - /volume1/docker/appwrite/storage/cache:/storage/cache:rw - /volume1/docker/appwrite/storage/config:/storage/config:rw - /volume1/docker/appwrite/storage/certificates:/storage/certificates:rw - /volume1/docker/appwrite/storage/functions:/storage/functions:rw cap_add: - SYS_ADMINUnder
appwrite-worker-deletes:editvolumes:from:volumes: - appwrite-uploads:/storage/uploads:rw - appwrite-cache:/storage/cache:rw - appwrite-functions:/storage/functions:rw - appwrite-builds:/storage/builds:rw - appwrite-certificates:/storage/certificates:rwTo
volumes: - /volume1/docker/appwrite/storage/uploads:/storage/uploads:rw - /volume1/docker/appwrite/storage/cache:/storage/cache:rw - /volume1/docker/appwrite/storage/functions:/storage/functions:rw - /volume1/docker/appwrite/storage/builds:/storage/builds:rw - /volume1/docker/appwrite/storage/certificates:/storage/certificates:rwUnder
appwrite-worker-builds:editvolumes:from:volumes: - appwrite-functions:/storage/functions:rw - appwrite-builds:/storage/builds:rwTo
volumes: - /volume1/docker/appwrite/storage/functions:/storage/functions:rw - /volume1/docker/appwrite/storage/builds:/storage/builds:rwUnder
appwrite-worker-certificates:editvolumes:from:volumes: - appwrite-config:/storage/config:rw - appwrite-certificates:/storage/certificates:rwTo
volumes: - /volume1/docker/appwrite/storage/config:/storage/config:rw - /volume1/docker/appwrite/storage/certificates:/storage/certificates:rwUnder
openruntimes-executoreditvolumes:from:volumes: - /var/run/docker.sock:/var/run/docker.sock - appwrite-builds:/storage/builds:rw - appwrite-functions:/storage/functions:rw # Host mount nessessary to share files between executor and runtimes. # It's not possible to share mount file between 2 containers without host mount (copying is too slow) - /tmp:/tmp:rwTo
volumes: - /var/run/docker.sock:/var/run/docker.sock - /volume1/docker/appwrite/storage/builds:/storage/builds:rw - /volume1/docker/appwrite/storage/functions:/storage/functions:rw # Host mount nessessary to share files between executor and runtimes. # It's not possible to share mount file between 2 containers without host mount (copying is too slow) - /tmp:/tmp:rwUnder
mariadb:editvolumes:from:volumes: - appwrite-mariadb:/var/lib/mysql:rwTo
volumes: - /volume1/docker/appwrite/storage/mariadb:/var/lib/mysql:rwUnder
redis:editvolumes:from:volumes: - appwrite-redis:/data:rwTo
volumes: - /volume1/docker/appwrite/storage/redis:/data:rwIf using
clamav, underclamav:editvolumes:from:volumes: - appwrite-uploads:/storage/uploadsTo
volumes: - /volume1/docker/appwrite/storage/uploads:/storage/uploadsUnder
influxdb:editvolumes:from:volumes: - appwrite-influxdb:/var/lib/influxdb:rwTo
volumes: - /volume1/docker/appwrite/storage/influxdb:/var/lib/influxdb:rwRemove or comment out the unused named volumes:
# volumes: # appwrite-mariadb: # appwrite-redis: # appwrite-cache: # appwrite-uploads: # appwrite-certificates: # appwrite-functions: # appwrite-builds: # appwrite-influxdb: # appwrite-config:Save and move both edited
docker-compose.ymland.envfiles to/volume1/docker/appwrite.
4. Create Appwrite project in Container Manager
Open Container Manager -> Project -> Create.
Fill up
Project Nameand clickSet Path.Choose directory where did you stored
docker-compose.ymland.envfiles. For this example:/volume1/docker/appwrite. Then clickSelect.Choose
"Use existing an docker-compose.yml to create the project"and clickOK.In
Web portal settingsclickNext.In
SummaryclickDone.Wait until
buildprocess is completed. The final line in Terminal will beExit code: 0. Then clickClose.You can access Appwrite via
https://[YOUR-NAS-IP-ADDRESS]:8443or other ports you’ve edited indocker-compose.ymlfile.
Why not use named volume and NFS?
I tried but with no success.
NFS is enabled in Control Panel -> File Services -> NFS. The “Maximum NFS protocol” is set to
NFSv4.Permission is created in Control Panel -> Shared Folder ->
docker-> Edit -> NFS Permissions with “Non-privileged” and “Cross-mount” set toAllowed.In
docker-compose.yml, the named volumes set to:volumes: appwrite-mariadb: type: nfs o: addr=[NAS-IP-ADDRESS],nfsvers=4 device: :/volume1/docker/appwrite/storage/mariadb appwrite-redis: type: nfs o: addr=[NAS-IP-ADDRESS],nfsvers=4 device: :/volume1/docker/appwrite/storage/redis appwrite-cache: type: nfs o: addr=[NAS-IP-ADDRESS],nfsvers=4 device: :/volume1/docker/appwrite/storage/cache appwrite-uploads: type: nfs o: addr=[NAS-IP-ADDRESS],nfsvers=4 device: :/volume1/docker/appwrite/storage/uploads appwrite-certificates: type: nfs o: addr=[NAS-IP-ADDRESS],nfsvers=4 device: :/volume1/docker/appwrite/storage/certificates appwrite-functions: type: nfs o: addr=[NAS-IP-ADDRESS],nfsvers=4 device: :/volume1/docker/appwrite/storage/functions appwrite-builds: type: nfs o: addr=[NAS-IP-ADDRESS],nfsvers=4 device: :/volume1/docker/appwrite/storage/builds appwrite-influxdb: type: nfs o: addr=[NAS-IP-ADDRESS],nfsvers=4 device: :/volume1/docker/appwrite/storage/influxdb appwrite-config: type: nfs o: addr=[NAS-IP-ADDRESS],nfsvers=4 device: :/volume1/docker/appwrite/storage/config
Docker just doesn’t seem to managed to map the volumes. It could be some permission issue, but I can’t seem to figure it out what actually happened.
Further Reading
- “Self-Hosting” [Appwrite Docs]
- “Environment variables” [Appwrite Docs][
- “Running containers” [Docker Docs]