{"id":4800,"date":"2026-03-21T19:13:30","date_gmt":"2026-03-21T16:13:30","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=4800"},"modified":"2026-03-22T03:57:39","modified_gmt":"2026-03-22T00:57:39","slug":"install-elasticsearch-fedora","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/install-elasticsearch-fedora\/","title":{"rendered":"How To Install Elasticsearch on Fedora 42"},"content":{"rendered":"\n<p>Elasticsearch is a distributed search and analytics engine built on Apache Lucene. It handles full-text search, structured queries, and real-time analytics at scale &#8211; making it the backbone of the Elastic Stack (ELK). This guide walks through installing Elasticsearch 8.x on Fedora 42 from the official Elastic repository.<\/p>\n\n\n\n<p>Elasticsearch 8.x ships with security enabled by default &#8211; TLS encryption, authentication, and role-based access control are all turned on out of the box. We will install it on Fedora 42, configure the systemd service, open firewall ports, and verify the setup with curl. For full documentation, see the <a href=\"https:\/\/www.elastic.co\/guide\/en\/elasticsearch\/reference\/8.19\/index.html\" target=\"_blank\" rel=\"noreferrer noopener\">official Elasticsearch 8.x reference<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A server or VM running Fedora 42 with at least 2GB RAM (4GB recommended for production)<\/li>\n\n\n\n<li>Root or sudo access<\/li>\n\n\n\n<li>Firewall ports: 9200\/tcp (HTTP API), 9300\/tcp (node communication)<\/li>\n\n\n\n<li>Internet access to reach the Elastic package repository<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Install Java on Fedora 42<\/h2>\n\n\n\n<p>Elasticsearch 8.x bundles its own JDK, but having a system-wide Java installation is useful for related tools and plugins. Install <a href=\"https:\/\/computingforgeeks.com\/install-java-fedora\/\" target=\"_blank\" rel=\"noreferrer noopener\">OpenJDK 17 on Fedora<\/a> along with a few helpful utilities.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y java-17-openjdk java-17-openjdk-devel lsof curl<\/code><\/pre>\n\n\n\n<p>Verify the Java version.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>java -version<\/code><\/pre>\n\n\n\n<p>Expected output:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>openjdk version \"17.0.14\" 2025-01-21\nOpenJDK Runtime Environment (Red_Hat-17.0.14.0.7-1.fc42) (build 17.0.14+7)\nOpenJDK 64-Bit Server VM (Red_Hat-17.0.14.0.7-1.fc42) (build 17.0.14+7, mixed mode, sharing)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Add Elasticsearch 8.x Repository<\/h2>\n\n\n\n<p>Import the Elastic GPG signing key first.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo rpm --import https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch<\/code><\/pre>\n\n\n\n<p>Create the Elasticsearch 8.x repository file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo tee \/etc\/yum.repos.d\/elasticsearch.repo<\/code><\/pre>\n\n\n\n<p>Add the following content:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>[elastic-8.x]\nname=Elastic repository for 8.x packages\nbaseurl=https:\/\/artifacts.elastic.co\/packages\/8.x\/yum\ngpgcheck=1\ngpgkey=https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch\nenabled=1\nautorefresh=1\ntype=rpm-md<\/code><\/pre>\n\n\n\n<p>Press <code>Ctrl+D<\/code> after pasting to save and close. Alternatively, write the file directly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo '[elastic-8.x]\nname=Elastic repository for 8.x packages\nbaseurl=https:\/\/artifacts.elastic.co\/packages\/8.x\/yum\ngpgcheck=1\ngpgkey=https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch\nenabled=1\nautorefresh=1\ntype=rpm-md' | sudo tee \/etc\/yum.repos.d\/elasticsearch.repo<\/code><\/pre>\n\n\n\n<p>Verify the repository is available.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf repolist | grep elastic<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Install Elasticsearch on Fedora 42<\/h2>\n\n\n\n<p>With the repository configured, install Elasticsearch.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y elasticsearch<\/code><\/pre>\n\n\n\n<p>During installation, Elasticsearch 8.x generates security credentials automatically. The installer output contains the superuser password, enrollment tokens, and TLS certificate fingerprint. Save this output &#8211; you will need the password shortly.<\/p>\n\n\n\n<p>If you missed the installer output, reset the <code>elastic<\/code> superuser password.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo \/usr\/share\/elasticsearch\/bin\/elasticsearch-reset-password -u elastic -i<\/code><\/pre>\n\n\n\n<p>You will be prompted to enter and confirm the new password.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Configure Elasticsearch<\/h2>\n\n\n\n<p>The main configuration file is <code>\/etc\/elasticsearch\/elasticsearch.yml<\/code>. For a single-node setup, the defaults work out of the box. Open the configuration file to review or customize settings.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/elasticsearch\/elasticsearch.yml<\/code><\/pre>\n\n\n\n<p>Common settings to adjust for a single-node deployment:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Cluster name - used to auto-discover nodes\ncluster.name: my-cluster\n\n# Node name - defaults to hostname\nnode.name: node-1\n\n# Network - bind to localhost only (default) or specific IP for remote access\nnetwork.host: 0.0.0.0\n\n# Discovery - single node mode\ndiscovery.type: single-node\n\n# Data and log paths (defaults are fine for most setups)\npath.data: \/var\/lib\/elasticsearch\npath.logs: \/var\/log\/elasticsearch<\/code><\/pre>\n\n\n\n<p>JVM heap size is configured separately in <code>\/etc\/elasticsearch\/jvm.options<\/code>. The default is 1GB. For production, set it to half of available RAM (max 32GB).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/elasticsearch\/jvm.options<\/code><\/pre>\n\n\n\n<p>Adjust the heap size lines:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-Xms2g\n-Xmx2g<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Start and Enable Elasticsearch Service<\/h2>\n\n\n\n<p>Reload systemd to pick up the Elasticsearch unit file, then enable and start the service.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl daemon-reload\nsudo systemctl enable --now elasticsearch<\/code><\/pre>\n\n\n\n<p>Verify the service is running.<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">systemctl status elasticsearch<\/mark>\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">\u25cf<\/mark> elasticsearch.service - Elasticsearch\n     Loaded: loaded (\/usr\/lib\/systemd\/system\/elasticsearch.service; enabled; preset: disabled)\n     Active: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">active (running)<\/mark> since Fri 2026-03-21 10:15:32 UTC; 12s ago\n       Docs: https:\/\/www.elastic.co\n   Main PID: 2541 (java)\n      Tasks: 89 (limit: 4543)\n     Memory: 2.5G\n        CPU: 48.231s\n     CGroup: \/system.slice\/elasticsearch.service\n             \u251c\u25002541 \/usr\/share\/elasticsearch\/jdk\/bin\/java ...\n             \u2514\u25002612 \/usr\/share\/elasticsearch\/modules\/x-pack-ml\/platform\/linux-x86_64\/bin\/controller<\/code><\/pre>\n\n\n\n<p>Confirm Elasticsearch is listening on port 9200.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo lsof -i :9200<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6: Configure Firewall<\/h2>\n\n\n\n<p>If firewalld is active, open ports 9200\/tcp (REST API) and 9300\/tcp (inter-node communication). Port 9300 is only needed if you plan to run a multi-node <a href=\"https:\/\/computingforgeeks.com\/install-elasticsearch-rocky-almalinux\/\" target=\"_blank\" rel=\"noreferrer noopener\">Elasticsearch cluster<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --add-port=9200\/tcp --permanent\nsudo firewall-cmd --add-port=9300\/tcp --permanent\nsudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n<p>Verify the ports are open.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --list-ports<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 7: Test Elasticsearch with curl<\/h2>\n\n\n\n<p>Elasticsearch 8.x has TLS enabled by default. Query the API using the CA certificate and the <code>elastic<\/code> superuser credentials.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo curl --cacert \/etc\/elasticsearch\/certs\/http_ca.crt -u elastic https:\/\/localhost:9200<\/code><\/pre>\n\n\n\n<p>Enter the password when prompted. A successful response looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>{\n  \"name\" : \"node-1\",\n  \"cluster_name\" : \"my-cluster\",\n  \"cluster_uuid\" : \"abc123XYZ...\",\n  \"version\" : {\n    \"number\" : \"8.19.13\",\n    \"build_flavor\" : \"default\",\n    \"build_type\" : \"rpm\",\n    \"build_hash\" : \"...\",\n    \"build_snapshot\" : false,\n    \"lucene_version\" : \"9.12.0\",\n    \"minimum_wire_compatibility_version\" : \"7.17.0\",\n    \"minimum_index_compatibility_version\" : \"7.0.0\"\n  },\n  \"tagline\" : \"You Know, for Search\"\n}<\/code><\/pre>\n\n\n\n<p>Check cluster health.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo curl --cacert \/etc\/elasticsearch\/certs\/http_ca.crt -u elastic https:\/\/localhost:9200\/_cluster\/health?pretty<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 8: Create a Test Index<\/h2>\n\n\n\n<p>Create a sample index to confirm read and write operations work. This creates an index called <code>test-index<\/code> and adds a document.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo curl --cacert \/etc\/elasticsearch\/certs\/http_ca.crt -u elastic \\\n  -X POST \"https:\/\/localhost:9200\/test-index\/_doc\/1\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\"name\": \"Elasticsearch on Fedora\", \"message\": \"Installation successful\"}'<\/code><\/pre>\n\n\n\n<p>Retrieve the document to confirm it was indexed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo curl --cacert \/etc\/elasticsearch\/certs\/http_ca.crt -u elastic \\\n  \"https:\/\/localhost:9200\/test-index\/_doc\/1?pretty\"<\/code><\/pre>\n\n\n\n<p>Expected output:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>{\n  \"_index\" : \"test-index\",\n  \"_id\" : \"1\",\n  \"_version\" : 1,\n  \"_seq_no\" : 0,\n  \"_primary_term\" : 1,\n  \"found\" : true,\n  \"_source\" : {\n    \"name\" : \"Elasticsearch on Fedora\",\n    \"message\" : \"Installation successful\"\n  }\n}<\/code><\/pre>\n\n\n\n<p>List all indices on the node.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo curl --cacert \/etc\/elasticsearch\/certs\/http_ca.crt -u elastic \\\n  \"https:\/\/localhost:9200\/_cat\/indices?v\"<\/code><\/pre>\n\n\n\n<p>Clean up the test index when done.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo curl --cacert \/etc\/elasticsearch\/certs\/http_ca.crt -u elastic \\\n  -X DELETE \"https:\/\/localhost:9200\/test-index\"<\/code><\/pre>\n\n\n\n<p>For more on managing index data, see <a href=\"https:\/\/computingforgeeks.com\/easy-way-to-delete-elasticsearch-index-data\/\" target=\"_blank\" rel=\"noreferrer noopener\">how to delete Elasticsearch index data with curl<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Elasticsearch 8.x is now running on Fedora 42 with TLS encryption and authentication enabled by default. The service is managed through systemd and the firewall is configured for API and cluster communication on ports 9200 and 9300.<\/p>\n\n\n\n<p>For production deployments, consider setting up a multi-node cluster for high availability, configuring automated snapshots for backups, and deploying the rest of the <a href=\"https:\/\/computingforgeeks.com\/install-elastic-stack-elk-on-rhel-centos\/\" target=\"_blank\" rel=\"noreferrer noopener\">Elastic Stack (Kibana, Logstash, Beats)<\/a> for log aggregation and visualization. You can also add <a href=\"https:\/\/computingforgeeks.com\/install-filebeat-logstash-kibana-on-rocky-almalinux\/\" target=\"_blank\" rel=\"noreferrer noopener\">Filebeat and Logstash<\/a> to build a complete log pipeline.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Elasticsearch is a distributed search and analytics engine built on Apache Lucene. It handles full-text search, structured queries, and real-time analytics at scale &#8211; making it the backbone of the Elastic Stack (ELK). This guide walks through installing Elasticsearch 8.x on Fedora 42 from the official Elastic repository. Elasticsearch 8.x ships with security enabled by &#8230; <a title=\"How To Install Elasticsearch on Fedora 42\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/install-elasticsearch-fedora\/\" aria-label=\"Read more about How To Install Elasticsearch on Fedora 42\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":2774,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,299,50],"tags":[344,37995,539],"class_list":["post-4800","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fedora","category-how-to","category-linux-tutorials","tag-elasticsearch","tag-install-elasticsearch-on-fedora","tag-kibana"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/4800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=4800"}],"version-history":[{"count":2,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/4800\/revisions"}],"predecessor-version":[{"id":163473,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/4800\/revisions\/163473"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/2774"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=4800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=4800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=4800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}