Fedora Silverblue is a popular Linux distribution that emphasizes containerized applications using the OSTree-based system. In this tutorial, we’ll explore how to set up and run Syncthing, a powerful file synchronization tool, within the Silverblue toolbox. By isolating Syncthing within a toolbox, you can maintain system integrity and easily manage its dependencies. Let’s dive in!
Step 1: Create a new toolbox
Let’s create a new toolbox for Syncthing. Choose a suitable name for your toolbox, such as “syncthing-toolbox,” and execute the following command:
1 | toolbox create syncthing-toolbox |
Step 2: Entering the Toolbox
To enter the newly created toolbox, run the following command:
1 | toolbox enter syncthing-toolbox |
Step 3: Installing Dependencies
Within the toolbox environment, we’ll install the required dependencies for Syncthing. Execute the following command:
1 | sudo dnf install syncthing |
Step 4: Starting Syncthing
Now that the necessary dependencies are installed, we can start Syncthing. Execute the following command:
1 | syncthing |
Step 5: Accessing Syncthing Web Interface
Syncthing provides a web interface to configure and monitor file synchronization. To access it, open a web browser and navigate to http://localhost:8384. You should see the Syncthing interface.
Step 6: Configuring Syncthing
Follow the on-screen instructions to set up Syncthing according to your requirements. Configure folders, device connections, and synchronization settings as needed.
Step 7: Exiting the Toolbox
To exit the toolbox environment, use the exit
command or close the terminal window.
Step 8: Create a new service unit file to automatically start Syncthing toolbox container at system startup
To automatically start Syncthing toolbox container when your Silverblue system boots, you can use systemctl to manage the service. Here’s how:
1. Create systemd
folder for systemd user service
If folder already exist, go to next step.
1 | mkdir -p ${HOME}/.local/share/systemd/user/ |
2. Generate systemd unit from toolbox container
1 | cd ${HOME}/.local/share/systemd/user/ |
Step 9: Create a new service unit file to automatically start Syncthing at system startup
1. Get syncthing.service
file
If your distribution package already contain this file, you can use it instead of using the git repostory verion.
1 | wget https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-systemd/user/syncthing.service |
2. Modify syncthing.service
file to start syncthing from toolbox container
1 | sed -i "s/ExecStart=/ExecStart=toolbox run --container syncthing-toolbox /" syncthing.service |
3. Enable syncthing.service
to start on boot
1 | Reload the systemctl daemon to ensure it recognizes the new service: |
From now on, Syncthing will automatically start whenever your Silverblue system boots.
Comments