Want to deploy your JVM, Node.js and Go apps effortlessly to AWS? Try our service Boxfuse

Command-line tool

The Flyway command-line tool is a standalone Flyway distribution. It runs on Windows, macOS and Linux and it is primarily meant for users who wish to migrate their database from the command-line without having to integrate Flyway into their applications nor having to install a build tool.

Download and installation

Select the platform that you need. Each download contains all editions (community, pro, enterprise) of Flyway.


Official Release (recommended) Early-Access Preview
flyway-commandline-5.2.4-windows-x64.zip md5 sha1

Extract the archive and simply add the new flyway-5.2.4 directory to the PATH to make the flyway command available from anywhere on your system.

flyway-commandline-6.0.0-beta-windows-x64.zip md5 sha1

Extract the archive and simply add the new flyway-6.0.0-beta directory to the PATH to make the flyway command available from anywhere on your system.


Official Release (recommended) Early-Access Preview
flyway-commandline-5.2.4-macosx-x64.tar.gz md5 sha1

flyway-commandline-6.0.0-beta-macosx-x64.tar.gz md5 sha1


Download, extract and install by adding to PATH (requires sudo permissions):

$ wget -qO- https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/5.2.4/flyway-commandline-5.2.4-linux-x64.tar.gz | tar xvz && sudo ln -s `pwd`/flyway-5.2.4/flyway /usr/local/bin 

Or simply download the archive:

Official Release (recommended) Early-Access Preview
flyway-commandline-5.2.4-linux-x64.tar.gz md5 sha1

flyway-commandline-6.0.0-beta-linux-x64.tar.gz md5 sha1


(Linux only) Download, extract and install by adding to PATH (requires sudo permissions):

$ sudo sh -c 'echo "docker run --rm boxfuse/flyway:5.2.4" > /usr/local/bin/flyway && chmod +x /usr/local/bin/flyway'

(All platforms) Or simply download the image:

Official Release (recommended) Early-Access Preview
> docker pull boxfuse/flyway:5.2.4
> docker pull boxfuse/flyway:6.0.0-beta

Go to Docker Hub for detailed usage instructions.

Older versions, packages without JRE and sources are available from Maven Central

Directory structure

The Flyway download, once extracted, now becomes a directory with the following structure:

     flyway.conf  configuration file
   drivers         JDBC drivers
   jars            Java-based migrations (as jars)
   sql             SQL migrations
   flyway         macOS/Linux executable
   flyway.cmd     Windows executable


> flyway [options] command

Flyway editions

The Flyway Command-line tool distribution ships with all editions of Flyway. It defaults to Flyway Community Edition. It can however easily be configured to run the Flyway Pro or Enterprise Edition instead.

Environment variable

One way to switch between the various Flyway editions is to set the FLYWAY_EDITION environment variable prior to executing Flyway to any of the following values:

communitySelect the Flyway Community Edition (default)
proSelect the Flyway Pro Edition
enterpriseSelect the Flyway Enterprise Edition

Edition-selecting flags

Alternatively Flyway also comes with edition-selecting flags. By default the flyway command will launch whatever edition has been selected with the FLYWAY_EDITION environment variable (defaulting to community). You can however also use edition-selecting flags to force the selection of the edition of your choice and avoid the need to set any environment variable at all:

-communitySelect the Flyway Community Edition
-proSelect the Flyway Pro Edition
-enterpriseSelect the Flyway Enterprise Edition


Name Description
migrate Migrates the database
clean Drops all objects in the configured schemas
info Prints the details and status information about all the migrations
validate Validates the applied migrations against the ones available on the classpath
baseline Baselines an existing database, excluding all migrations up to and including baselineVersion
repair Repairs the schema history table

JDBC drivers

In order to connect with your database, Flyway needs the appropriate JDBC driver to be available in its drivers directory.

Flyway ships with JDBC drivers for the following databases by default:

  • Aurora MySQL
  • Aurora PostgreSQL
  • CockroachDB
  • Derby
  • H2
  • MariaDB
  • MySQL
  • Percona XtraDB
  • PostgreSQL
  • SQLite
  • SQL Server
  • Sybase ASE

If your database is not listed here, you need to download its JDBC driver and place it in the drivers directory yourself. Instructions on where to download the drivers from are provided on the respective documentation pages for each database.


The Flyway Command-line tool can be configured in a wide variety of ways. You can use config files, environment variables and command-line parameters. These different means of configuration can be combined at will.

Config files

Config files are supported by the Flyway command-line tool. If you are not familiar with them, check out the Flyway config file structure and settings reference first.

Flyway will search for and automatically load the following config files if present:

  • <install-dir>/conf/flyway.conf
  • <user-home>/flyway.conf
  • <current-dir>/flyway.conf

It is also possible to point Flyway at one or more additional config files. This is achieved by supplying the command line parameter -configFiles= as follows:

> flyway -configFiles=path/to/myAlternativeConfig.conf migrate

To pass in multiple files, separate their names with commas:

> flyway -configFiles=path/to/myAlternativeConfig.conf,other.conf migrate

Relative paths are relative to the current working directory.

Alternatively you can also use the FLYWAY_CONFIG_FILES environment variable for this. When set it will take preference over the command-line parameter.

> export FLYWAY_CONFIG_FILES=path/to/myAlternativeConfig.conf,other.conf
> flyway migrate

By default Flyway loads configuration files using UTF-8. To use an alternative encoding, use the command line parameter -configFileEncoding= as follows:

> flyway -configFileEncoding=ISO-8859-1 migrate

Alternatively you can also use the FLYWAY_CONFIG_FILE_ENCODING environment variable for this. When set it will take preference over the command-line parameter.


Environment Variables

To make it easier to work with cloud and containerized environments, Flyway also supports configuration via environment variables. Check out the Flyway environment variable reference for details.

Command-line Arguments

Finally, Flyway can also be configured by passing arguments directly from the command-line:

> flyway -user=myuser -schemas=schema1,schema2 -placeholders.keyABC=valueXYZ migrate

Overriding order

The Flyway command-line tool has been carefully designed to load and override configuration in a sensible order.

Settings are loaded in the following order (higher items in the list take precedence over lower ones):

  1. Command-line arguments
  2. Environment variables
  3. Custom config files
  4. <current-dir>/flyway.conf
  5. <user-home>/flyway.conf
  6. <install-dir>/conf/flyway.conf
  7. Flyway command-line defaults

The means that if for example flyway.url is both present in a config file and passed as -url= from the command-line, the command-line argument will take precedence and be used.


If you do not supply a database user or password via any of the means above, you will be prompted to enter them:

Database user: myuser
Database password:

If you want Flyway to connect to your database without a user or password, you can suppress prompting by adding the -n flag.

Java Arguments

If you need to to pass custom arguments to Flyway’s JVM, you can do so by setting the JAVA_ARGS environment variable. They will then automatically be taken into account when launching Flyway. This is particularly useful when needing to set JVM system properties.


All debug, info and warning output is sent to stdout. All errors are sent to stderr.

Debug output

Add -X to the argument list to also print debug output.

Quiet mode

Add -q to the argument list to suppress all output, except for errors and warnings.

Command-line: migrate