Easy Steps to Install Apache Nifi on Ubuntu 20.04


In this article, we will go through the steps to install Apache Nifi on Ubuntu 20.04. Nifi is an open source Apache Project built to automate the flow of data between Systems. Since Nifi is a Java based project so it executes within a JVM on a host operating system. It provides a web based interface to create, monitor and control data flow between Systems.

Easy Steps to Install Apache Nifi on Ubuntu 20.04

Easy Steps to Install Apache Nifi on Ubuntu 20.04

Also Read: Step by Step Guide to Deploy a website on GKE(Google Kubernetes Engine)

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 Server.

b) You should have sudo or root access to run privileged commands.

c) You should have OpenJDK 11 installed in your Server.

d) You should have apt or apt-get, wget and tar utility installed in your Server.

Step 2: Update Your Server

If you have not updated your Ubuntu Server from long time, then it is always a good idea to run the update once using apt-get update command. This will synchronize your installed packages with the latest version.

root@localhost:~# apt-get update
Get:1 focal-security InRelease [109 kB]
Hit:2 focal InRelease
Get:3 focal-updates InRelease [114 kB]
Get:4 focal-backports InRelease [101 kB]
Get:5 focal-updates/main amd64 Packages [983 kB]
Get:6 focal-security/main amd64 Packages [655 kB]
Get:7 focal-updates/main i386 Packages [474 kB]
Get:8 focal-updates/main Translation-en [222 kB]
Get:9 focal-updates/main amd64 DEP-11 Metadata [263 kB]
Get:10 focal-updates/main DEP-11 48x48 Icons [55.6 kB]
Get:11 focal-updates/main DEP-11 64x64 Icons [87.9 kB]
Get:12 focal-updates/main amd64 c-n-f Metadata [13.3 kB]
Get:13 focal-updates/restricted amd64 Packages [226 kB]
Get:14 focal-updates/restricted Translation-en [33.3 kB]
Get:15 focal-updates/universe i386 Packages [572 kB]
Get:16 focal-updates/universe amd64 Packages [774 kB]
Get:17 focal-updates/universe Translation-en [166 kB]
Get:18 focal-updates/universe amd64 DEP-11 Metadata [323 kB]
Get:19 focal-updates/universe DEP-11 48x48 Icons [204 kB]
Get:20 focal-updates/universe DEP-11 64x64 Icons [362 kB]
Get:21 focal-updates/universe amd64 c-n-f Metadata [17.4 kB]


Step 3: Download Apache Nifi Using wget

You can download latest Apache Nifi version from Download Page using wget utility as shown below. Then you can verify the downloaded package using ls -ltr nifi-1.13.2-bin.tar.gz command.

root@localhost:~# wget
--2021-05-15 20:24:09--
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1576430190 (1.5G) [application/x-gzip]
Saving to: ‘nifi-1.13.2-bin.tar.gz’

nifi-1.13.2-bin.tar.gz 100%[============================================================================>] 1.47G 2.40MB/s in 11m 6s

2021-05-15 20:35:16 (2.26 MB/s) - ‘nifi-1.13.2-bin.tar.gz’ saved [1576430190/1576430190]

root@localhost:~# ls -ltr nifi-1.13.2-bin.tar.gz
-rw-r--r-- 1 root root 1576430190 Mar 18 10:57 nifi-1.13.2-bin.tar.gz


Step 4: Extract Package using tar utility

Since we have downloaded the package in compressed format, so we need to extract it first. You can extract it by using tar -xvf nifi-1.13.2-bin.tar.gz command as shown below. It will extract all the packages in current directory.

root@localhost:~# tar -xvf nifi-1.13.2-bin.tar.gz


Step 5: Set JAVA_HOME Path

If you don't have JAVA_HOME environment variable set, then you need to set it with the OpenJDK path. In my setup it is on /usr/lib/jvm/java-11-openjdk-amd64/, so we will set the variable path and export it using below given command.

root@localhost:~# export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/

Once set you can verify the path by using echo $JAVA_HOME command. You can also set JAVA_HOME variable inside file to avoid setting it again and again from the command line. You can find file under extracted bin/ directory.

root@localhost:~# echo $JAVA_HOME


Step 6: Start Apache Nifi

Then go to Nifi bin directory and start the Server by using ./ start command as mentioned below. By default it will start listening on Port 8080. So you need to make sure this port is not blocked in your Firewall. If it is indeed block, then you can simply allow this port using ufw allow 8080 command.

root@localhost:~# cd nifi-1.13.2/bin/
root@localhost:~/nifi-1.13.2/bin# ./ start

Java home: /usr/lib/jvm/java-11-openjdk-amd64/
NiFi home: /root/nifi-1.13.2

Bootstrap Config File: /root/nifi-1.13.2/conf/bootstrap.conf


Please be very careful on allowing port from firewall in Production environment.

Now you can Go to your Browser and open localhost:8080/nifi URL as shown below.

Easy Steps to Install Apache Nifi on Ubuntu 20.04 2

Step 7: Stop Apache Nifi

If you want to stop Apache Nifi Server, then you need to use ./ stop command as shown below.

root@localhost:~/nifi-1.13.2/bin# ./ stop

Java home: /usr/lib/jvm/java-11-openjdk-amd64/
NiFi home: /root/nifi-1.13.2

Bootstrap Config File: /root/nifi-1.13.2/conf/bootstrap.conf

2021-05-15 22:04:27,944 INFO [main] org.apache.nifi.bootstrap.Command Apache NiFi has accepted the Shutdown Command and is shutting down now
2021-05-15 22:04:28,181 INFO [main] org.apache.nifi.bootstrap.Command Waiting for Apache NiFi to finish shutting down...
2021-05-15 22:04:30,194 INFO [main] org.apache.nifi.bootstrap.Command Waiting for Apache NiFi to finish shutting down...
2021-05-15 22:04:32,203 INFO [main] org.apache.nifi.bootstrap.Command NiFi has finished shutting down.

Leave a Comment