Run Apache NiFi in Docker

Running Apache NiFi in Docker is a simple and hassle-free process if you know the port to access. This article explains how to get Apache NiFi running in Docker on a Linux machine. If you don't have already, install Docker first.

Run Apache NiFi in Docker

Step 1:
Pull the latest Nifi image from the docker repository.

docker pull apache/nifi:latest

Step 2:
Run Apache Nifi as a docker container.
docker run --name nifi -p 8443:8443 -e NIFI_WEB_HTTPS_PORT='8443' -d apache/nifi:latest

Step 3:
Run the following command to get the NiFi logs from the Docker container.
docker logs -f nifi

Step 4:
Look for the following line to get the port Apache NiFi is running.
INFO [main] org.apache.nifi.web.server.JettyServer https://4cdc79d1487f:8443/nifi
Above line tells that the NiFi frontend is running at port number 8443. This port number must be same as the port number defined in Step 2.

Scroll further up and look for the lines with the temporary username and password.
Generated Username [xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]
Generated Password [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]
Copy the username and password.

In a production environment, the username and password must be configured manually. However, the scope of this article is limited to just spinning up a NiFi container for testing. Therefore, we can continue with the temporary username and password.
To change the username and password, use the following command:
docker run --name nifi -p 8443:8443 -e SINGLE_USER_CREDENTIALS_USERNAME=admin -e SINGLE_USER_CREDENTIALS_PASSWORD=ctsBtRBKHRAx69EqUghvvgEvjnaLjFEB -d apache/nifi:latest

Step 5:
Visit https://localhost:8443/nifi. The browser may wan you that the connection is not private because the SSL certificate is not valid. Ignore the warning and proceed to the site.
Run Apache NiFi in Docker

Step 6:
Use the username and password copied in Step 4 to log in to the Apache NiFi dashboard.

Run Apache NiFi in Docker

If you have any problems getting this working or if you find this article helpful, please leave a comment below. To run Apache NiFi as a cluster in Docker, read the next article: Run Apache NiFi Cluster in Docker.
Next Post »

Contact Form


Email *

Message *