macOS
brew install osm2pgsqllocal Homebrew formula metadata
sudo port install osm2pgsqlMacPorts ports tree · gis/osm2pgsql/Portfile · source: api.github.com
brew
OpenStreetMap data to PostgreSQL converter. Version 2.3.1 via Homebrew; verified 2026-07-05.
install
brew install osm2pgsqllocal Homebrew formula metadata
sudo port install osm2pgsqlMacPorts ports tree · gis/osm2pgsql/Portfile · source: api.github.com
sudo apt install osm2pgsqlDebian stable package indexes · osm2pgsql · source: deb.debian.org
sudo dnf install osm2pgsqlFedora Rawhide package metadata · osm2pgsql · source: dl.fedoraproject.org
nix profile install nixpkgs#osm2pgsqlnixpkgs package indexes · pkgs/by-name/os/osm2pgsql/package.nix · source: api.github.com
sudo pacman -S osm2pgsqlArch Linux sync databases · osm2pgsql · source: geo.mirror.pkgbuild.com
overview
OpenStreetMap data to PostgreSQL converter
history
osm2pgsql is one of the central OpenStreetMap data-ingestion tools. It imports OSM data into PostgreSQL/PostGIS, where renderers, geocoders, analysis jobs, and custom SQL pipelines can work with planet-scale map data.
The osm2pgsql project began in 2006, started by Jon Burgess and written in C, making it nearly as old as OpenStreetMap itself. In 2007, after OSM moved to API 0.5 and added relations, osm2pgsql gained multipolygon relation support and multiple projection support.
In 2008, osm2pgsql added support for OSM change files. From 2009, the main OpenStreetMap map was regenerated from minutely changes using a toolchain that imported data with osm2pgsql into PostgreSQL/PostGIS and rendered tiles with Mapnik.
The project kept following OSM's growth. In 2011, it switched to 64-bit IDs as the OSM node count passed one billion, and Kai Krueger took over maintainership from Jon Burgess. In 2012, the flat-file persistent node cache for slim mode reduced disk usage and improved import/update performance.
A long modernization arc followed: parsing moved to libosmium in 2015, geometry generation moved to libosmium in 2017, LuaJIT support arrived in 2018, version 1.0 in 2019 removed old-style multipolygon processing, and the flex output introduced in 2020 made custom output-table design a first-class workflow.
The 2022 experimental `osm2pgsql-gen` command brought generalization into the project. In 2023, a JSONB-based middle database format made it possible to store all OSM data including tags, attributes, and relation-member information. In 2024, Nominatim switched to flex output, the old gazetteer output was removed, and osm2pgsql 2.0 shipped.
osm2pgsql became deeply embedded because it solved the hard practical problem of keeping PostgreSQL/PostGIS databases synchronized with OSM data at rendering scale. The project history explicitly ties it to the OpenStreetMap tile toolchain and to Nominatim, the geocoder powering search on openstreetmap.org and many other map sites.
The GitHub repository passed 1,000 stars in 2021 according to the project's own history page. The Homebrew formula and package-manager metadata show distribution through Homebrew, Debian, Fedora, MacPorts, Nix, Arch, Ubuntu, and openSUSE-family packaging.
The manual describes osm2pgsql as a specialized ETL tool for OSM data. Users usually feed it regional extracts or planet files, tune memory and disk behavior, choose pgsql or flex output, and then connect downstream software for rendering, serving, geocoding, or analysis.
The manual also warns that whole-planet imports can run for hours or days and recommends trial runs on small extracts. That operational reality is part of osm2pgsql's identity: it is not just a converter, but a tool whose schema, cache, update, and style choices determine the shape and cost of an OSM database.
osm2pgsql is package-nerd gold because it sits at the junction of C++, libosmium, Lua/LuaJIT, PostgreSQL, PostGIS, and large public datasets. Small version changes can affect import speed, schema output, multipolygon behavior, replication workflows, and downstream projects such as Nominatim or map renderers.
Its history also mirrors the OpenStreetMap ecosystem's scaling story: from early XML imports, through minutely updates and 64-bit IDs, into flexible Lua-defined outputs and JSONB-backed middle storage.
security posture
broad file, network, media, or database tool signal. generalized runtime or code generation signal.
yellow risk · medium confidence · runtime
Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.
executables
| Command | Kind | Exposure | Note |
|---|---|---|---|
osm2pgsql | cli | global executable | |
osm2pgsql-replication | cli | global executable |
freshness
These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.
https://github.com/osm2pgsql-dev/osm2pgsql
install metadata
| Package key | brew:osm2pgsql |
|---|---|
| Version | 2.3.1 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/osm2pgsql |
| Homepage | https://osm2pgsql.org |
| Repository | https://github.com/osm2pgsql-dev/osm2pgsql |
| Upstream docs | https://osm2pgsql.org/doc |
| License | GPL-2.0-or-later |
| Source archive | https://github.com/osm2pgsql-dev/osm2pgsql/archive/refs/tags/2.3.1.tar.gz |
| Last updated | 2026-07-05T16:19:51Z |
| Pulse | updated |
| Dependencies | libpq, luajit, proj |
| Build dependencies | boost, cli11, cmake, fmt, libosmium, lua, nlohmann-json, protozero |
| Uses from macOS | bzip2, expat |
| Bottle | available (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
registry facts
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | osm2pgsql |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
source database matches
Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.
osm2pgsql 2.1.1+ds-1
OpenStreetMap data to PostgreSQL converter
sudo apt install osm2pgsqlosm2pgsql
nix profile install nixpkgs#osm2pgsqlosm2pgsql 1.11.0+ds-1
OpenStreetMap data to PostgreSQL converter
sudo apt install osm2pgsqlosm2pgsql 2.2.0-4.fc45
Import map data from OpenStreetMap to a PostgreSQL database
sudo dnf install osm2pgsqlosm2pgsql 2.2.0-2
tool for loading OpenStreetMap data into a PostgreSQL / PostGIS database
sudo pacman -S osm2pgsqlosm2pgsql
sudo port install osm2pgsqlsource trail
This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.