Skip to main content

Installing Syncthing as a service in Ubuntu

SinceInstalling `apt-key`Syncthing isand deprecated,then youadding canit use the `gpg` command to add the key directly toas a keyring fileservice in `/etc/apt/trusted.gpg.d/`. Here are the updated steps:Ubuntu:

1. **Add the Syncthing APT repository key**:key:

 ```sh
   
curl -s https://syncthing.net/release-key.txt | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/syncthing.gpg > /dev/null
   ```

2. **Add the Syncthing APT repository**:repository:

 ```sh
   
echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
   ```

3. **Update your package databasedatabase:

and install Syncthing**:
   ```sh
   
sudo apt update

4. Install Syncthing:

 
sudo apt install syncthing

5. Start Syncthing:
   ```

syncthing

4. **Start Syncthing**:
   You can start Syncthing manually using the following command:
   ```sh
   syncthing
   ```
   
   Alternatively, you can set up Syncthing to run as a service:

   **For Systemd**:
   ```sh
   

sudo systemctl enable syncthing@$USER.service
 
sudo systemctl start syncthing@$USER.service
   ```

These steps should help you install and start Syncthing on your Ubuntu system without using the deprecated `apt-key` command.system.