Failover/Distributed Installation

We are interested in hosting our own instance of KoboToolbox. We would like to be able to host on a distributed architecture where we have multiple KoboToolbox servers behind a Load Balancer with a shared database, specifically on AWS. I notice that you’re using Mongodb and PostGres, Would it be possible to use AWS RDS instead? Do you have instructions on how to scale KoboToolbox?

Hi @onesky,
Using kobo-install won’t let you using AWS RDS or AWS DocumentDB right out of box.

On each EC2, you setup an instance of kobo-install that way.

β•‘ Welcome to KoBoInstall!                                       β•‘
β•‘                                                               β•‘
β•‘ You are going to be asked some questions that will            β•‘
β•‘ determine how to build the configuration of `KoBoToolBox`.    β•‘
β•‘                                                               β•‘
β•‘ Some questions already have default values (within brackets). β•‘
β•‘ Just press `enter` to accept the default value or enter `-`   β•‘
β•‘ to remove previously entered value.                           β•‘
β•‘ Otherwise choose between choices or type your answer.         β•‘
Where do you want to install?
Please confirm path [/tmp/kobo-docker]
	1) Yes
	2) No
Do you want to see advanced options?
	1) Yes
	2) No
What kind of installation do you need?
	1) On your workstation
	2) On a server
[1]: 2
Please choose which network interface you want to use?
	eth0) X.X.X.X
	other) Other
Do you want to use separate servers for frontend and backend?
	1) Yes
	2) No
[2]: 1
Which role do you want to assign to this server?
	1) frontend
	2) backend
[frontend]: frontend
Do you use DNS for private routes?
	1) Yes
	2) No
[2]: 1
Private domain name [kobo.private]: mydomain.private
Public domain name [kobo.local]: mydomain.public
KPI sub domain [kf]:
KoBoCat sub domain [kc]:
Enketo Express sub domain name [ee]:
Do you want to use HTTPS?
	1) Yes
	2) No
[2]: 1
β•‘ Please note that certificates must be installed on a reverse-proxy β•‘
β•‘ or a load balancer.                                                β•‘
β•‘ KoBoInstall can install one, if needed.                            β•‘
Auto-install HTTPS certificates with Let's Encrypt?
	1) Yes
	2) No - Use my own reserve-proxy/load-balancer
[2]: 2
Is your reverse-proxy/load-balancer installed on this server?
	1) Yes
	2) No
[1]: 2
Internal port used by reverse proxy?
... -- fill out other options as you wish

Each EC2 can be behind a ALB/ELB. HTTPS certificate must be installed on the load balancer (thanks to AWS certificate manager). Use the port you entered at Internal port used by reverse proxy between ALB/ELB and EC2s (80 by default)

We recommend to use route53 to create a private hostname for mydomain.private. You can use it to point to AWS RDS, AWS DocumentDB and AWS ElastiCache.
kobo-install will generate a config file with 4 private domain names:

  • postgres.mydomain.private
  • mongo.mydomain.private
  • redis-main.mydomain.private
  • redis-cache.mydomain.private

You should create these entries as CNAME in route 53 and point them their respective AWS endpoints.

Be aware, kobo-install does not support (yet) password for MongoDB (or DocumentDB) and Redis.