# Running logstash in background in linux

**URL:** <https://discuss.elastic.co/t/running-logstash-in-background-in-linux/286517>\
**Category:** Logstash\
**Created:** [October 12, 2021, 2:19pm UTC](https://discuss.elastic.co/t/running-logstash-in-background-in-linux/286517 "2021-10-12T14:19:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mangeshs](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mangeshs](https://discuss.elastic.co/u/mangeshs)\
**Post date:** [October 12, 2021, 2:19pm UTC](https://discuss.elastic.co/t/running-logstash-in-background-in-linux/286517/1 "2021-10-12T14:19:37Z")

</div>

I want to run logstash in background on linux server  
i am using command like this on bin path

```auto
nohup ./logstash -f sample.conf&

```

is it correct way to run the logstash or anything else  
but then I need to read nohup.out file everytime s I can't figure out the data is fully indexed to eleastic search or not

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [October 12, 2021, 2:25pm UTC](https://discuss.elastic.co/t/running-logstash-in-background-in-linux/286517/2 "2021-10-12T14:25:53Z")

</div>

The recommended way to run logstash in background is to run it as a service, after installing using a package manager as `rpm` or `deb`.

Then you would just start and stop the service as needed.

You can read more in this part of the [documentation](https://www.elastic.co/guide/en/logstash/current/running-logstash.html#running-logstash-systemd).

---

<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:** [November 9, 2021, 2:26pm UTC](https://discuss.elastic.co/t/running-logstash-in-background-in-linux/286517/3 "2021-11-09T14:26:43Z")

</div>

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