aWhere Manual
Install and run a site

Requirements

What to have ready before you install aWhere, and the conditions for your own database and proxy

This page lists what to have ready before you install aWhere.

What to have ready

  • Docker and Docker Compose 2.17 or newer. Install them from Docker's guide. Any machine that runs Docker will do. On macOS 26 or newer you can use Apple Container instead.
  • curl and openssl
  • The user name and password for the registry registry.mapboss.co.th, which aWhere gives you.
  • The web address users will open, such as https://app.example.com.
  • (Docker only) Port 80 must be free, because the proxy that comes with the system uses it. If you cannot use port 80, pick another at install time, such as awhere setup --http-port 8080. If you use Apple Container, skip this item.

MongoDB, NATS and Redis come with the system. You do not install them.

If you use your own database

To use a MongoDB, NATS and Redis you already have instead of the ones that come with the system, give their addresses when you run awhere setup. This works on both Docker and Apple Container.

awhere setup --infra external \
  --datastore-url 'mongodb://user:password@db.example.com:27017/awhere?authSource=admin' \
  --content-store-url 'mongodb://user:password@db.example.com:27017/awhere-content?authSource=admin&replicaSet=rs0' \
  --session-store-url 'mongodb://user:password@db.example.com:27017/awhere-session?authSource=admin' \
  --log-store-url 'mongodb://user:password@db.example.com:27017/awhere-log?authSource=admin' \
  --nats-url nats://nats.example.com:4222 \
  --redis-url 'redis://:password@redis.example.com:6379'

MongoDB

  • Use version 4.2 or newer. The log database must be 5.0 or newer.
  • The content database must be a replica set. One member is enough. Put the replica set name in the URL with replicaSet=<name>.
  • The user in --content-store-url needs the changeStream and find privileges on the content database, and readWrite on awhere-tiles.
  • If the user account lives in another database, usually admin, add authSource to the URL. Percent-encode a password that has special characters before you put it in.

NATS

JetStream must be on. Run NATS with -js, and keep JetStream's data in a volume that does not go away with the container. Without JetStream, logging-services will not start.

Redis

background-services keeps its import job queue in Redis. The system does not check the Redis version.

Apple Container only: If you use your own proxy

If you use Docker, skip this section.

Docker comes with a proxy. Apple Container does not, so you set one up yourself. Send each path to a container as in this table. Do not strip the path prefix, and put the longer rules first.

PathSend to
/api/authauthorization-server
/api/item/<id>/actions/getTile/tile-services
/api/itemitem-services
/api/filefile-services
/api/loglogging-services
/api/realtimerealtime-services
All the rest of /apicore-services
The path of each app, such as /drive/The container of that app
Every path that matches none of the rows above, including /portal

The last row must have the lowest priority, so that everything nobody else takes goes to portal, which also answers the platform's 404 page. If the proxy sends / somewhere else, the platform's front page does not appear.

Then set the proxy to remove the X-Auth-* headers from every request that enters /api.

On this page