The purpose of the script is to install KoboToolbox in minutes without messing with configuration files.
It prompts the user to answer some questions to create configuration files automatically and to start docker containers based on kobo-docker
.
β οΈ You must observe the following when upgrading:
2.022.44
(November 2022)
β¦from any release older than If you have already installed KoboToolbox between March 2019 and November 2022, you must complete a manual upgrade process before trying to upgrade. If you do not, kobo-install
will not be able to start.
2.020.18
(May 2020)
β¦from any release older than Prior to release 2.020.18
, KPI and KoBoCAT both shared a common Postgres database. They now each have their own. If you are upgrading an existing single-database installation, you must follow these instructions to migrate the KPI tables to a new database and adjust your configuration appropriately.
If you do not want to upgrade at this time, please use the shared-database-obsolete
branch instead.
β¦installations made prior to March 2019
If you have already installed KoboToolbox with kobo-docker
prior March 2019,
you must complete a manual upgrade process
before using this repository. If you do not, kobo-install
will not be able to start.
Versions
Branch master
is the recommended branch to use kobo-install
on your production environment. Just run git checkout master
before your first run.
Branch beta
is a pre-release of the next version. It contains new features and bug fixes.
Other branches are for development purposes.
Usage
$kobo-install> python3 run.py
First time the command is executed, setup will be launched.
Subsequent executions will launch docker containers directly.
Rebuild configuration:
$kobo-install> python3 run.py --setup
Get info:
$kobo-install> python3 run.py --info
Get docker logs:
$kobo-install> python3 run.py --logs
Update KoBoToolbox:
$kobo-install> python3 run.py --update [branch or tag]
By default, fetch the latest version of master
branch
Stop KoBoToolbox:
$kobo-install> python3 run.py --stop
Get help:
$kobo-install> python3 run.py --help
Get version:
$kobo-install> python3 run.py --version
Build kpi and kobocat (dev mode):
$kobo-install> python3 run.py --build
Run docker commands on front-end containers:
$kobo-install> python3 run.py --compose-frontend [docker-compose arguments]
Run docker commands on back-end containers:
$kobo-install> python3 run.py --compose-backend [docker-compose arguments]
Start maintenance mode:
$kobo-install> python3 run.py --maintenance
Stop maintenance mode:
$kobo-install> python3 run.py --stop-maintenance
Build the configuration
User can choose between 2 types of installations:
Workstation
: KoBoToolbox doesn't need to be accessible from anywhere except the computer where it's installed. No DNS neededServer
: KoBoToolbox needs to be accessible from the local network or from the Internet. DNS are needed
Options
Option | Default | Workstation | Server |
---|---|---|---|
Installation directory | ../kobo-docker | β | β |
SMTP information | β | β (front end only) | |
Public domain name | kobo.local | β (front end only) | |
Subdomain names | kf, kc, ee | β (front end only) | |
Use HTTPS1 | False (Workstation) True (Server) |
β (front end only) | |
Super user's username | super_admin | β | β (front end only) |
Super user's password | Random string | β | β (front end only) |
Activate backups2 | False | β | β (back end only) |
Advanced Options
Option | Default | Workstation | Server |
---|---|---|---|
Webserver port | 80 | β | |
Reverse proxy interal port | 8080 | β (front end only) | |
Network interface | Autodetected | β | β (front end only) |
Use separate servers | No | β | |
Use DNS for private routes | No | β (front end only) | |
Primary back end IP (if previous answer is no) | Local IP | β (front end only) | |
PostgreSQL DB | kobo | β | β |
PostgreSQL user's username | kobo | β | β |
PostgreSQL user's password | Autogenerate | β | β |
PostgreSQL number of connections3 | 100 | β | β (back end only) |
PostgreSQL RAM3 | 2 | β | β (back end only) |
PostgreSQL Application Profile3 | Mixed | β | β (back end only) |
PostgreSQL Storage3 | HDD | β | β (back end only) |
MongoDB super user's username | root | β | β |
MongoDB super user's password | Autogenerate | β | β |
MongoDB user's username | kobo | β | β |
MongoDB user's password | Autogenerate | β | β |
Redis password4 | Autogenerate | β | β |
Use AWS storage5 | No | β | β |
Use WAL-E PostgreSQL backups6 | No | β | β (back end only) |
uWGI workers | start: 2, max: 4 | β | β (front end only) |
uWGI memory limit | 128 MB | β | β (front end only) |
uWGI harakiri timeout | 120s | β | β (front end only) |
uWGI worker reload timeout | 120s | β | β (front end only) |
Google UA | β | β (front end only) | |
Google API Key | β | β (front end only) | |
Raven tokens | β | β (front end only) | |
Debug | False | β | |
Developer mode | False | β | |
Staging mode | False | β (front end only) |
1) HTTPS certificates must be installed on a Reverse Proxy.
kobo-install
can install one and use Let's Encrypt
to generate certificates
thanks
to nginx-certbot project
2) If AWS credentials are provided, backups are sent to configured bucket
3) Custom settings are provided by PostgreSQL Configuration Tool API
4) Redis password is optional but strongly recommended
5) If AWS storage is selected, credentials must be provided if backups are activated
6) WAL-E backups for PostgreSQL are only available when using AWS storage
Requirements
-
Linux 5 / macOS 6
-
Python 3.7+
-
Available TCP Ports: 7
- 80 NGINX
- 443 NGINX (if you use kobo-install with LetsEncrypt proxy)
- Additional ports when
expose ports
advanced option has been selected- 5432 PostgreSQL
- 6379-6380 redis
- 27017 MongoDB
WARNING:
- If you use a firewall, be sure to open traffic publicly on NGINX port, otherwise kobo-install cannot work
- By default, additional ports are not exposed except when using multi servers configuration. If you choose to expose them, be sure to not expose them publicly (e.g. use a firewall and allow traffic between front-end and back-end containers only. NGINX port still has to stay publicly opened though).
5) It has been tested with Ubuntu 14.04, 16.04 and 18.04, CentOS 8
6) Docker on macOS is slow. First boot usually takes a while to be ready. You may have to answer Yes
once or twice to question Wait for another 600 seconds?
when prompted
7) These are defaults but can be customized with advanced options
Tests
Tests can be run with tox
.
Be sure it is installed before running the tests.
$kobo-install> sudo apt install python3-pip
$kobo-install> pip3 install tox
$kobo-install> tox
or
$kobo-install> sudo apt install tox
$kobo-install> tox