# Logstash run as service

**URL:** <https://discuss.elastic.co/t/logstash-run-as-service/223371>\
**Category:** Logstash\
**Created:** [March 12, 2020, 3:39pm UTC](https://discuss.elastic.co/t/logstash-run-as-service/223371 "2020-03-12T15:39:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yungyoung\_Ok](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yungyoung_ok/32/43465_2.png) [@Yungyoung\_Ok](https://discuss.elastic.co/u/Yungyoung_Ok)\
**Post date:** [March 12, 2020, 3:39pm UTC](https://discuss.elastic.co/t/logstash-run-as-service/223371/1 "2020-03-12T15:39:25Z")

</div>

I installed logstash with a tar.gz package.  
I want to run as a service so that logstash can run automatically when the system reboots.  
How should I set it up?

logstash: 7.6  
os: centos7

Instead of using rpm, we need a method that runs as a service in the current installation plan.

---

<div class="post-metadata">

**Author:** ![rcowart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rcowart/32/88091_2.png) [@rcowart](https://discuss.elastic.co/u/rcowart)\
**Post date:** [March 13, 2020, 9:01am UTC](https://discuss.elastic.co/t/logstash-run-as-service/223371/2 "2020-03-13T09:01:25Z")

</div>

You need to edit `logstash/config/startup.options` as necessary for your environment.

Next run `logstash/bin/system-install`. This will use the setting in `startup.options` to create a systemd service file (usually `/etc/systemd/system/logstash.service`).

You can now run Logstash as a daemon/service.

```nohighlight
systemctl daemon-reload
systemctl enable logstash
systemctl start logstash

```

Rob

[![GitHub](https://us1.discourse-cdn.com/elastic/original/3X/6/f/6f8ae834f16b1a02d31607317669716807844d84.png)](https://github.com/robcowart) [![YouTube](https://us1.discourse-cdn.com/elastic/original/3X/4/3/43b9b81a8c93786219985aeb5335c1c323449053.png)](https://www.youtube.com/channel/UCivWvTx1DwrWNcDLV58kmOg) [![LinkedIn](https://us1.discourse-cdn.com/elastic/original/3X/6/7/674f3370d0f0542ddc5e408516beb1b7edd6c1bf.png)](https://www.linkedin.com/in/robertcowart/)  
**[How to install Elasticsearch & Kibana on Ubuntu](https://www.youtube.com/watch?v=gZb7HpVOges)**  
**[What is the best storage technology for Elasticsearch?](https://www.youtube.com/watch?v=nKUpfJCBiS4)**

---

<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:** [April 10, 2020, 9:01am UTC](https://discuss.elastic.co/t/logstash-run-as-service/223371/3 "2020-04-10T09:01:26Z")

</div>

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