Upgrade to Liquibase Secure 4.32 with Docker
Last updated: September 2, 2025
In Liquibase 4.32 we provide two distinct distributions of Liquibase Community and Liquibase Secure. This differentiation provides a holistic setup experience that leads to purposeful releases and fewer regressions specifically built for the workflow of our Secure users. It is important to know that the Secure distribution requires a valid license key to utilize all Community and Secure features. You can run a Docker container in many ways. Please use the tools aligned with your company's workflow, such as AWS ECS or GitHub Actions, or other container orchestration platforms.
Before you begin
Confirm that Java is installed. If you use the Liquibase Installer, Java is included automatically.
Procedure
Pull the Liquibase Docker image.
You can retrieve the image from Docker Hub by running the docker pull liquibase/liquibase
command.
Apply the Liquibase Secure license key in the CLI.
You'll need to set the key as an environment variable temporarily for the duration of the current terminal session. Once you close the terminal instance, this setting will be lost.
Windows:
set LIQUIBASE_LICENSE_KEY=<insert-license-key>
Linux/MacOS:
export LIQUIBASE_LICENSE_KEY=<insert-license-key>
This example is for testing purposes. It is best to use a Secrets Management tool like Hashicorp Vault or AWS Secrets Manager to keep Liquibase license keys secure.
Verify the environment variable has been set.
Windows
echo $LIQUIBASE_LICENSE_KEY
Windows
echo $LIQUIBASE_LICENSE_KEY
If the environment variable is set properly, the license key will display in the terminal.
Use the docker run command to apply your changes.
Now you'll run the docker run
command to update your database using Liquibase inside a Docker container.
This command does the following:
Starts the official Liquibase Docker container.
Passes your Liquibase license key into the container via the
LIQUIBASE_LICENSE_KEY
environment variable.Mounts your current working directory into the container at
/liquibase/changelog
. Note: You may need to give Docker permission to access the directory you want to mount into the container. Mounting the directory allows you to make changes to your changelog, save the file, and rundocker run
to update your changelog in the Docker container at the path /liquibase/changelog.Connects to your database using the JDBC URL, username, and password you provide. Note: The Liquibase Docker image includes JDBC drivers for popular databases like PostgreSQL, Oracle, SQL Server, MariaDB, Snowflake, and H2. If you're using a different database, download the appropriate JDBC driver and follow the instructions in the Liquibase Database Tutorials.
Executes the
update
command using the changelog file in your mounted directory.
Before you run the example code, be sure to:
Navigate to the directory that contains your changelog in the CLI. Tip: Use
pwd
(Mac/Linux) orcd
(Windows) to check your current directory.Update
YOUR_JDBC_URL
with your JDBC URL. For example:jdbc:postgresql://host.docker.internal:5432/testdb
Update
YOUR_USERNAME
andYOUR_PASSWORD
with your credentials for your database.Update
YOUR_CHANGELOG_FILE
with the name of the changelog file on your local machine. For example:your-example-changelog.xml
Note: Docker may prompt you to grant access to the directory you're mounting.
Windows
docker run --rm
-e LIQUIBASE_LICENSE_KEY=%LIQUIBASE_LICENSE_KEY%
-v %cd%:/liquibase/changelog
liquibase/liquibase
--url="your_jdbc_url"
--username=your_username
--password=your_password
--changelog-file=your-example-changelog.xml
--search-path=/liquibase/changelog/
update
Windows
docker run --rm
-e LIQUIBASE_LICENSE_KEY=%LIQUIBASE_LICENSE_KEY%
-v %cd%:/liquibase/changelog
liquibase/liquibase
--url="your_jdbc_url"
--username=your_username
--password=your_password
--changelog-file=your-example-changelog.xml
--search-path=/liquibase/changelog/
update
Now you'll run the docker run
command to update your database using Liquibase inside a Docker container.
This command does the following:
Starts the official Liquibase Docker container.
Passes your Liquibase license key into the container via the
LIQUIBASE_LICENSE_KEY
environment variable.Mounts your current working directory into the container at
/liquibase/changelog
. Note: You may need to give Docker permission to access the directory you want to mount into the container. Mounting the directory allows you to make changes to your changelog, save the file, and rundocker run
to update your changelog in the Docker container at the path /liquibase/changelog.Connects to your database using the JDBC URL, username, and password you provide. Note: The Liquibase Docker image includes JDBC drivers for popular databases like PostgreSQL, Oracle, SQL Server, MariaDB, Snowflake, and H2. If you're using a different database, download the appropriate JDBC driver and follow the instructions in the Liquibase Database Tutorials.
Executes the
update
command using the changelog file in your mounted directory.
Before you run the example code, be sure to:
Navigate to the directory that contains your changelog in the CLI. Tip: Use
pwd
(Mac/Linux) orcd
(Windows) to check your current directory.Update
YOUR_JDBC_URL
with your JDBC URL. For example:jdbc:postgresql://host.docker.internal:5432/testdb
Update
YOUR_USERNAME
andYOUR_PASSWORD
with your credentials for your database.Update
YOUR_CHANGELOG_FILE
with the name of the changelog file on your local machine. For example:your-example-changelog.xml
Note: Docker may prompt you to grant access to the directory you're mounting.
Windows
docker run --rm
-e LIQUIBASE_LICENSE_KEY=%LIQUIBASE_LICENSE_KEY%
-v %cd%:/liquibase/changelog
liquibase/liquibase
--url="your_jdbc_url"
--username=your_username
--password=your_password
--changelog-file=your-example-changelog.xml
--search-path=/liquibase/changelog/
update
Now you'll run the docker run
command to update your database using Liquibase inside a Docker container.
This command does the following:
Starts the official Liquibase Docker container.
Passes your Liquibase license key into the container via the
LIQUIBASE_LICENSE_KEY
environment variable.Mounts your current working directory into the container at
/liquibase/changelog
. Note: You may need to give Docker permission to access the directory you want to mount into the container. Mounting the directory allows you to make changes to your changelog, save the file, and rundocker run
to update your changelog in the Docker container at the path /liquibase/changelog.Connects to your database using the JDBC URL, username, and password you provide. Note: The Liquibase Docker image includes JDBC drivers for popular databases like PostgreSQL, Oracle, SQL Server, MariaDB, Snowflake, and H2. If you're using a different database, download the appropriate JDBC driver and follow the instructions in the Liquibase Database Tutorials.
Executes the
update
command using the changelog file in your mounted directory.
Before you run the example code, be sure to:
Navigate to the directory that contains your changelog in the CLI. Tip: Use
pwd
(Mac/Linux) orcd
(Windows) to check your current directory.Update
YOUR_JDBC_URL
with your JDBC URL. For example:jdbc:postgresql://host.docker.internal:5432/testdb
Update
YOUR_USERNAME
andYOUR_PASSWORD
with your credentials for your database.Update
YOUR_CHANGELOG_FILE
with the name of the changelog file on your local machine. For example:your-example-changelog.xml
Note: Docker may prompt you to grant access to the directory you're mounting.