Last Updated On - February 13th, 2026 Published On - Feb 13, 2026
Understanding the Prerequisites
Before you jump into the installation, let’s quickly cover the prerequisites. The good news is that they are minimal, making it very accessible for developers. To install Elasticsearch on Mac, you primarily need a supported version of macOS. While it’s intended for development and not production, it works flawlessly for local projects. In terms of hardware, ensure you have at least 2 GB of available RAM, though 4 GB is ideal if you plan to run Kibana or other parts of the Elastic Stack alongside it. One of the biggest conveniences is that you no longer need to install Java separately. The Elasticsearch archive comes with its own bundled OpenJDK, simplifying the setup process significantly.
How to Install Elasticsearch on Mac: The Core Steps
With the prerequisites out of the way, you can now proceed with the core installation. Following these steps carefully will ensure a smooth setup. This process involves downloading the official archive, verifying its integrity, extracting it, and handling a specific macOS security feature.
- Download the Elasticsearch Archive: Navigate to the official Elasticsearch downloads page. From there, select the `tar.gz` package for macOS (often labeled as Darwin). For instance, you would download a file named something like
elasticsearch-8.18.4-darwin-x86_64.tar.gz. - Verify the Checksum (Optional but Recommended): To ensure your downloaded file is not corrupted or tampered with, it’s a good security practice to verify its SHA512 checksum. You can do this by downloading the corresponding
.sha512file and running theshasum -a 512 -c <checksum-file>command in your terminal. You should see an “OK” confirmation. - Extract the Archive: Once downloaded, open your terminal and use the command
tar -xzf elasticsearch-8.18.4-darwin-x86_64.tar.gzto extract the contents. This will create a new directory (e.g.,elasticsearch-8.18.4/), which is now referred to as your$ES_HOME. - Bypass macOS Gatekeeper: This is a crucial step for a successful installation on macOS. Gatekeeper, the built-in security feature, may block the bundled JDK from running because it’s from an unidentified developer. To prevent this, run the command
xattr -d -r com.apple.quarantine $ES_HOME/. This removes the quarantine attribute and allows Elasticsearch to execute without security interruptions.
Also Read: Fix Elasticsearch Red Status: 3 Proven Steps
Starting and Validating Your Elasticsearch Node
After you install Elasticsearch on Mac and configure it, the next step is to start the service and confirm it’s running correctly. By default, Elasticsearch runs in the foreground, making it easy to monitor its output. Navigate into your $ES_HOME directory and execute ./bin/elasticsearch. The first time you run this, Elasticsearch will perform a one-time security initialization. It will generate TLS certificates for network encryption, create a password for the `elastic` superuser, and produce an enrollment token for connecting Kibana. Be sure to copy the password and token from the terminal output. To validate the installation, open a new terminal window and run curl -u elastic:<your-generated-password> http://localhost:9200. If you receive a JSON response with cluster details, your node is running successfully. To stop the foreground process, simply press `Ctrl + C`. If you prefer to run it as a background daemon, use the command ./bin/elasticsearch -d -p pid, which will also create a file named `pid` containing the process ID for later management.
Optional: Integrating Kibana for a Visual Interface
While Elasticsearch is a powerful search engine, its capabilities are often best explored through its visualization tool, Kibana. Integrating Kibana into your local setup is highly recommended and straightforward thanks to the enrollment token generated during the initial Elasticsearch startup. The process is very similar to how you installed Elasticsearch. First, download and extract the Kibana `tar.gz` archive for macOS. Just like with Elasticsearch, you may need to run the `xattr` command to remove the quarantine flag if macOS blocks the application. Once extracted, simply run ./bin/kibana. The terminal will provide an enrollment link. Open this link in your browser, and it will prompt you to connect to your local Elasticsearch instance. Use the `elastic` username and the auto-generated password from the previous step to log in. This seamless process connects your Kibana dashboard to your Elasticsearch node, giving you a powerful UI to manage data, create visualizations, and interact with your search indices.
FAQs
Do I need to install Java to run Elasticsearch on Mac?
No, you do not need to install Java separately. The modern Elasticsearch tar.gz archive conveniently includes its own bundled OpenJDK, which is a key reason why it’s so straightforward to install Elasticsearch on Mac for development purposes.
How do I find the ‘elastic’ user password after the installation?
When you first install Elasticsearch on Mac and run it, the generated password for the `elastic` superuser is printed directly to the terminal console where you started the service. Make sure to copy and save this password securely.
What is the ‘xattr’ command for when installing Elasticsearch?
The `xattr -d com.apple.quarantine` command is a crucial step to tell macOS Gatekeeper to trust the application binaries. Without it, macOS security features may block the bundled JDK from running, preventing Elasticsearch from starting up correctly after you install Elasticsearch on Mac.
Can I use this method to install Elasticsearch on Mac for a production server?
No, this installation method is officially recommended for development and testing purposes only. A production environment requires a more robust setup, including considerations for high availability, security hardening, and performance tuning that go beyond this simple guide to install Elasticsearch on Mac.
How do I stop the Elasticsearch process?
To stop Elasticsearch when it is running in the foreground (the default startup method), simply press `Ctrl + C` in the same terminal window where the service is active. This will safely shut down the Elasticsearch node.
Conclusion/Recomendation
Congratulations! You have successfully managed to install Elasticsearch on Mac using the tarball archive. This single-node setup is perfect for local development, allowing you to test queries, build search functionality, and explore the powerful features of the Elastic Stack right from your macOS machine. With a running Elasticsearch node and an optional Kibana interface, you are now well-equipped to dive deeper into data indexing and analysis. For your next steps, consider creating your first index and adding some documents to see it in action.
