A fast, simple IP geolocation API service using DB-IP's City Lite database. Get city, country, and location data for any IP address.
- 🌍 IP Geolocation lookup with city/country data
- 🚀 Fast responses with in-memory DB
- 🔄 Cloudflare-aware client IP detection
- 🌐 CORS enabled for browser usage
- 🐳 Docker ready with multi-arch support
curl http://localhost:8080/curl http://localhost:8080/8.8.8.8{
"ip": "8.8.8.8",
"city": "Mountain View",
"region": "California",
"country": "US",
"country_full": "United States",
"continent": "NA",
"continent_full": "North America",
"loc": "37.4056,-122.0775",
"postal": "94043"
}- Docker and Docker Compose
- ~60MB disk space for the MMDB database
-
Clone the repository:
git clone https://github.com/bravo68web/ip.dev.git cd ip.dev -
Download the MMDB database:
bash fetch_mmdb.sh
-
Start with Docker Compose:
docker compose up -d
-
Test the service:
curl http://localhost:8080/self
PORT- Server port (default: 8080)MMDB_PATH- Path to MMDB file (default: /app/data/GeoLite2-City.mmdb)
version: "3.9"
services:
ip_service:
image: ghcr.io/bravo68web/ip.dev:latest # or build: .
ports:
- "8080:8080" # Change left side to customize port
environment:
- MMDB_PATH=/app/data/GeoLite2-City.mmdb
volumes:
- ./data:/app/data:rw # Mount for database persistence
restart: unless-stoppedIf you prefer to build the image yourself:
# Download MMDB
bash fetch_mmdb.sh
# Build and run
docker compose build
docker compose up -dMIT License - See LICENSE for details.
- DB-IP for the IP geolocation database
- Database licensed under Creative Commons Attribution 4.0