How to Install Apache Flink on Ubuntu 26.04 LTS (2026)

How to Install Apache Flink on Ubuntu 26.04 LTS (2026)

Apache Flink is a distributed stream- and batch-processing engine used for real-time analytics, event-driven applications, and large-scale data pipelines. This guide walks through installing Apache Flink 2.3.0 — the current stable release — on Ubuntu 26.04 LTS, covering both a standalone single-node setup for development and a standalone cluster layout for production-style testing.

By the end of this tutorial you’ll have a running Flink JobManager and TaskManager, access to the Flink Web UI, and a submitted example job proving the cluster works end to end.

Table of Contents

  1. Prerequisites
  2. Installation Methods Compared
  3. Architecture: How Flink Processes Data
  4. Method 1: Standalone Installation from Binary Archive (Recommended)
  5. Method 2: Running Flink with Docker
  6. Configuring Flink
  7. Starting the Cluster
  8. Accessing the Flink Web UI
  9. Submitting Your First Flink Job
  10. Setting Up a Multi-Node Standalone Cluster
  11. Running Flink as a systemd Service
  12. Troubleshooting
  13. Uninstalling Flink
  14. FAQ
  15. Related Reads on bckinfo.com

Prerequisites

Before installing Flink, make sure your Ubuntu 26.04 LTS system meets the following requirements:

  • A user account with sudo privileges
  • An active internet connection
  • JDK 17 or JDK 21 — Flink 2.x dropped support for Java 8 and Java 11, so a modern LTS JDK is mandatory
  • At least 2 GB of free RAM for a minimal local setup (production clusters need considerably more, depending on job parallelism)
  • A dedicated, non-root system user for running Flink is recommended for production installs

Step 1 — Install OpenJDK 21

sudo apt update
sudo apt install -y openjdk-21-jdk

Verify the installation:

java -version

Expected output:

openjdk version "21.0.x" 2026-xx-xx
OpenJDK Runtime Environment (build 21.0.x+xx-Ubuntu-x)
OpenJDK 64-Bit Server VM (build 21.0.x+xx-Ubuntu-x, mixed mode, sharing)

Step 2 — Install supporting utilities

sudo apt install -y wget tar

Installation Methods Compared

MethodBest ForVersion FreshnessCluster-ReadyRoot Required
Standalone BinaryDevelopment, learning, bare-metal/VM clustersPinned to whatever archive you downloadYes, with manual masters/workers configNo (can run under an unprivileged user)
DockerQuick local testing, CI pipelines, ephemeral environmentsWhatever tag you pullYes, via Docker ComposeDepends on Docker setup
Kubernetes OperatorProduction clusters already on KubernetesLatest, via Helm/operator versioningNativeNo (namespace-scoped)

This guide focuses on Method 1 (standalone binary) since it gives you the clearest picture of how Flink’s components fit together, and Method 2 (Docker) as a fast alternative for local testing. If you’re deploying Flink onto an existing Kubernetes cluster, look into the official Flink Kubernetes Operator (currently at 1.15) instead.

Architecture: How Flink Processes Data

Flink separates job coordination from job execution. The JobManager handles scheduling, checkpoint coordination, and resource negotiation, while one or more TaskManagers actually execute the data processing tasks (subtasks) in parallel slots.

                     ┌───────────────────────────────────────────────┐
                     │              Ubuntu 26.04 LTS Host(s)         │
                     │                                               │
                     │   ┌────────────────────────────────────────┐  │
                     │   │              JobManager                │  │
                     │   │  ────────────────────────────────────  │  │
                     │   │  Dispatcher  │ ResourceManager         │  │
                     │   │  JobMaster   │ Checkpoint Coordinator  │  │
                     │   │  Flink Web UI (port 8081)              │  │
                     │   └──────────────────┬─────────────────────┘  │
                     │                      │ schedules tasks        │
                     │        ┌─────────────┼─────────────┐          │
                     │        ▼             ▼             ▼          │
                     │  ┌───────────┐ ┌───────────┐ ┌───────────┐    │
                     │  │TaskManager│ │TaskManager│ │TaskManager│    │
                     │  │  Slot 1   │ │  Slot 1   │ │  Slot 1   │    │
                     │  │  Slot 2   │ │  Slot 2   │ │  Slot 2   │    │
                     │  └───────────┘ └───────────┘ └───────────┘    │
                     │                                               │
                     └───────────────────────────────────────────────┘
                                          │
                                          ▼
                         Sources (Kafka, files, sockets) →
                         Transformations (map, window, join) →
                         Sinks (Kafka, files, databases)

Each TaskManager offers a configurable number of task slots, and Flink’s scheduler distributes parallel subtasks of your job across those slots — this is the core mechanism behind Flink’s horizontal scalability.

Method 1: Standalone Installation from Binary Archive (Recommended)

Step 1 — Download the binary distribution

cd /tmp
wget https://dlcdn.apache.org/flink/flink-2.3.0/flink-2.3.0-bin-scala_2.12.tgz

Step 2 — Verify the download (recommended)

Always verify release artifacts against the published checksum before extracting:

wget https://downloads.apache.org/flink/flink-2.3.0/flink-2.3.0-bin-scala_2.12.tgz.sha512
sha512sum -c flink-2.3.0-bin-scala_2.12.tgz.sha512

Step 3 — Extract and install to /opt

sudo mkdir -p /opt/flink
sudo tar -xzf flink-2.3.0-bin-scala_2.12.tgz -C /opt/flink --strip-components=1

Step 4 — Create a dedicated Flink user (recommended for production)

sudo useradd -r -m -d /opt/flink -s /bin/bash flink
sudo chown -R flink:flink /opt/flink

Step 5 — Set environment variables

sudo nano /etc/profile.d/flink.sh

Add the following:

export FLINK_HOME=/opt/flink
export PATH=$FLINK_HOME/bin:$PATH

Apply the changes:

sudo chmod +x /etc/profile.d/flink.sh
source /etc/profile.d/flink.sh

Method 2: Running Flink with Docker

For fast local testing without touching the host filesystem, use the official Flink Docker images with Docker Compose.

Step 1 — Install Docker (if not already installed)

sudo apt update
sudo apt install -y docker.io docker-compose-v2
sudo systemctl enable --now docker

Step 2 — Create a Docker Compose file

mkdir ~/flink-docker && cd ~/flink-docker
nano docker-compose.yml
version: "3.8"
services:
  jobmanager:
    image: flink:2.3.0-scala_2.12-java21
    ports:
      - "8081:8081"
    command: jobmanager
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
  taskmanager:
    image: flink:2.3.0-scala_2.12-java21
    depends_on:
      - jobmanager
    command: taskmanager
    scale: 2
    environment:
      - |
        FLINK_PROPERTIES=
        jobmanager.rpc.address: jobmanager
        taskmanager.numberOfTaskSlots: 2

Step 3 — Start the cluster

docker compose up -d

The Flink Web UI will be reachable at http://localhost:8081, identical to the standalone install.

Configuring Flink

Flink’s main configuration file lives at $FLINK_HOME/conf/config.yaml (Flink 2.x moved from the legacy flink-conf.yaml key-value format to a structured YAML file). Key settings to review before starting the cluster:

jobmanager:
  rpc:
    address: localhost
  memory:
    process:
      size: 1600m

taskmanager:
  memory:
    process:
      size: 1728m
  numberOfTaskSlots: 2

parallelism:
  default: 2

Adjust jobmanager.memory.process.size and taskmanager.memory.process.size based on available host RAM, and increase numberOfTaskSlots on TaskManagers with more CPU cores available.

Starting the Cluster

Start the standalone cluster with the bundled script:

$FLINK_HOME/bin/start-cluster.sh

Confirm the JobManager and TaskManager processes are running:

jps

Expected output includes:

12345 StandaloneSessionClusterEntrypoint
12456 TaskManagerRunner

To stop the cluster later:

$FLINK_HOME/bin/stop-cluster.sh

Accessing the Flink Web UI

Open a browser and navigate to:

http://<your-server-ip>:8081

The Web UI shows running and completed jobs, TaskManager metrics, checkpoint history, and lets you cancel or inspect jobs without touching the CLI. If accessing remotely, either open port 8081 in your firewall/security group or tunnel it over SSH:

ssh -L 8081:localhost:8081 user@your-server-ip

Submitting Your First Flink Job

Flink ships with example JARs you can use to validate the cluster end to end.

Step 1 — Run the WordCount batch example

$FLINK_HOME/bin/flink run $FLINK_HOME/examples/batch/WordCount.jar

Step 2 — Run a streaming example

$FLINK_HOME/bin/flink run $FLINK_HOME/examples/streaming/WordCount.jar

Step 3 — Confirm the job in the Web UI

Navigate to http://<your-server-ip>:8081/#/job-manager/jobs — the completed job should appear in the Completed Jobs list with its execution graph and metrics.

Step 4 — Check job output in the logs

tail -f $FLINK_HOME/log/flink-*-taskexecutor-*.out

Setting Up a Multi-Node Standalone Cluster

For a production-style test across multiple Ubuntu 26.04 LTS hosts:

Step 1 — Install Flink identically on every node

Repeat Method 1 on each host, using the same FLINK_HOME path and Flink version everywhere.

Step 2 — Configure masters and workers

On the JobManager node, edit:

nano $FLINK_HOME/conf/masters
jobmanager-host:8081
nano $FLINK_HOME/conf/workers
taskmanager-host-1
taskmanager-host-2
taskmanager-host-3

Step 3 — Set up passwordless SSH from the JobManager to every TaskManager

ssh-keygen -t ed25519
ssh-copy-id flink@taskmanager-host-1
ssh-copy-id flink@taskmanager-host-2

Step 4 — Start the whole cluster from the JobManager node

$FLINK_HOME/bin/start-cluster.sh

This script SSHes into every host listed in workers and starts a TaskManager process there automatically.

Running Flink as a systemd Service

For a standalone JobManager that survives reboots, create a systemd unit instead of relying on manual script invocation:

sudo nano /etc/systemd/system/flink-jobmanager.service
[Unit]
Description=Apache Flink JobManager
After=network.target

[Service]
Type=forking
User=flink
Group=flink
Environment=FLINK_HOME=/opt/flink
ExecStart=/opt/flink/bin/jobmanager.sh start
ExecStop=/opt/flink/bin/jobmanager.sh stop
Restart=on-failure

[Install]
WantedBy=multi-user.target

Enable and start it:

sudo systemctl daemon-reload
sudo systemctl enable --now flink-jobmanager
sudo systemctl status flink-jobmanager

Repeat the same pattern with a flink-taskmanager.service unit using taskmanager.sh start/stop on each TaskManager host.

Troubleshooting

SymptomLikely CauseFix
flink: command not foundPATH not updated, or shell not reloadedRun source /etc/profile.d/flink.sh
JobManager fails to start, Address already in usePort 8081 or 6123 already bound by another processRun sudo ss -tulpn | grep -E '8081|6123' and stop the conflicting process, or change rest.port in config.yaml
TaskManager not appearing in Web UI on multi-node clusterPasswordless SSH not configured, or workers file misconfiguredVerify ssh flink@taskmanager-host works without a password prompt from the JobManager node
Insufficient number of network buffersTaskManager memory too low for the configured parallelismIncrease taskmanager.memory.process.size in config.yaml
Job stuck in CREATED state indefinitelyNo TaskManager slots availableCheck jps on TaskManager hosts and confirm numberOfTaskSlots is sufficient for the job’s parallelism
UnsupportedClassVersionError on job submissionJob JAR compiled against a newer/older Java version than the cluster’s JDKRebuild the job JAR targeting Java 17 or 21 to match the cluster JDK
Web UI reachable locally but not remotelyFirewall blocking port 8081, or rest.bind-address set to localhostOpen port 8081 in ufw/security group and set rest.bind-address: 0.0.0.0 in config.yaml
Checksum mismatch on manual downloadCorrupted download or wrong mirrorRe-download from downloads.apache.org directly rather than a third-party mirror

Uninstalling Flink

Standalone binary install:

$FLINK_HOME/bin/stop-cluster.sh
sudo systemctl disable --now flink-jobmanager flink-taskmanager 2>/dev/null
sudo rm -rf /opt/flink
sudo rm /etc/profile.d/flink.sh
sudo userdel -r flink

Docker install:

cd ~/flink-docker
docker compose down -v

FAQ

Does Ubuntu 26.04 LTS include Apache Flink by default?
No. Flink is not part of the base Ubuntu install or its default repositories; it must be downloaded from the official Apache distribution or run via Docker.

Which JDK version does Apache Flink 2.3.0 require?
JDK 17 or JDK 21. Flink 2.x dropped support for Java 8 and Java 11, unlike the Flink 1.x series.

What’s the difference between the standalone cluster and the Kubernetes Operator?
The standalone cluster (covered in this guide) runs directly on VM/bare-metal hosts using shell scripts for process management. The Kubernetes Operator manages Flink JobManagers and TaskManagers as native Kubernetes resources, with built-in support for savepoints, autoscaling, and rolling upgrades — better suited to clusters already running Kubernetes.

Can I run Flink SQL without writing Java or Scala code?
Yes. Flink ships a SQL Client ($FLINK_HOME/bin/sql-client.sh) that lets you run streaming and batch SQL queries interactively against a running cluster.

How do I upgrade to a newer Flink version later?
Stop the cluster, take a savepoint of any running jobs (flink savepoint <job-id>), install the new version alongside the old one, update FLINK_HOME, and resume jobs from the savepoint on the new cluster.

(Visited 1 times, 1 visits today)

You may also like