| title | Complete Installation Guide for OSM Notes Ecosystem | |
|---|---|---|
| description | This guide walks you step-by-step through the complete installation of all 8 projects in the OSM Notes ecosystem. | |
| version | 1.0.0 | |
| last_updated | 2026-01-25 | |
| author | AngocA | |
| tags |
|
|
| audience |
|
|
| project | OSM-Notes-Common | |
| status | active |
This guide walks you step-by-step through the complete installation of all 8 projects in the OSM Notes ecosystem.
- Global Prerequisites
- Installation Order
- Step-by-Step Installation
- Post-Installation Verification
- Common Troubleshooting
- Production Configuration
- Linux (Ubuntu/Debian recommended)
- Bash 4.0 or higher
- Git to clone repositories
# PostgreSQL with PostGIS
sudo apt-get install postgresql postgis
# Basic tools
sudo apt-get install curl jq parallel
# Node.js (for API and Viewer)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Java (for GeoServer/WMS)
sudo apt-get install default-jreThe ecosystem uses multiple PostgreSQL databases:
notes- Main database (Ingestion)osm_notes_dwhornotes_dwh- Data warehouse (Analytics)osm_notes_monitoringornotes_monitoring- Monitoring (Monitoring)
flowchart TD
START[Start] --> PREREQ[Global Prerequisites]
PREREQ --> INGESTION[1. OSM-Notes-Ingestion<br/>Base Project]
INGESTION --> VERIFY1{Verify Ingestion}
VERIFY1 -->|OK| ANALYTICS[2. OSM-Notes-Analytics]
VERIFY1 -->|Error| TROUBLESHOOT1[Troubleshooting]
ANALYTICS --> VERIFY2{Verify Analytics}
VERIFY2 -->|OK| WMS[3. OSM-Notes-WMS]
VERIFY2 -->|Error| TROUBLESHOOT2[Troubleshooting]
WMS --> VERIFY3{Verify WMS}
VERIFY3 -->|OK| DATA[4. OSM-Notes-Data<br/>Auto-generated]
VERIFY3 -->|Error| TROUBLESHOOT3[Troubleshooting]
DATA --> VERIFY4{Verify Data}
VERIFY4 -->|OK| API[5. OSM-Notes-API]
VERIFY4 -->|Error| TROUBLESHOOT4[Troubleshooting]
API --> VERIFY5{Verify API}
VERIFY5 -->|OK| VIEWER[6. OSM-Notes-Viewer]
VERIFY5 -->|Error| TROUBLESHOOT5[Troubleshooting]
VIEWER --> VERIFY6{Verify Viewer}
VERIFY6 -->|OK| MONITORING[7. OSM-Notes-Monitoring]
VERIFY6 -->|Error| TROUBLESHOOT6[Troubleshooting]
MONITORING --> VERIFY7{Verify Monitoring}
VERIFY7 -->|OK| COMMON[8. OSM-Notes-Common<br/>Submodule]
VERIFY7 -->|Error| TROUBLESHOOT7[Troubleshooting]
COMMON --> DONE[✅ Complete Installation]
style START fill:#90EE90
style DONE fill:#90EE90
style TROUBLESHOOT1 fill:#FFB6C1
style TROUBLESHOOT2 fill:#FFB6C1
style TROUBLESHOOT3 fill:#FFB6C1
style TROUBLESHOOT4 fill:#FFB6C1
style TROUBLESHOOT5 fill:#FFB6C1
style TROUBLESHOOT6 fill:#FFB6C1
style TROUBLESHOOT7 fill:#FFB6C1
Critical order:
- OSM-Notes-Ingestion - MUST be installed first (base project)
- OSM-Notes-Analytics - Requires Ingestion
- OSM-Notes-WMS - Requires Ingestion
- OSM-Notes-Data - Auto-generated by Analytics
- OSM-Notes-API - Requires Analytics (no dependency on Viewer)
- OSM-Notes-Viewer - Requires Data (can optionally use API for enhanced features)
- OSM-Notes-Monitoring - Requires all others
- OSM-Notes-Common - Submodule (no installation required)
# Create working directory
mkdir -p ~/github/OSM-Notes
cd ~/github/OSM-Notes
# Configure PostgreSQL
sudo systemctl start postgresql
sudo systemctl enable postgresqlEstimated time: 30-60 minutes (first execution)
git clone --recurse-submodules https://github.com/OSM-Notes/OSM-Notes-Ingestion.git
cd OSM-Notes-Ingestion# Create database
sudo -u postgres psql << EOF
CREATE USER notes SUPERUSER;
CREATE DATABASE notes WITH OWNER notes;
\c notes
CREATE EXTENSION postgis;
CREATE EXTENSION btree_gist;
EOFcp etc/properties.sh.example etc/properties.sh
nano etc/properties.sh # Edit with your credentialssudo bin/scripts/install_directories.sh# The daemon handles initial installation automatically
sudo cp examples/systemd/osm-notes-ingestion-daemon.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable osm-notes-ingestion-daemon
sudo systemctl start osm-notes-ingestion-daemonOr alternatively with cron:
# First manual execution for initial load
./bin/process/processAPINotes.sh# Verify that base tables exist
psql -d notes -c "SELECT COUNT(*) FROM notes;"
psql -d notes -c "SELECT COUNT(*) FROM note_comments;"
psql -d notes -c "SELECT COUNT(*) FROM users;"
psql -d notes -c "SELECT COUNT(*) FROM countries;"
# Verify daemon logs
sudo journalctl -u osm-notes-ingestion-daemon -f✅ Ready when: All tables have data (> 0 records)
References:
Estimated time: 1-2 hours (initial ETL)
cd ~/github/OSM-Notes
git clone --recurse-submodules https://github.com/OSM-Notes/OSM-Notes-Analytics.git
cd OSM-Notes-Analytics# Create database (can be same as Ingestion or separate)
sudo -u postgres psql << EOF
CREATE DATABASE osm_notes_dwh WITH OWNER notes;
\c osm_notes_dwh
CREATE EXTENSION postgis;
EOFcp etc/properties.sh.example etc/properties.sh
nano etc/properties.sh # Configure DBNAME=osm_notes_dwhcd bin/dwh
./ETL.shEstimated time: 25-30 minutes for initial ETL (depends on data volume)
# Verify that dwh schema exists
psql -d osm_notes_dwh -c "SELECT schema_name FROM information_schema.schemata WHERE schema_name = 'dwh';"
# Verify main tables
psql -d osm_notes_dwh -c "SELECT COUNT(*) FROM dwh.facts;"
psql -d osm_notes_dwh -c "SELECT COUNT(*) FROM dwh.datamartcountries;"
psql -d osm_notes_dwh -c "SELECT COUNT(*) FROM dwh.datamartusers;"✅ Ready when:
dwhschema existsfactstable has data- Datamarts have data
References:
Estimated time: 30-45 minutes
cd ~/github/OSM-Notes
git clone --recurse-submodules https://github.com/OSM-Notes/OSM-Notes-WMS.git
cd OSM-Notes-WMS# Option A: Docker (recommended)
docker run -d -p 8080:8080 \
-e GEOSERVER_DATA_DIR=/opt/geoserver/data_dir \
-v geoserver_data:/opt/geoserver/data_dir \
kartoza/geoserver:latest
# Option B: Manual installation
# Download from https://geoserver.org/download/cp etc/wms.properties.sh.example etc/wms.properties.sh
nano etc/wms.properties.sh # Configure database and GeoServer
# Optional: etc/wms.properties.extras.sh.example -> wms.properties.extras.sh (see OSM-Notes-WMS etc/README.md)./bin/wms/wmsManager.sh install./bin/wms/geoserverConfig.sh install# Verify WMS schema
psql -d notes -c "SELECT COUNT(*) FROM wms.notes_wms;"
# Verify GeoServer
curl http://localhost:8080/geoserver/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities | grep -i "notes"✅ Ready when:
wmsschema exists- GeoServer responds with note layers
References:
Estimated time: 5-10 minutes (auto-generated)
cd ~/github/OSM-Notes/OSM-Notes-Analytics
./bin/dwh/exportAndPushJSONToGitHub.shThis script:
- Exports datamarts to JSON
- Validates against schemas
- Pushes to OSM-Notes-Data repository
- GitHub Pages updates automatically
# Verify that JSON files exist in repository
# Or visit: https://osm-notes.github.io/OSM-Notes-Data/data/metadata.json
curl https://osm-notes.github.io/OSM-Notes-Data/data/metadata.json✅ Ready when: metadata.json is accessible and has recent timestamp
References:
Estimated time: 20-30 minutes
cd ~/github/OSM-Notes
git clone https://github.com/OSM-Notes/OSM-Notes-API.git
cd OSM-Notes-APInpm installcp .env.example .env
nano .env # Configure Analytics database# Create read-only user for API
psql -d osm_notes_dwh << EOF
CREATE USER api_user WITH PASSWORD 'your_secure_password';
GRANT USAGE ON SCHEMA dwh TO api_user;
GRANT SELECT ON ALL TABLES IN SCHEMA dwh TO api_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA dwh GRANT SELECT ON TABLES TO api_user;
EOFnpm run build# Development
npm run dev
# Production
npm start# Health check
curl -H "User-Agent: TestApp/1.0 (test@example.com)" http://localhost:3000/health
# Test endpoint
curl -H "User-Agent: TestApp/1.0 (test@example.com)" http://localhost:3000/api/v1/analytics/global✅ Ready when: Health check returns OK and endpoints respond
References:
Estimated time: 15-20 minutes
cd ~/github/OSM-Notes
git clone --recurse-submodules https://github.com/OSM-Notes/OSM-Notes-Viewer.git
cd OSM-Notes-Viewernpm install# Edit config/api-config.js if you want Viewer to use API for enhanced features
# Default uses: https://osm-notes.github.io/OSM-Notes-Data/
# If API is available, you can configure it here for real-time data and advanced queriesNote: Viewer can work without API (uses static JSON from Data). API is optional and provides enhanced features like real-time data and advanced queries.
# Option 1: Vite (recommended)
npm run dev
# Option 2: Python
python3 -m http.server 8000
# Option 3: Node.js http-server
npx http-server src -p 8000# Project has GitHub Actions configured
# Just push to main branch
git push origin main# Open in browser
# Local: http://localhost:8000/src/index.html
# Production: https://notes.osm.lat/✅ Ready when: Viewer loads and displays data
References:
Estimated time: 30-45 minutes
cd ~/github/OSM-Notes
git clone --recurse-submodules https://github.com/OSM-Notes/OSM-Notes-Monitoring.git
cd OSM-Notes-Monitoringsudo -u postgres psql << EOF
CREATE DATABASE osm_notes_monitoring WITH OWNER notes;
\c osm_notes_monitoring
EOFpsql -d osm_notes_monitoring -f sql/init.sql
# Grant permissions
psql -d osm_notes_monitoring << EOF
GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN SCHEMA public TO notes;
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO notes;
EOFcp etc/properties.sh.example etc/properties.sh
nano etc/properties.sh # Configure access to all databasescp config/alerts.conf.example config/alerts.conf
nano config/alerts.conf # Configure emails, Slack, etc.# Monitor Ingestion
./bin/monitor/monitorIngestion.sh
# Monitor Analytics
./bin/monitor/monitorAnalytics.sh
# Monitor API
./bin/monitor/monitorAPI.sh# Verify metrics in database
psql -d osm_notes_monitoring -c "SELECT * FROM metrics ORDER BY collected_at DESC LIMIT 10;"✅ Ready when: Metrics are being collected
References:
Estimated time: 0 minutes (submodule)
# Already initialized automatically with --recurse-submodules
# If not, run:
cd ~/github/OSM-Notes/OSM-Notes-Ingestion # or any project that uses Common
git submodule update --init --recursive# Verify that Common exists
ls -la lib/osm-common/commonFunctions.sh✅ Ready when: Common files are present in lib/osm-common/
References:
# 1. Verify Ingestion
psql -d notes -c "SELECT COUNT(*) FROM notes;" # Must be > 0
# 2. Verify Analytics
psql -d osm_notes_dwh -c "SELECT COUNT(*) FROM dwh.facts;" # Must be > 0
# 3. Verify WMS
psql -d notes -c "SELECT COUNT(*) FROM wms.notes_wms;" # Must be > 0
# 4. Verify Data
curl -s https://osm-notes.github.io/OSM-Notes-Data/data/metadata.json | jq .export_timestamp
# 5. Verify API
curl -H "User-Agent: Test/1.0 (test@example.com)" http://localhost:3000/health
# 6. Verify Viewer
curl -s https://notes.osm.lat/ | grep -i "osm notes"
# 7. Verify Monitoring
psql -d osm_notes_monitoring -c "SELECT COUNT(*) FROM metrics;" # Must be > 0Cause: Analytics did not run correctly
Solution:
cd OSM-Notes-Analytics
./bin/dwh/ETL.shCause: Ingestion did not run correctly
Solution:
cd OSM-Notes-Ingestion
./bin/process/processAPINotes.shCause: PostgreSQL is not running or incorrect credentials
Solution:
# Verify PostgreSQL
sudo systemctl status postgresql
# Verify credentials in etc/properties.sh
psql -d notes -U notes -c "SELECT 1;"Cause: Submodule was not initialized
Solution:
git submodule update --init --recursiveCause: Data too large or insufficient resources
Solution:
- Increase
ETL_MAX_PARALLEL_JOBSinetc/etl.properties - Verify system resources (CPU, RAM, disk)
# Ingestion - Daemon mode (recommended) or every 15 min
*/15 * * * * ~/OSM-Notes-Ingestion/bin/process/processAPINotes.sh
# Analytics ETL - Every hour
0 * * * * ~/OSM-Notes-Analytics/bin/dwh/ETL.sh
# Datamarts - Daily
0 2 * * * ~/OSM-Notes-Analytics/bin/dwh/datamartCountries/datamartCountries.sh
30 2 * * * ~/OSM-Notes-Analytics/bin/dwh/datamartUsers/datamartUsers.sh
# Export JSON - Every 15 minutes (after datamarts)
45 2 * * * ~/OSM-Notes-Analytics/bin/dwh/exportAndPushJSONToGitHub.sh
# Monitoring - Every 5 minutes
*/5 * * * * ~/OSM-Notes-Monitoring/bin/monitor/monitorIngestion.sh
*/5 * * * * ~/OSM-Notes-Monitoring/bin/monitor/monitorAnalytics.sh# Ingestion daemon (already configured in Step 1)
sudo systemctl status osm-notes-ingestion-daemon
# API (if using PM2)
pm2 start npm --name "osm-notes-api" -- start
pm2 save
pm2 startup| Scenario | Total Time |
|---|---|
| Minimum installation (Ingestion only) | 30-60 min |
| Basic installation (Ingestion + Analytics) | 2-3 hours |
| Complete installation (all projects) | 4-6 hours |
| First historical data load | +3-4 hours |
- OSM Notes Ecosystem - Landing page
- Global Glossary - Terms and definitions
- Data Flow - End-to-end flow
- Decision Guide - Which project do I need?
Last updated: 2026-01-25
Maintained by: OSM Notes Community