How do I install GDAL on Heroku?


My app requires gdal libraries installed in the OS in order to work


The Heroku community supported buildpack, heroku-buildpack-apt adds support for installing packages from apt (such as GDAL) during build. You can add it to your project by following these steps:

Add the buildpack:

$ heroku buildpacks:add --index 1 heroku-community/apt

Create a file in your application root called Aptfile with the gdal dependency:



Commit and deploy:

$ git add Aptfile  
$ git commit -m "Add apt dependency"
$ git push heroku master
$ heroku run bash  
Running bash on  morning-plains-93483... up, run.2593 (Free)
~ $ which ogr2ogr

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support