Connection error refused elasticsearch on ubuntu 20.04

good afternoon guys my english is not very good but I’ll try to explain

myself I made a server ubuntu 20.04 for testing with elasticsearch and when trying to install auditbeat on the client machine to collect logs, is presenting this connection error refused by the elastic server

root@ubuntu-teste-elastic-Nginx:~# auditbeat setup
Exiting: couldn't connect to any of the configured Elasticsearch hosts. Errors: [error connecting to Elasticsearch
Get "": dial tcp connect: connection refused];

I have already followed this tutorial here

but it didn’t work out if anyone can help me, I would be very grateful

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
August 22, 2022

Hi @smallaquaeel,

It seems you are trying to connect to your own Droplet. Try to see if elasticsearch is working properly first;

  1. curl -X GET -H "Content-Type: application/json" 'http://localhost:9200/tutorial/helloworld/1?pretty'

Do you see anything, you should receive a similar response:

  "_index" : "tutorial",
  "_type" : "helloworld",
  "_id" : "1",
  "_version" : 2,
  "_seq_no" : 1,
  "_primary_term" : 1,
  "found" : true,
  "_source" : {
    "message" : "Hello, People!"


if that’s okay you might need to try and reinstall auditbeat. You can follow this article on how to do it:

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up