Docker

Docker has become a standard method of running software on your computer. Docker is a containerization platform that allows you to run applications in isolated environments. This makes it easy to run Axon Server on any machine that supports Docker.

Want to use Docker Compose? Use the Docker Compose guide instead.

Step 1: Verify installation

Make sure you have Docker installed on your machine. You can verify this by running the following command:

You can verify your Docker installation by running the following command:

docker version

You should see an output like: Docker version 24.0.2, build cb74dfc.

If you cannot execute this command successfully, we recommend following the docker setup guide.

Step 2: Choose your image (optional)

AxonIQ provides ready-to-use Axon Server images. In this guide, we will use the latest-jdk-17 image. For a guide on all images, and how to make your own, see choosing and building your own Docker image. If you choose to do this, replace the image in the commands below.

Step 4: Run

It’s now time to run your docker image. The command depends a little bit on whether you choose to use AxonIQ Console or not (from Step 2).

  • With AxonIQ Console

  • Without AxonIQ Console

Please replace the YOUR_ACCESS_TOKEN text with the access key acquired in Step 2.

docker run \
    --name axon-server \
    -e axoniq_console_authentication="YOUR_CONSOLE_ACCESS_TOKEN" \
    -p 8024:8024 -p 8124:8124 -p 8224:8224 \
    axoniq/axonserver:latest-jdk-17-nonroot
docker run \
    --name axon-server \
    -p 8024:8024 -p 8124:8124 -p 8224:8224 \
    axoniq/axonserver:latest-jdk-17-nonroot

In the commands, you can tweak the exposed ports of the Docker image, so the Axon Server dashboard runs on another port. For example, you can replace -p 8024:8024 with -p 8025:8024 to get access the dashboard on localhost:8025.

Step 5: Initialize

When you go to the dashboard for the first time, you will be prompted to initialize Axon Server.

Complete installation prompt of Axon Server

Please choose the Start standalone node edition and click Complete. You are now ready to use Axon Server.

To initialize Axon Server as standalone node without a UI action, you can add -e AXONIQ_AXONSERVER_STANDALONE=true to the Docker command.

Next steps

The steps in this guide do not take into account any security, authentication or authorization. If you would like to set this up, please follow the Securing Axon Server guide.

Ready to connect

Now that you have Axon Server running, you can start using it with your Axon Framework applications. If you run on the same computer and the default ports, your Axon Framework application should be able to connect to Axon Server without any additional configuration.

If you modified the port or hostname, you need to configure Axon Framework to connect to Axon Server. For Spring Boot, you can do this by adding the following properties to your application.properties file:

axon.axonserver.servers=YOUR_HOST:YOUR_PORT