A self-hosted server for CoMapeo. CoMapeo mobile and desktop apps can add the server to a project and sync with it over the internet, so that devices which never meet in person can still exchange data. The server also has an HTTP API for reading a project's data and adding alerts to it.
CoMapeo Cloud is distributed as a Docker image, ghcr.io/digidem/comapeo-cloud, for linux/amd64 and linux/arm64. It runs anywhere that can run a container, and needs:
- the container's port 8080 exposed over HTTPS, with websocket support (see HTTPS and reverse proxies);
- persistent storage mounted at
/usr/src/app/data, or whereverSTORAGE_DIRpoints (see Data and backups); SERVER_BEARER_TOKENset to a long random secret (see Configuration).
Use a version tag such as 1.2.3 or 1 in place of latest, so that upgrades happen when you choose. docs/versioning.md explains the tags.
Note
Images up to 0.4.0 were published on Docker Hub as communityfirst/comapeo-cloud. Newer releases are only on GitHub's container registry. To move, replace the image name wherever you pull it; the data directory is unchanged.
docker run -d \
--restart unless-stopped \
-p 8080:8080 \
-e SERVER_BEARER_TOKEN=<your-secret-token> \
-v /path/to/data:/usr/src/app/data \
ghcr.io/digidem/comapeo-cloud:<version>The server runs as the unprivileged node user (user ID 1000), so a host directory mounted as the data directory must be writable by that user, for example with chown 1000:1000 /path/to/data. A named Docker volume also works, in releases after 0.4.0.
- Create an app, and under HTTP Settings enable HTTPS and websocket support and set the container HTTP port to 8080.
- Under App Configs, add
/usr/src/app/dataas a persistent directory, and addSERVER_BEARER_TOKENand any other environment variables. - Under Deployment, deploy with the image name
ghcr.io/digidem/comapeo-cloud:<version>. To upgrade, deploy the new version's image name.
fly.toml in this repository stores data on a Fly volume and lets the machine sleep when idle. With flyctl installed:
curl -fsSLO https://raw.githubusercontent.com/digidem/comapeo-cloud/main/fly.toml
flyctl apps create <your-app-name>
flyctl secrets set SERVER_BEARER_TOKEN=<your-secret> --app <your-app-name>
flyctl deploy --app <your-app-name> --image ghcr.io/digidem/comapeo-cloud:<version> -e ALLOWED_PROJECTS=10Change primary_region in fly.toml first if you want a region nearer your users. The server is then at https://<your-app-name>.fly.dev. Always pass --image: without it, flyctl builds from a Dockerfile in the current directory.
Warning
flyctl apps destroy <your-app-name> deletes the app and, permanently, its data. Projects that added the server will no longer be able to sync with it.
The server is configured with environment variables:
| Environment Variable | Required | Description | Default Value |
|---|---|---|---|
SERVER_BEARER_TOKEN |
Yes | Token for authenticating API requests. Use a long random string | |
PORT |
No | Port on which the server listens | 8080 |
SERVER_NAME |
No | Friendly server name, seen by users when adding the server | CoMapeo Server |
ALLOWED_PROJECTS |
No | Number of projects allowed to register with the server | 1 |
STORAGE_DIR |
No | Path for storing app and project data | $CWD/data |
SYNC_INACTIVITY_TIMEOUT_MS |
No | Close a sync websocket that has received nothing for this long (ms) | 30000 |
SERVER_BEARER_TOKEN protects the HTTP API that reads and writes project data. It is not needed to add a project to the server: anyone who knows the server's address can add one until ALLOWED_PROJECTS is reached. Keep that limit as low as you need, and share the address only with the people who should use it.
The server speaks plain HTTP, and CoMapeo apps expect to reach it over HTTPS, so run it behind a reverse proxy or a platform that provides HTTPS. The proxy must pass websocket upgrades through, and must forward the original host and scheme (the Host or X-Forwarded-Host header, and X-Forwarded-Proto), because the server builds the address it gives to apps from them. The server trusts those headers from anyone, so it should only be reachable through the proxy.
GET /healthcheck returns 200 when the server is ready. Images after 0.4.0 include a Docker HEALTHCHECK, so docker ps shows whether the container is healthy.
Everything the server needs is in the storage directory: its identity key and the data of each project. Back up the whole directory; to be sure of a consistent copy, stop the server while you copy it. If it is lost, the server comes back with a new identity, and projects that added the old one will no longer be able to sync with it.
Pull the new image and recreate the container with the same data directory. The server applies any database changes when it starts.
The versioning policy says what a patch, minor or major release can change. Read the release notes before a major upgrade.
The server and the apps are released separately, so either may be newer than the other.
- Every server release from 1.0.0 supports CoMapeo Mobile from v8.3 and CoMapeo Desktop from v3.0. Support for an app version is only dropped in a major release, after notice. See supported client versions.
- New app releases are expected to sync with every server from 0.4.0 onwards.
GET /info reports what a server is running. It needs no token, so anyone who can reach the server can see its version:
{
"data": {
"deviceId": "…",
"name": "CoMapeo Server",
"versions": { "@comapeo/cloud": "1.0.0", "@comapeo/core": "8.0.1" }
}
}Releases before 1.0.0 do not report versions.
Releases after 0.4.0 carry a signed record that this repository's automated build made them, which you can check with the GitHub command-line tool:
gh attestation verify oci://ghcr.io/digidem/comapeo-cloud:<version> --repo digidem/comapeo-cloudSee CONTRIBUTING.md before opening a pull request, docs/development.md for working on the code, and docs/releasing.md for how releases are made.
Copyright © 2022–2026 Awana Digital. CoMapeo Cloud is free software, licensed under the GNU Affero General Public License version 3 or any later version. If you run a modified version as a service, the license requires you to offer its users the source code of your version. Releases up to and including 1.0.0-next.1 were published under the MIT license.