Run Newman with Docker on macOS, Ubuntu, and Windows
Docker is a platform for building and running applications in a virtual environment. You can use Newman to run your Postman Collections in a Docker container. When running collections in Docker, you can use all available Newman command options and run local collection files.
Use Newman with Docker on macOS and Ubuntu
To use Newman with Docker for macOS or Ubuntu, do the following:
-
Make sure Docker is installed and running on your system. Go to Get Docker, choose your operating system, and follow the instructions.
-
To test your Docker installation, run the following command:
-
Pull the Newman Docker image from Docker hub:
-
Run Newman commands on the image. For example, to run a collection, use the collection ID and your Postman API key:
-
To get the collection ID, select a collection in the sidebar. Click
Info and copy the ID.
-
To get an API key, go to Generate a Postman API key.
-
The collection runs in Newman, and the output displays in the terminal.
The entry point to the Docker image is Newman, so you can use all Newman command line parameters. You can also run locally stored collection files. The Newman Docker documentation describes how to mount shared data volumes.
Use Newman with Docker on Windows
To learn more about using Newman with Docker on Windows, go to Using the Newman Docker Image in Windows.
Next steps
For more information about running Postman Collection runs, see the following: