Osm2pgsql works on Linux, Windows, and macOS. We recommend you always use the latest released versions, currently version 1.3.0.

Installing on Linux

There are packages of osm2pgsql available for many different Linux distributions. Some of them are quite old, though, and have known bugs. If the current release is not available for your distribution, consider installing the current release from source.

Installing on Debian/Ubuntu

For Debian/Ubuntu installation is usually as simple as

apt install osm2pgsql

If you are using Debian Stable, we recommend using the packages from backports. Debian maintainers are really good at keeping these up-to-date.

Installing on Fedora

Fedora has packages of osm2pgsql available. Install with

dnf install osm2pgsql

Installing from Source / Git

If you can’t use the packaged version of osm2pgsql for your distribution, you can always install from source.

See the Building section in the README.md for a list of dependencies and build instructions.

Installing on Windows

Using prebuild binaries

You can download prebuild binaries. Unpack the ZIP file and you can immediately use osm2pgsql.

Compiling from source

For native Windows compilation you need a C++11-compatible compiler. Visual Studio 2017 & 2015 are known to work. Follow the usual steps for compiling CMake projects.

Installing on macOS

Osm2pgsql is available on Homebrew. Install with

brew install osm2pgsql