jChat LogojChat Docs
Operations & Maintenance

GeoIP Database Maintenance

Keep country, city, and ISP location databases accurate for fraud detection and user analytics.

Updating the GeoIP Database

JChat includes an offline country geolocation database to detect user locations without external API lookups or latency penalty. The database is pre-bundled in official release distributions and persisted across restarts via the persistent data volume.

To update or refresh the country database at any time, execute the maintenance command matching your deployment mode:

# For Docker deployments:
docker compose exec jchat bun run update:geoip
# For standalone Linux / Bare-Metal deployments:
bun run update:geoip

Automating Periodic Refreshes

MaxMind regularly updates GeoLite2 country records. To keep geolocation accurate over time, set up a monthly cron job on your host server:

# Refresh GeoLite2 database monthly on the 1st at 03:00 UTC:
0 3 1 * * cd /opt/jchat && docker compose exec -T jchat bun run update:geoip
# Refresh GeoLite2 database monthly on the 1st at 03:00 UTC:
0 3 1 * * cd /opt/jchat && bun run update:geoip

On this page