Elasticsearch HTTP API

localhost:9200

Elasticsearch uses its HTTP interface for REST clients on port 9200 by convention. Current secured installations commonly require HTTPS, credentials, and the generated certificate authority—plain http://localhost:9200 may therefore fail even while the node is healthy.

Elasticsearch 8.x/9.x security modelLinux packages · archives · DockerUpdated September 5, 2026
HTTP API9200
Node transport9300
Common secured URLHTTPS
Browser UI?No

Use the test that matches your installation

For a security-enabled local package or archive installation, use the CA certificate generated during setup and authenticate as a configured user:

export ELASTIC_PASSWORD='your-password'

curl --cacert config/certs/http_ca.crt \
  -u elastic:$ELASTIC_PASSWORD \
  https://localhost:9200

On an RPM installation, the CA path is commonly /etc/elasticsearch/certs/http_ca.crt. On Windows PowerShell, keep the password in a temporary environment variable and use curl.exe if you need curl-compatible flags.

Do not publish passwords in shell history, screenshots, or support requests. Prefer environment variables, a secrets manager, or an Elasticsearch client’s secure credential configuration.

What the result means

ResultMeaningNext action
JSON with node and version dataThe HTTP endpoint, TLS, and authentication succeeded.Use a narrower API such as cluster health for the next check.
Connection refusedNo listener at that address and port.Check service status, startup logs, bind address, and container publishing.
Empty reply from server after HTTPA common cause is speaking plain HTTP to an HTTPS endpoint.Retry with the documented HTTPS and CA configuration; confirm in logs.
Certificate verify errorThe endpoint responded with TLS, but the client does not trust or match the certificate.Use the generated CA file and the hostname covered by the certificate.
HTTP 401The endpoint is reachable; credentials are missing or invalid.Use a valid user, API key, or supported token.
HTML pageYou may be reaching a proxy or another product.Identify the process and inspect response headers.

Check the process and logs

# systemd-based Linux
sudo systemctl status elasticsearch
sudo journalctl -u elasticsearch --since "10 minutes ago"

# Check listeners
ss -ltnp | grep ':9200'

# Windows PowerShell
Get-NetTCPConnection -LocalPort 9200 -State Listen

Startup logs are essential when a node exits before opening the port. Address memory, permissions, configuration, discovery, and bootstrap-check failures from the exact logged message; changing firewall rules cannot fix a process that never started.

9200 is not 9300—and not Kibana

  • 9200: Elasticsearch’s client-facing HTTP interface, commonly used by REST clients and Kibana.
  • 9300: the transport interface used for node-to-node communication; it is not the REST endpoint.
  • 5601: Kibana’s common web-server port. A healthy Elasticsearch JSON response on 9200 is not intended to be a browser dashboard.

Elasticsearch in Docker

# Inspect running containers and published ports
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"

# Read the node's startup output
docker logs <container-name>

# Check that host port 9200 maps to container port 9200
docker port <container-name> 9200

If Compose maps 127.0.0.1:9201:9200, the host URL is on 9201, not 9200. Retrieve the generated enrollment and authentication details from the deployment workflow instead of disabling security to make a quick curl command work.

Binding and exposure

Elasticsearch has separate HTTP and transport interfaces. Network settings can trigger bootstrap checks when a node binds beyond local addresses. Treat those checks as required safeguards, not obstacles to bypass.

Never expose an unprotected Elasticsearch node to the public internet. An exposed REST API can allow data to be read, changed, or deleted. Use authentication, TLS, network controls, and least-privilege roles.

After connectivity works

curl --cacert config/certs/http_ca.crt \
  -u elastic:$ELASTIC_PASSWORD \
  'https://localhost:9200/_cluster/health?pretty'

A red or yellow cluster status is an Elasticsearch allocation issue, not a localhost reachability issue. Continue with cluster logs and allocation APIs once the authenticated HTTP request succeeds.

Official references