Self-hosted Open-Source Cheap alternative for Google Maps API services

If you need to embed a map on your site or add address autocomplete, Google Maps is usually the first option that comes to mind. It is the quickest to integrate, but at high request volumes the Google Maps API becomes expensive. At Go Wombat we look for cheaper options for our clients, and a self-hosted, open-source stack is one of them.
The alternative is OpenStreetMap (OSM). It takes more effort to set up, but you get full control over it, and you pay for the server plus the time to maintain it and keep the OSM data up to date. For applications with a heavy load, this can be much cheaper.
Price comparison
Google Maps API
According to Google Maps Platform pricing, the Geocoding API costs $5 per 1,000 requests up to 100,000 requests a month and $4 per 1,000 up to 500,000, and the first 10,000 requests each month are free. So 500,000 requests a month cost about $2,050.
Google Maps Services price calculator
DigitalOcean Server
According to DigitalOcean's pricing page, the cheapest Basic Droplet costs $4 per month and has 512 MiB of RAM, which is not enough for 500,000 requests a month. A Droplet with 8 GiB RAM, 4 vCPUs and a 160 GiB SSD costs $48 per month. The largest Storage-Optimized Droplet, with 256 GiB RAM, 32 vCPUs and a 4,690 GiB SSD, costs $2,096 per month.
Tools to use
We used Photon for search-as-you-type with multilingual support and geocoding. Photon is an open-source geocoder built for OpenStreetMap data. It was originally built on Elasticsearch; current versions run on OpenSearch. A planet-wide index needs about 95 GB of disk space.
You can also use Nominatim for geocoding, but we found Photon simpler to set up and use.
OSM Tile Server
To go fully self-hosted, you also need to render the map yourself, which means setting up an OSM Tile Server.
The main problem here is storage. How much disk space a tile server needs depends on the area you cover and on whether you pre-render tiles, and for a large area the extra DigitalOcean Volume storage adds to the monthly bill.
Cheapest solution
Pricing for Google Maps Embed API
The Google Maps Embed API is free, so the cheapest option is to use it to display the map and run your own Photon instance for geocoding and autocomplete.
- - -
If you have any questions, let us know.
Share and subscribe to our blog
Related articles

How To Use SSH Tunnel To Expose A Local Server To Internet
How we expose an internal tool on a local Go Wombat server to the internet through a reverse SSH tunnel, with AutoSSH and a systemd service.

How to Properly Use Serverless Technologies and AWS Lambda
Why AWS Lambda suits small, independent functions, with a Python example that invokes Lambda functions concurrently to fetch crypto exchange rates via CCXT.

Voice AI Is Easy to Demo, Hard to Productise
AI makes the first voice demo fast, but not the production-grade product. What our internal open-source voice AI challenge showed about where the engineering work begins.
How can we help you ?



