Install Liquibase on Linux with Debian or Ubuntu
Last updated: November 18, 2025
Before you begin
Confirm that Java is installed. If you use the Liquibase Installer, Java is included automatically.
Procedure
Open a terminal.
Update Liquibase APT Source to package.liquibase.com
If you’ve installed Liquibase previously and your system is still pointing at repo.liquibase.com, run the following commands to update your configuration to use the new package.liquibase.com domain (which provides improved tracking and reliability):
This backs up your old file to liquibase.list.bak and updates the .list file in place so it now contains:
deb [arch=amd64 signed-by=/usr/share/keyrings/liquibase-keyring.gpg] https://package.liquibase.com stable mainRun the following command to import the Liquibase GPG key and add the Liquibase repository to the apt sources list.
Note: It is important to note that you must have root permissions for this to work.
Update the package lists.
sudo apt-get updateInstall Liquibase.
apt-get commands don’t require you to add anything to your path. This adds to your /bin by default.
Apply your Liquibase Secure license key.
Using a Secrets Management tool like Hashicorp Vault or AWS Secrets Manager is best to keep Liquibase license keys secure.
There are several ways to apply the Liquibase Secure license key:
Include the Liquibase Secure license key in the Liquibase properties file and save it.
For example:
liquibase.licenseKey: aei76ou32thp785463214
Pass the Liquibase Secure license key as a parameter in the command line during runtime:
liquibase --license-key=[paste the Liquibase Secure license key] [command]
For example:
liquibase --license-key=aei76ou32thp785463214 update
Set the Liquibase Secure license key as an environment variable in the command line.
On Windows:
set LIQUIBASE_LICENSE_KEY=aei76ou32thp785463214
On Linux/macOS:
export LIQUIBASE_LICENSE_KEY=aei76ou32thp785463214
Set the Liquibase Secure license key with the JAVA_OPTS Environment Variable in the command line:
JAVA_OPTS="Dliquibase.licenseKey=<enter license key here>"
Pass the Liquibase Secure license key while using a Docker container. Docker allows the use of --env in the command.
docker run --env LIQUIBASE_LICENSE_KEY=<enter license key here>... \
-it liquibase/liquibase-secure:latest sh
If you use Maven, include the Liquibase Secure license key in the <properties> section of your pom.xml file:
<liquibaseLicenseKey>key-goes-here</liquibaseLicenseKey/>
For example:
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-commercial-maven-plugin</artifactId>
<version>0-SNAPSHOT</version>
<configuration>
<changelogFile>com/example/changelog_v4.6.xml</changelogFile>
<liquibaseLicenseKey>key-goes-here</liquibaseLicenseKey>
</configuration>
</plugin>
Note: In older versions of Liquibase, you must use the syntax <liquibaseProLicenseKey> instead of <liquibaseLicenseKey>.
If you use Azure DevOps and pass your license key as an environment variable, you can set the value of LIQUIBASE_LICENSE_KEY in your Azure DevOps pipeline setting file:
script: |
echo "Running Policy Checks"
liquibase checks run --changeLogFile=mysqlChangelog.xml
displayName: 'Run Policy Checks'
env:
LIQUIBASE_LICENSE_KEY: $(LiquibaseKey)
In this example, LiquibaseKey is the name of the Azure DevOps project variable whose value is the license key.
You can directly embed your Liquibase Secure license key (myProLicenseKey) in a custom Java application by following these steps:
In your Maven
pom.xmlfile, point toliquibase-commercial.jaras a dependency:<dependency> <groupId>org.liquibase</groupId> <artifactId>liquibase-commercial</artifactId> <version>4.33.0</version> </dependency>In your custom Java file, import the following:
import com.datical.liquibase.ext.config.LiquibaseLabsConfiguration;In your custom Java file, call on the
LiquibaseLabsConfigurationclass. For example, to specify your license key so that you can run the Liquibase Secureupdate-one-changesetcommand:Scope.child(LiquibaseLabsConfiguration.LICENSE_KEY.getKey(), "myProLicenseKey", () -> new CommandScope(UpdateOneChangeSetSqlCommandStep.COMMAND_NAME) .addArgumentValue(DbUrlConnectionArgumentsCommandStep.DATABASE_ARG, liquibase.getDatabase()) .addArgumentValue(DatabaseChangelogCommandStep.CHANGELOG_FILE_ARG, "/db_schema/changelog.xml") .addArgumentValue(UpdateOneChangeSetCommandStep.CHANGESET_AUTHOR_ARG, "fl") .addArgumentValue(UpdateOneChangeSetCommandStep.CHANGESET_ID_ARG, "1") .addArgumentValue(UpdateOneChangeSetCommandStep.CHANGESET_PATH_ARG, "/db_schema/changelog.xml") .execute() );
For information on running Liquibase commands in Java files, see liquibase.command.CommandScope.
Ensure that Liquibase is updated to the desired version.
liquibase --version
Liquibase is now installed on your system.
Note: To install a specific version of Liquibase using the Debian/Ubuntu installer package, use the package manager’s version pinning mechanism:
sudo apt-get install liquibase=x.y.z
Replace x.y.z with the version you want to install. This command will install that specific version of Liquibase on your system.