Install Antora

To generate and publish documentation sites with Antora, you need the Antora command line interface (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@3.0.0-alpha.10 @antora/site-generator-default@3.0.0-alpha.10
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. Except for prerelease versions, 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 is a placeholder for the latest patch version).

$ antora -v
@antora/cli: 3.0.x
@antora/site-generator-default: 3.0.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@3.0.0-alpha.10

Next, install the default site generator.

$ yarn global add @antora/site-generator-default@3.0.0-alpha.10

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@3.0.0-alpha.10

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

$ npm i @antora/cli@3.0.0-alpha.10

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 is a placeholder for the latest patch version).

@antora/cli: 3.0.x
@antora/site-generator-default: not installed

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@3.0.0-alpha.10

Now when you run antora -v, you should see the version of both the Antora CLI and the default site generator printed in the terminal (where .x is a placeholder for the latest patch version).

@antora/cli: 3.0.x
@antora/site-generator-default: 3.0.x

That confirms you have both top-level components of Antora installed.

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: