Setting up Elasticsearch and Kibana using Docker for local development

How to set up Kibana and Elasticsearch locally, within Docker containers.

Overview

Elasticsearch is a super-fast search query program. Kibana is a separate program that can be used for interacting with elasticsearch.

Here I am setting up both Elasticsearch and Kibana in their own single Docker Containers. I do this as a way to help keep my computer relatively free from being cluttered with programs. Not only that, but since the containers are their own separate self-contained boxes, it also makes it easy to upgrade the Elasticsearch version I am using at a later date.

Or even remove them entirely with minimal fuss.

Please note: I am using version 7.10.1 of both programs in the examples below. You can look at each program’s respective docker hub pages to target the exact version you require:

Just replace any uses of “7.10.1” below with your own version.

Creating and running containers for the services needed

Run the two following commands to download and run Elasticsearch locally:

# Download the Elasticsearch docker image to your computer
docker pull elasticsearch:7.10.1

# Create a local container with Elasticsearch running
docker run -d --name my_elasticsearch --net elasticnetwork -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "xpack.ml.enabled=false" elasticsearch:7.10.1

# Start the container
docker container start my_elasticsearch

And then run the two following commands to download and run Kibana locally:

# Download the Kibana docker image to your computer
docker pull kibana:7.10.1

# Create a local container with Kibana running
docker run -d --name my_kibana --net elasticnetwork -e ELASTICSEARCH_URL=http://elasticsearch:9200 -p 5601:5601 kibana:7.10.1

# Start the container
docker container start my_kibana

Accessing Kibana

Since kibana will be connecting to our Elasticsearch container, which it was told to use with the ELASTICSEARCH_URL=http://elasticsearch:9200 section of the Kibana create command, we really only need to use Kibana.

Kibana has it’s own Devtools for querying Elasticsearch, which so far has been enough for my own usecases.

head to http://localhost:5601 to access your own Kibana installation.

Note: You can send curl requests directly to your Elasticsearch from the terminal by targeting the http://127.0.0.1:9200 endpoint.

Deleting the containers

If you wish to remove Elasticsearch and/or Kibana from your computer, then enter the following commands into your terminal.

Using Docker for local development makes this a cinch.

# Stop the Elasticsearch container if it is running
# (Use it's name you gave it in the "--name" argument as its handle)
docker container stop my_elasticsearch

# Delete the Elasticsearch container
docker container rm my_elasticsearch

# Stop the Kibana container if it is running
# (Use it's name you gave it in the "--name" argument as its handle)
docker container stop my_kibana

# Delete the Kibana container
docker container rm my_kibana

If you need to set up the two programs again, you can just use the create commands shown above to create them as you did originally.

God of War

Kratos and his son Atreus journey to the highest peaks in all of the Realms in order to scatter the boy’s mother’s ashes.

But all manner of hell will greet them on their path

I had such a great time playing God of War.

I very quickly got drew into this world and felt myself being channelled through Kratos’ immense power. For a large percentage of this game I was Kratos. I think this was due largely with how the game never once took me out of the immersion. I don’t remember ever seeing a loading screen, save for the initial loading of the game.

The relationship between Kratos and his son Atreus was an emotional and thoroughly entertaining one to see unfold. I went into God of War without knowing anything about any of the previous games. So Kratos’ character was completely new to me; any references to previous events, or any moments that he goes against any previous perceptions of him, would have been lost on me unfortunately.

I kinda wish now that I’d held off and played those earlier games first now.

But nonetheless, this game still hit me right in the feels at multiple times.

There isn’t any prerequisite to have played those earlier games either, as the story is self-contained, and is really about a father and his son going on this journey together — both literally and figuratively.

More widely speaking, I think the game is about family and parenthood in general — about what it means to be a family and what we would do for them, and what we would be prepared to give up to see our children safe.

The World is stunning

The world in God of War is so beautiful. And the sense of scale it has is just breathtaking.

I can still remember the first time I saw the world serpent and just how massive it was. It’s body can be seen wrapping around most of the lake of nine (the game’s central area). Whilst it’s head can be seen out in the distance, blocking a portion of the sky off.

There is a variety of areas that must be passed through in order to reach your ultimate destination: Mining caverns through mountains; Wide open expanses of water to be fully explored; dangerous forests and ruined temples; and the highest peaks in all of the realms.

The game lets you decide at many points whether to continue along the game’s main story or go out and explore. I chose to explore a lot of the time and am glad I did. The world has many secret areas to discover and puzzles that when solved, will give you items that will greatly help you on your quest.

I found the inclusion of a “realm within realms” which you must run through when “fast travelling” between areas was actually really clever. As a developer I can imagine this being a neat way of loading in the next area whilst running this small path.

The combat is insane

The combat in God of War is mental to say the least. Your main weapon is the Leviathan Axe which can be thrown and then summoned back to your hand at will — exactly like Thor’s hammer.

Not only does Kratos’ Axe open up a whole manner of creative ways to take out enemies, but it is used often in the puzzles you will encounter. It has the ability to freeze what it touches, which can be used in certain places to gain access to otherwise inaccessible places.

Not only is there Kratos though, but his son also. By pressing the “square” button you can command Atreus to fire an arrow in battle. You can leave him to fire as he likes, but you’ll find that there are many opportunities to create clever strategies when using both characters to their fullest.

As you gain XP you will be able to unlock many skills for both Kratos and Atreus, as well as upgrade and enchant armour to help you in battle. I wont lie, I found all of the different fight moves a little intimidating. In fact, I found myself button-mashing through most encounters of more than three enemies.

I found the difficulty challenging too (in a good way). I started the game on “normal” but had to downgrade it to “easy”. And even on easy the game was a challenge for me. I dare say if I’d committed the time to learning the moves that are possible and getting them in as muscle-memory I would have found it a bit more easy-going.

In Summary

If you enjoy action-focused games with a deeply emotional tug, then you need to play God of War. Every person I’d spoke to before playing it told me about how good it was and that it only gets better as you progress — and they were all correct.

Not only does this game get increasingly good the further through the story you get, but I have a feeling it will get better with age too.