# Run Flow as a Linux Service

Flow can be set up as a `systemd` service on Linux that runs in the background, persists across reboots and user logouts, automatically restarts on crashes, and can use integrated logging via `journalctl`.

**Note**: This procedure is compatible with [systemd-based](https://en.wikipedia.org/wiki/Systemd) Linux distributions. You may need to adapt it for your specific environment.

Follow these steps to configure Flow to run as a service:

1. Create the `systemd` unit file.
   ```
   sudo vi /etc/systemd/system/<your-service-name>.service
   ```
   Replace `<your-service-name>` with a name of your choice, such as flow-ingest or flow-xl-ingest.

2. Add the following content into the file, and update the `User`, `WorkingDirectory`, and `ExecStart` fields to match your environment.
   ```
   [Unit]
   Description=SingleStore Flow Ingest
   After=network.target

   [Service]
   Type=simple
   User=<your-username>                             # e.g., /home/ec2-user           
   WorkingDirectory=<path-to-your-working-directory # e.g., /home/ec2-user/ingest
   # Adjust JVM options if you need memory limits, GC tuning, etc.
   ExecStart=/usr/bin/java -jar <path-to-your-jar>  # e.g. /home/ec2-user/ingest/ingest.jar 
   #SuccessExitStatus=143     # so Ctrl-C / SIGTERM is treated as clean
   Restart=always
   RestartSec=10
   LimitNOFILE=65536          # bump open-file limit if ingest opens many files

   [Install]
   WantedBy=multi-user.target
   ```

3. Enable and start the service.
   ```
   sudo systemctl daemon-reload
   sudo systemctl enable --now <your-service-name>
   ```

4. Check service status and logs.
   ```
   sudo systemctl status <your-service-name>     # health-check
   sudo journalctl -u <your-service-name> -f     # live logs (Ctrl-C to quit)
   ```

***

Modified at: September 17, 2025

Source: [/db/v9.1/load-data/load-data-with-singlestore-flow/run-flow-as-a-linux-service/](https://docs.singlestore.com/db/v9.1/load-data/load-data-with-singlestore-flow/run-flow-as-a-linux-service/)

(An index of the documentation is available at /llms.txt)
