This guide helps you to setup ODK Central on Windows 10 whereby OS specific problems are being fixed.
- Node.js
- Docker & Docker Compose (Docker Desktop recommended)
- Git
Clone repository
# git clone with correct EOL
git clone -c core.autocrlf=false https://github.com/getodk/central
Install submodules
cd central
git submodule update -i
Please proceed with Step 3
This step is not necessary anymore since git manages the correct EOL during cloning.
Replace EOL from CRLF to LF for all *.sh files
# Command can be run directly from terminal ./central
## Fix .sh files needed during build
## Issue: https://forum.getodk.org/t/odk-central-build-error/29523/10
for /f "tokens=* delims=" %a in ('dir /s /b *.sh') do ( dos2unix %a )
## fix files without extensions needed for odk-cmd
## Issue: https://forum.getodk.org/t/odk-central-command-line-tools-unable-to-create-admin-user/32521
for /f "tokens=* delims=" %a in ('dir /s /b files ^| findstr /v /i "\..*$"') do ( dos2unix %a )
# Credits:
# recursive dos2unix: https://gist.github.com/kelvinn/512f72bf1015047af945
# Exclude files in dir: https://superuser.com/a/383646/1334887
# About windows for loop
# https://www.windows-commandline.com/windows-for-loop-examples/
# https://ss64.com/nt/for.html
Adjust 2 lines in nginx.dockerfile
RUN /bin/sh ./files/prebuild/write-version.sh
RUN /bin/sh ./files/prebuild/build-frontend.sh
Rename environment file
mv .env.template .env
Adjust variables in .env
DOMAIN=localhost
SSL_TYPE=selfsign
Start your docker service and run
docker-compose build
To finish the build run
docker-compose up --no-start
docker-compose up -d
The fixes have been taken from the ODK Forum. Thank to these users for sharing their solutions.
make sure to touch ./files/allow-postgres14-upgrade in linux to let the system know that you want the latest version of the database.
Step 6 in https://docs.getodk.org/central-install-digital-ocean/#getting-and-setting-up-central
and for windows i am using this command type nul > .\files\allow-postgres14-upgrade
for me it created an empty file in the files folder.