Introduction
This guide explains how to install Liquibase on Ubuntu, an open-source database change management tool used to track, version, and deploy database schema changes in a structured, controlled way. Liquibase is commonly used in DevOps pipelines and CI/CD workflows — Jenkins, GitLab, and ArgoCD among them — to keep database schemas consistent across development, testing, and production environments.
Implementation
I. Prerequisites
Before you install Liquibase on Ubuntu, make sure your system meets the following requirements:
- Ubuntu 22.04 or 24.04 LTS
- Java 11 or higher
- Internet access for downloading packages
- The
wgetandunziputilities
If any of these tools are missing, they can be installed using apt, as shown in the steps below.
II. Why Use Liquibase?
Before diving into the installation steps, it’s worth understanding what problem Liquibase actually solves. Manually applying database schema changes across development, staging, and production environments is error-prone — a change tested locally can easily be forgotten, applied out of order, or skipped entirely in production. Liquibase solves this by tracking every schema change as a version-controlled “changeset,” similar to how Git tracks code changes. This makes schema updates repeatable, auditable, and safe to roll back, which is exactly why teams integrate it into CI/CD pipelines rather than running SQL scripts by hand.
III. Update System Packages
sudo apt update
IV. Install Java
sudo apt install -y default-jre
Note:
default-jreinstalls a Java Runtime Environment, which is sufficient to run Liquibase. If you also plan to compile custom Liquibase extensions or Java-based changelogs, you may wantdefault-jdk(the full Java Development Kit) instead.
V. Verify the Java Installation
java -version
Expected output: Java 11 or higher.
VI. Navigate to the /opt Directory
cd /opt
/opt is a conventional location for optional, self-contained third-party software on Linux, which makes it a sensible place to install Liquibase outside of your package manager.
VII. Download and Install Liquibase on Ubuntu
sudo wget https://github.com/liquibase/liquibase/releases/download/v4.29.2/liquibase-4.29.2.zip
Tip: Check the official Liquibase releases page for the current version before downloading, so you install the latest stable release rather than a fixed older version.
Extract the package:
sudo unzip liquibase-4.29.2.zip
If
unzipisn’t already installed, add it first withsudo apt install -y unzip.
VIII. Verify the Liquibase Installation
/opt/liquibase --version
Expected output: Liquibase Version 4.29.2
IX. Add Liquibase to PATH (Optional)
To run liquibase from anywhere without typing the full path, add /opt to your shell’s PATH:
echo 'export PATH=$PATH:/opt' >> ~/.bashrc source ~/.bashrc
Verify it worked:
liquibase --version
Note: Appending the entire
/optdirectory to PATH also exposes any other tools installed there. If you’d rather keep PATH changes scoped to Liquibase specifically, create a symlink instead:sudo ln -s /opt/liquibase-4.29.2/liquibase /usr/local/bin/liquibase.
X. Conclusion
You’ve now successfully installed Liquibase on Ubuntu, along with the Java prerequisite it depends on. The system is ready for database version control and migration management.
Typical next steps include:
- Configuring a database connection using
liquibase.properties - Creating and running your first migration script
- Integrating Liquibase with a CI/CD pipeline such as Jenkins or GitLab
Frequently Asked Questions
Do I need the full JDK, or is the JRE enough to run Liquibase? The JRE (default-jre) is enough to run Liquibase itself. You’d only need the full JDK if you’re building custom extensions or writing Java-based changelogs.
Can I install Liquibase on Ubuntu using apt instead of downloading the zip manually? Ubuntu’s default repositories don’t reliably carry the latest Liquibase releases, so downloading directly from the official GitHub releases page — as shown above — is the more dependable way to get a current, specific version when you install Liquibase on Ubuntu.
Is it safe to add the entire /opt directory to my PATH? It works, but it’s broader than necessary — anything else installed under /opt also becomes runnable by name. A symlink to just the Liquibase binary in /usr/local/bin is a more scoped alternative if that matters for your setup.
What’s the difference between Liquibase and Flyway? Both are database migration tools, but Liquibase supports a wider range of changelog formats (XML, YAML, JSON, and SQL) and has built-in rollback support for most change types, while Flyway is SQL-first and generally considered simpler to set up for straightforward use cases.