The main Nixpacks commands are build and plan.


Create an image from an app source directory. The resulting image can then be run using Docker.

For example

nixpacks build ./path/to/app --name my-app

View all build options with

nixpacks build --help


--install-cmd <cmd>, -iSpecify the install command
--build-cmd <cmd>, -bSpecify the build command
--start-cmd <cmd>, -sSpecify the start command
--name <name>Name for the built image
--env <envs...>Provide environment variables to your build.
--pkgs <pkgs...>, -pProvide additional Nix packages to install in the environment
--apt <pkgs...>Provide additional apt packages to install in the environment
--libs <libs...>Provide additional Nix libraries to install in the environment
--tag <tag...>, -tAdditional tags to add to the output image
--label <labels...>, -lAdditional labels to add to the output image
--cache-key <key>Unique identifier to use for the build cache
--no-cacheDisable caching for the build
--cache-fromImage to consider as cache sources
--inline-cacheEnable writing cache metadata into the output image
--out <dir>, -oSave output directory instead of building it with Docker
--platform <platforms...>Choosing the target platform for the target environment
--config <file>Location of the Nixpacks configuration file relative to the root of the app

Environment Variables#

Environment variables can be provided in the format FOO or FOO=bar. If no equal sign is present then the value is pulled from the current environment.


The plan command will show the full set of options (nix packages, build cmd, start cmd, etc) that will be used to when building the app. This plan can be saved and used to build the app with the same configuration at a future date.

For example,

nixpacks plan examples/node

By default, the plan is output in JSON format. You can output in TOML format with the --format toml option.

View all plan options with

nixpacks plan --help


For a full list of CLI commands run

nixpacks --help