# Installing Kibana from source

**URL:** <https://discuss.elastic.co/t/installing-kibana-from-source/306045>\
**Category:** Kibana\
**Created:** [May 31, 2022, 2:12pm UTC](https://discuss.elastic.co/t/installing-kibana-from-source/306045 "2022-05-31T14:12:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amphagory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amphagory/32/46127_2.png) [@Amphagory](https://discuss.elastic.co/u/Amphagory)\
**Post date:** [May 31, 2022, 2:12pm UTC](https://discuss.elastic.co/t/installing-kibana-from-source/306045/1 "2022-05-31T14:12:25Z")

</div>

Hello,

I have built Kibana 8.2.0 from source following these [instructions](https://www.elastic.co/guide/en/kibana/current/building-kibana.html). It has made a folder call build with 3 sub folders: default, Kibana, Kibana-docker.

I couldn't find documentation on how to install my build on Linux (Ubuntu 20.04LTS in my case).

- Do I just copy the Kibana folder on the system?
- If I mirror the [Install Kibana with Debian package](https://www.elastic.co/guide/en/kibana/current/deb.html), it puts the config in /etc/kibana/kibana.yml, the Kibana in /usr/share/kibana, etc...
- Other?

Once I've installed Kibana on Linux, how do I run it for my production? Furthermore, after getting the Kibana running, should I use systemd to configure Kibana to start automatically when the system reboots i.e.  
sudo /bin/systemctl daemon-reload  
sudo /bin/systemctl enable kibana.service

thanks in adavnce for all the responses

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [May 31, 2022, 8:22pm UTC](https://discuss.elastic.co/t/installing-kibana-from-source/306045/2 "2022-05-31T20:22:39Z")

</div>

> [@Amphagory](#):
>
> default, Kibana, Kibana-docker

These folders will have the "distributable" files, such as `.tar.gz`, `.deb`.

If you want to install the Linux Debian package that was built, you can do:  
`sudo dpkg -i kibana-8.2.0-[snapshot/archname].deb`

> [@Amphagory](#):
>
> Once I've installed Kibana on Linux, how do I run it for my production?

See: [Use Kibana in a production environment | Kibana Guide [8.11] | Elastic](https://www.elastic.co/guide/en/kibana/current/production.html)

> [@Amphagory](#):
>
> Furthermore, after getting the Kibana running, should I use systemd to configure Kibana to start automatically when the system reboots

If you install Kibana using the `.deb` distributable, then yes 🙂

If you a different package manager, or no package manager, you'll have to find advice about installing / managing software using those distributable types. For example, if you want to use the `.tar.gz` file that was built, I think you will have to use the services manager of your choice by defining a custom service that knows where you unpacked the Kibana files.

---

<div class="post-metadata">

**Author:** ![Amphagory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amphagory/32/46127_2.png) [@Amphagory](https://discuss.elastic.co/u/Amphagory)\
**Post date:** [May 31, 2022, 8:54pm UTC](https://discuss.elastic.co/t/installing-kibana-from-source/306045/3 "2022-05-31T20:54:46Z")

</div>

Thanks for your reply @tsullivan! I will install it using dpkg -i. where Kibana will be running after the installation and I would just use systemd to start Kibana again, if the system reboots.

---

<div class="post-metadata">

**Author:** ![Amphagory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amphagory/32/46127_2.png) [@Amphagory](https://discuss.elastic.co/u/Amphagory)\
**Post date:** [June 2, 2022, 1:58am UTC](https://discuss.elastic.co/t/installing-kibana-from-source/306045/4 "2022-06-02T01:58:03Z")

</div>

> [@tsullivan](#):
>
> These folders will have the "distributable" files, such as `.tar.gz` , `.deb` .
> 
> If you want to install the Linux Debian package that was built, you can do:  
> `sudo dpkg -i kibana-8.2.0-[snapshot/archname].deb`

Following the [instructions](https://www.elastic.co/guide/en/kibana/current/building-kibana.html),

```auto
To specify a package to build you can add rpm or deb as an argument.

yarn build --deb
Distributable packages can be found in target/ after the build completes.

```

As directed, I ran yarn build --deb to produce the "distributable" package . When I went into the target folder, I did not find the .deb "distributable" package. I've looked around in the Kibana folder and even did a search for all .deb files on the system, but can not find any matching files.

Looking for guidance in creating this "distributable" package, as the documentation could be outdated.

---

<div class="post-metadata">

**Author:** ![Amphagory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amphagory/32/46127_2.png) [@Amphagory](https://discuss.elastic.co/u/Amphagory)\
**Post date:** [June 2, 2022, 2:20am UTC](https://discuss.elastic.co/t/installing-kibana-from-source/306045/5 "2022-06-02T02:20:59Z")

</div>

Update: I've tried running the command yarn build --deb again and yarn build, but now getting an error. The following is a snippet of the ending output:

```auto
fpm --force -t deb --package /home/amphagory/github/source/kibana/target/NAME-8.2.3-SNAPSHOT-ARCH.TYPE -s dir --name kibana --description Explore and visualize your Elasticsearch data --version 8.2.3-SNAPSHOT --url https://www.elastic.co --vendor Elasticsearch, Inc. --maintainer Kibana Team <info@elastic.co> --license Elastic-License --after-install /home/amphagory/github/source/kibana/src/dev/build/tasks/os_packages/package_scripts/post_install.sh --before-install /home/amphagory/github/source/kibana/src/dev/build/tasks/os_packages/package_scripts/pre_install.sh --before-remove /home/amphagory/github/source/kibana/src/dev/build/tasks/os_packages/package_scripts/pre_remove.sh --after-remove /home/amphagory/github/source/kibana/src/dev/build/tasks/os_packages/package_scripts/post_remove.sh --rpm-posttrans /home/amphagory/github/source/kibana/src/dev/build/tasks/os_packages/package_scripts/post_trans.sh --rpm-digest sha256 --config-files /etc/kibana/kibana.yml --template-value user=kibana --template-value group=kibana --template-value configDir=/etc/kibana --template-value pluginsDir=/usr/share/kibana/plugins --template-value dataDir=/var/lib/kibana --template-value logDir=/var/log/kibana --template-value pidDir=/run/kibana --template-value envFile=/etc/default/kibana --exclude usr/share/kibana/config --exclude usr/share/kibana/data --exclude usr/share/kibana/logs --exclude run/kibana/.gitempty --architecture amd64 --deb-priority optional /home/amphagory/github/source/kibana/build/default/kibana-8.2.3-SNAPSHOT-linux-x86_64/=/usr/share/kibana/ /home/amphagory/github/source/kibana/build/os_packages/config/kibana.yml=/etc/kibana/kibana.yml /home/amphagory/github/source/kibana/build/default/kibana-8.2.3-SNAPSHOT-linux-x86_64/config/=/etc/kibana/ /home/amphagory/github/source/kibana/build/default/kibana-8.2.3-SNAPSHOT-linux-x86_64/data/=/var/lib/kibana/ /home/amphagory/github/source/kibana/build/default/kibana-8.2.3-SNAPSHOT-linux-x86_64/logs/=/var/log/kibana/ /home/amphagory/github/source/kibana/src/dev/build/tasks/os_packages/service_templates/systemd/=/ /home/amphagory/github/source/kibana/src/dev/build/tasks/os_packages/service_templates/env/kibana/=/etc/default/kibana
   │ERROR failure 0 sec
   │ERROR Error: Premature close
   │ at new NodeError (node:internal/errors:371:5)
   │ at Socket.onclose (node:internal/streams/end-of-stream:135:30)
   │ at Socket.emit (node:events:538:35)
   │ at Pipe.<anonymous> (node:net:687:12)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

```

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [June 3, 2022, 5:51pm UTC](https://discuss.elastic.co/t/installing-kibana-from-source/306045/6 "2022-06-03T17:51:09Z")

</div>

> [quote="Amphagory, post:4, topic:306045"]  
> I've looked around in the Kibana folder and even did a search for all .deb files on the system, but can not find any matching files.  
> [/quote]

When the build is successful, the paths of all the files that are created/copied will be logged in the text that prints out as the build progresses. If you aren't able to see it, try copying all of the text from the terminal window into a text editor, and it will be easier to search through.

The `fpm` command will fail if you don't have `fpm` installed or it is not working on your system for some reason. Can you double-check you fulfilled the system dependency requirements from the instructions?

> `apt-get install ruby ruby-dev rpm dpkg build-essential`  
> `gem install fpm -v 1.5.0`

---

<div class="post-metadata">

**Author:** ![Amphagory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amphagory/32/46127_2.png) [@Amphagory](https://discuss.elastic.co/u/Amphagory)\
**Post date:** [June 10, 2022, 10:51am UTC](https://discuss.elastic.co/t/installing-kibana-from-source/306045/7 "2022-06-10T10:51:50Z")

</div>

@tsullivan I'm almost there with all your help, thank you. I think my last question is how to produce a specific version?

I switch to branch 8.2 in the Kibana repo and when I do `yarn build --deb --release` it produces a file like kibana-8.2.3-[snapshot/archname].deb. Is there a way to specify the release version to say 8.2.2? I would like to match the version that my Elastic cloud service.

Thanks again~

---

<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:** [July 8, 2022, 10:52am UTC](https://discuss.elastic.co/t/installing-kibana-from-source/306045/8 "2022-07-08T10:52:25Z")

</div>

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