Aptfile Buildpack on App Platform

App Platform is a Platform-as-a-Service (PaaS) offering that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure.

How App Platform Builds Images

App Platform supports two ways to build an image for your app: Cloud Native Buildpacks and Dockerfiles.

When you give App Platform access to your code, it defaults to using a Dockerfile if one is present in the root of the directory or specified in the app spec. Otherwise, App Platform checks your code to determine what language or framework it uses. If it supports the language or framework, it chooses an appropriate resource type and uses the proper buildpack to build the app and deploy a container.

When you use the Aptfile buildpack, DigitalOcean’s version of the heroku-buildpack-apt buildpack detects and builds your applications.

Aptfile is meant to be used with other buildpacks and declare Ubuntu system-level packages that App Platform installs during the app’s build process. This is different from declaring dependencies in a Pipfile (Python) or package.json (Node.js) file that declare application-level dependencies.

Aptfile Applications using Buildpacks

App Platform looks for a file named Aptfile (no file extension) to detect an application requiring system packages. If this file is detected, the heroku-buildpack-apt buildpack is used to install any packages listed in the Aptfile during the build process.

The following example Aptfile declares three system packages to install:



This example installs:

  • libpq-dev: A library for PostgreSQL applications.
  • imagemagick: A command-line tool for image processing.
  • curl: A command line tool for making HTTP requests.


  • Shared libraries and packages with components installed outside common directories like /lib and /bin may not be accessible to apps at runtime. For example, FFmpeg requires installing additional packages for certain codecs in directories that are not available to the app.