# Easiest Way To Install Elastic... apt-get install or wget

**URL:** <https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879>\
**Category:** Elasticsearch\
**Created:** [May 13, 2021, 5:28am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879 "2021-05-13T05:28:19Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![cis4life](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@cis4life](https://discuss.elastic.co/u/cis4life)\
**Post date:** [May 13, 2021, 5:28am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/1 "2021-05-13T05:28:20Z")

</div>

Good Day,

In your opinion, what is the easiest way to get Elasticsearch 6.18.5 onto Ubuntu 18.04 servers. I'm looking at this ES guide here... [Install Elasticsearch with Debian Package | Elasticsearch Guide [6.8] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/deb.html)

I see 2 ways to install, apt-get install and wget. My goal is to get ES version 6.8.15 onto our servers with ubuntu 18.04. What route would you go. I know once I get it installed, I need to update the Elasticsearch.yml and java.options files and start the ES service. Which way would you go to install it?

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 13, 2021, 5:46am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/2 "2021-05-13T05:46:31Z")

</div>

Apt will make updates easier, I'd go with that.

---

<div class="post-metadata">

**Author:** ![cis4life](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@cis4life](https://discuss.elastic.co/u/cis4life)\
**Post date:** [May 13, 2021, 5:30pm UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/3 "2021-05-13T17:30:05Z")

</div>

Aweome,

So when I do these commands will it install 6.8.15? Cause I see it adds elastic-6.x, so will that install 6.8.15?

```
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
sudo apt-get update && sudo apt-get install elasticsearch

```

Again, Thank you SOOO Much.  
You have no idea how much this is helping me plan this install.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 14, 2021, 4:17am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/4 "2021-05-14T04:17:48Z")

</div>

If that matches [Install Elasticsearch with Debian Package | Elasticsearch Guide [6.8] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/deb.html), which it looks like, then yes.

---

<div class="post-metadata">

**Author:** ![cis4life](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@cis4life](https://discuss.elastic.co/u/cis4life)\
**Post date:** [May 14, 2021, 1:14pm UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/5 "2021-05-14T13:14:54Z")

</div>

Awesome,

question: Using apt-get to install ES, when we later upgrade the OS from 18.04 to say 20.04 in the future. That upgrade won't remove the install of ES. The reason I ask is cause when we first attempt this upgrade from 16.04 to 18.04 the ES install we had in place was completely removed which was puzzling to us.

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 17, 2021, 12:17am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/6 "2021-05-17T00:17:37Z")

</div>

Older versions of Ubuntu used to have Elasticsearch in their default repos, this was removed in newer ones which is possibly what happened there.  
If you have the Elastic repo defined, an OS upgrade won't remove that.

---

<div class="post-metadata">

**Author:** ![cis4life](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@cis4life](https://discuss.elastic.co/u/cis4life)\
**Post date:** [May 17, 2021, 2:39am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/7 "2021-05-17T02:39:40Z")

</div>

That makes a lot of sense. So, with that said when I use the command below...  
`echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list`  
This adds / define the repo so that a OS upgrade wont remove it.

Also,  
When I install ES 6.8.15 to a new server running a fresh copy of Ubuntu 18.04, I will install Java via OpenJDK, Do I need to set the JAVA\_HOME variable / setting in order to install ES, or just installing the JDK is enough for the install?

Thanks SOOO Much, You have no idea how you are helping me fully prep for this install,

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 17, 2021, 2:45am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/8 "2021-05-17T02:45:18Z")

</div>

> [@cis4life](#):
>
> This adds / define the repo so that a OS upgrade wont remove it.

Yep.

> [@cis4life](#):
>
> When I install ES 6.8.15 to a new server running a fresh copy of Ubuntu 18.04, I will install Java via OpenJDK, Do I need to set the JAVA\_HOME variable / setting in order to install ES, or just installing the JDK is enough for the install?

If you want to use the bundled JVM you don't need to set it.  
If you don't, and want to use your own version (eg an updated one), see [Install Elasticsearch with Debian Package | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html#deb-configuring)

---

<div class="post-metadata">

**Author:** ![cis4life](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@cis4life](https://discuss.elastic.co/u/cis4life)\
**Post date:** [May 17, 2021, 3:01am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/9 "2021-05-17T03:01:27Z")

</div>

Im more than happy to use the bundled JVM included. Just didn't realize it was bundled. Looking / researching it appears that Ubuntu 18.04 includes Open JDK 11.

That should be fine for ES with no issue, even up to version 7.x correct?

Thanks again!!!

---

<div class="post-metadata">

**Author:** ![cis4life](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@cis4life](https://discuss.elastic.co/u/cis4life)\
**Post date:** [May 17, 2021, 3:56am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/10 "2021-05-17T03:56:06Z")

</div>

also,

trying to prep and practice for this upcoming install and such, I installed a VM of Ubuntu 18.04 and got that up and running. Then went in after updating and such ran java -version and got back that Java wasn't installed. Am I missing something? I thought that Open JDK was bundled with ubuntu 18.04. Is there something I need to do to get this bundled version of OpenJDK 11 on and set?

Again, Thanks,

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 17, 2021, 6:08am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/11 "2021-05-17T06:08:16Z")

</div>

[Elastic Support Matrix | Elasticsearch](https://www.elastic.co/support/matrix#matrix_jvm) is your go to source for JVM compatibility.

---

<div class="post-metadata">

**Author:** ![cis4life](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@cis4life](https://discuss.elastic.co/u/cis4life)\
**Post date:** [May 17, 2021, 3:19pm UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/12 "2021-05-17T15:19:33Z")

</div>

Thanks for that link. VERY HELPFUL for what I need.

My real last question is about the bundled JDK with OpenJDK 11 that is suppose to be bundled with Ubuntu 18.04.  
I built a VM of Ubuntu 18.04 (desktop for simplicity, but the production will be server) and when I built the VM and now have it all stood up and updated. I ran the java -version command and its saying that java is not install and wants me to sudo install it. I have no problem installing it from apt install, but will that set the default variables i need such as JAVA\_HOME so I can use the default OpenJDK 11 settings and such. Just making sure when I install ES and such, I'm not forgetting a set that would make this install fail due to oversight on my part.

Thanks

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 17, 2021, 10:33pm UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/13 "2021-05-17T22:33:44Z")

</div>

> [@cis4life](#):
>
> will that set the default variables i need such as JAVA\_HOME

For your user, yes. But Elasticsearch needs `ES_JAVA_HOME` set, which you need to do.

---

<div class="post-metadata">

**Author:** ![cis4life](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@cis4life](https://discuss.elastic.co/u/cis4life)\
**Post date:** [May 18, 2021, 12:13am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/14 "2021-05-18T00:13:16Z")

</div>

Oh,

So I have to set the ES\_JAVA\_HOME regardless? I thought if I use the bundled OpenJDK in Ubuntu 18.04 I wouldn't have to set the ES\_HAVA\_HOME variable. But in the VM I setup, I dont see a bundled Java version install, so its asking me to install the OpenJDK 11. I dont mind installing it but once I install it, then I will have to set the ES\_JAVA\_HOME value for each node? and is there by a default value i should set it to for OpenJDK 11? (It will be a clean server when i install it and will be the only version of java on it)

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 15, 2021, 12:13am UTC](https://discuss.elastic.co/t/easiest-way-to-install-elastic-apt-get-install-or-wget/272879/15 "2021-06-15T00:13:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
