Install Antora

To generate and publish documentation sites with Antora, you need the Antora’s command line interface (Antora CLI) and an Antora site generator pipeline.

Assumptions:

  • You’ve installed an active Node LTS release on your Linux, Windows, or macOS machine.

On this page, you’ll learn:

  • How to install Antora globally. (recommended)

  • How to install the Antora CLI and site generator packages in a project directory.

We recommend installing Antora globally, especially if you’re managing several documentation sites. When we say “globally” here, it does not imply system-wide. It means the location where Node is installed. If you used nvm to install Node, this location will be inside your home directory (thus not requiring elevated permissions). However, you can also install Antora in a project directory if you prefer.

Install Antora globally using npm

To install the Antora CLI and site generator packages globally, open a terminal and run:

$ npm i -g @antora/cli@2.3 @antora/site-generator-default@2.3
The @ at the beginning of the package name is important. It tells npm that the cli package is located in the antora group. If you omit this character, npm will assume the package name is the name of a git repository on GitHub. The second @ offsets the requested version number. Only the major and minor segments are specified to ensure you receive the latest patch update.

Verify the antora command is available on your PATH by running:

$ antora -v

If installation was successful, the command should report the version of Antora (where .x represents the latest patch number).

$ antora -v
2.3.x
If you’re using a system-wide Node installation managed by your operating system’s package manager, you may run into permission problems when installing packages globally. In that case, you’ll need to install Antora directly in your project repository.

Install Antora globally using Yarn

If you prefer Yarn over npm, use this command to install the Antora CLI package:

$ yarn global add @antora/cli@2.3

Next, install the default site generator.

$ yarn global add @antora/site-generator-default@2.3

Install Antora in a project directory

You can opt to install Antora in a project directory, such as the directory where the playbook file(s) for your site are stored.

When possible, we recommend installing the Antora CLI globally so that the antora command is available on your PATH. You can then install the site generator packages in a project directory.

To install only the CLI globally, run:

$ npm i -g @antora/cli@2.3

Or, to install the CLI in a project directory, change into your project directory, and run:

$ npm i @antora/cli@2.3

Dropping the -g flag installs the package under the node_modules folder in the current directory.

Verify the antora command is available on your PATH by running antora -v. If you installed the package without the -g flag, you’ll need to prefix the command with $(npm bin)/.

If installed globally
$ antora -v
If installed in a project directory
$ $(npm bin)/antora -v

The command should report the Antora CLI version in the terminal (where .x represents the latest patch number).

2.3.x

If you installed the CLI globally, change into the project directory before installing the site generator.

Next, run the following command to install the site generator package:

$ npm i @antora/site-generator-default@2.3
If you’re reinstalling Antora, it’s best to first remove the node_modules folder. If you also want to get the latest version of each dependency, remove the package-lock.json file as well. If you do remove the node_modules folder, be sure to install the CLI package again (unless you’ve installed it globally).

The @antora/site-generator-default and its dependent packages will be installed into the node_modules folder inside your project. The antora command will look for these packages there first before looking in the global installation folder.

Learn more

Now that Antora is installed, you’re ready to: