We stand with Ukraine
Go Wombat logo

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

Article by

Updated on September 24, 2021

Read — 2 minutes

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.

Comparison of prices

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

A look at the most cost effective 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.

How can we help you ?

How can we help youHow can we help youHow can we help you