Syncthing as a service
A comprehensive guide to setting up Syncthing as a systemd service on Fedora, covering installation, service configuration, automatic startup, and optional boot-time activation through user lingering.
To make Syncthing start automatically on Fedora, you can use
systemd. This approach allows you to start Syncthing automatically at
boot time under your user account, ensuring that it’s always running in
the background without requiring manual intervention. Here’s how you can
do it:
-
Install Syncthing (if you haven’t already): You can install Syncthing from the default Fedora repositories. Open a terminal and run:
sudo dnf install syncthing
-
Enable and start Syncthing service for your user:
systemdmanages services through units. For each user,systemdcan manage a separate instance of the Syncthing service. This is done by enabling and starting a “user” service, not a “system” service. This means the service will start automatically when your user logs in and will run under your user’s permissions.
- **Enable the service**: This step tells `systemd` to start the
Syncthing service automatically on user login.
systemctl --user enable syncthing.service
- **Start the service now**: To start the Syncthing service
immediately without waiting for the next login or reboot, use the
following command:
systemctl --user start syncthing.service
-
Verify the service is running: You can check that the Syncthing service is active and running with:
systemctl —user status syncthing.service
-
Accessing Syncthing: By default, Syncthing’s web interface will be available at
http://localhost:8384/. You can use your web browser to access it and configure your folders and devices. -
Optional - Enable service to start at boot: While the above steps will start Syncthing on user login, if you want the service to start at boot time (before login), you will need to enable lingering for your user. This tells
systemdto start user services at boot instead of at login. Run:sudo loginctl enable-linger $USER
This command makes `systemd` start user services at boot time. It’s
particularly useful if Syncthing needs to run on a headless server
or a system where you don’t log in graphically.
Syncthing should now automatically start for your user account on Fedora, either at user login or at boot time (if lingering is enabled).