# How to run flow fuse a service

**URL:** <https://discourse.nodered.org/t/how-to-run-flow-fuse-a-service/89925>\
**Category:** FlowFuse\
**Created:** [31 July 2024 23:27 UTC](https://discourse.nodered.org/t/how-to-run-flow-fuse-a-service/89925 "2024-07-31T23:27:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhmeh](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@abhmeh](https://discourse.nodered.org/u/abhmeh)\
**Post date:** [31 July 2024 23:27 UTC](https://discourse.nodered.org/t/how-to-run-flow-fuse-a-service/89925/1 "2024-07-31T23:27:19Z")

</div>

I followed the guidelines as described in this link:  
[Running the FlowFuse Device Agent as a service on a Raspberry Pi • FlowFuse](https://flowfuse.com/blog/2023/05/device-agent-as-a-service/)

Description=flowfuse Device Agent  
Wants=network.target  
Documentation=[Documentation • FlowFuse](https://flowfuse.com/docs)

[Service]  
Type=simple

# Run as normal pi user - change to the user name you wish to run flowfuse Device as

User=root  
Group=root  
WorkingDirectory=/opt/flowfuse-device

Environment="NODE\_OPTIONS=--max\_old\_space\_size=512"  
ExecStart=/usr/bin/env flowfuse-device-agent

# Use SIGINT to stop

KillSignal=SIGINT

# Auto restart on crash

Restart=on-failure  
RestartSec=20

# Tag things in the log

SyslogIdentifier=flowfuseDevice  
#StandardOutput=syslog

[Install]  
WantedBy=multi-user.target

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [1 August 2024 07:50 UTC](https://discourse.nodered.org/t/how-to-run-flow-fuse-a-service/89925/2 "2024-08-01T07:50:03Z")

</div>

Create the file service

```bash
sudo nano /etc/systemd/system/flowforge-device-agent.service

```

Paste the content from [here](https://github.com/FlowFuse/device-agent/blob/main/service/flowfuse-device.service).

Save and exit (ctrl + o then enter then ctrl + x)

Enable the service

```bash
sudo systemctl enable flowforge-device-agent.service

```

And finally start the service

```bash
sudo systemctl start flowforge-device-agent

```
