Now, before we continue and configure more servers in this Docker compose file, let's run it and let's
see if it works for one server.
And to do it I will open terminal window.
From the top navigation menu I'll select terminal and then select New Terminal.
Now I'm using terminal window that is integrated into my development environment.
But you can open a regular terminal window that is not part of the development environment.
Or you can use Command Prompt.
If you're on windows, you do not need to use the terminal window of studio code.
And in the terminal window, change directory to the folder where you have docker compose file.
If I check the location of current directory, I'm in a user folder, so I will change directory to
Kafka folder.
This is my Kafka and then I will change directory to docker compose folder where I have created docker
compose file.
And if I list files here, there are two files that I have.
I have docker compose yaml file and I have environment file.
Now to run this docker compose file, we usually use the following command docker compose space and
then up.
And because I used default file name for my docker compose file, I don't need to pass any other parameters
to run it.
But if your file name is different, then you might need to pass the file name this way, delete up
and then type dash f space and then the file name.
And in my case it is docker compose yaml.
And after that you can use up.
Now in previous lesson I created environment file and in that environment file I defined hostname.
If you want to use this environment file and make your Docker container, use that hostname that we
defined in that file, then you can pass it.
This way you will use dash dash and then inf dash file.
And then the name of the file itself space.
And in my case the name of the file is environment dot env.
And finally, at the end of this command you will type up and this should execute this docker compose
file.
Right.
So let's try I'll hit enter.
And I have my Docker container starting.
All right, so now that I have my Apache Kafka running, I can try working with it using Apache Kafka
CLI.
And there are a couple of different ways how to execute CLI commands.
Let's have a look at each of them in the following lesson.