Skip to main content

Installing SyncThing as a service in Ubuntu

Since `apt-key` is deprecated, you can use the `gpg` command to add the key directly to a keyring file in `/etc/apt/trusted.gpg.d/`. Here are the updated steps:

1. **Add the Syncthing APT repository 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**:
   ```sh
   echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
   ```

3. **Update your package database and install Syncthing**:
   ```sh
   sudo apt update
   sudo apt install 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.