Syncthing jail

Setup for Syncthing service jail with iocage.

On FreeNAS

Create jail:

iocage create --release 11.1-RELEASE --name syncthing \ boot="on" vnet=on \ allow_raw_sockets="1" \ ip4_addr="vnet1|" \ interfaces="vnet1:bridge1" \ defaultrouter="" \ resolver="search;nameserver;nameserver"

Create user Syncthing on FreeNAS with ID 983, nologin to match the user in the jail.

On Freenas create datasets:

  • Datasets
    • Syncthing Data
      • tank/data/syncthing

Nullfs mount datasets in jail:

Syncthing data:

iocage exec syncthing 'mkdir -p /mnt/syncthing/data' iocage fstab --add syncthing '/mnt/tank/data/syncthing/sync /mnt/syncthing/data nullfs rw 0 0'

Start jail and enter.

iocage start syncthing iocage console syncthing


In the jail, update all packages and install syncthing.

pkg update && pkg upgrade pkg install syncthing

Enable the service on boot.

sysrc 'syncthing_enable=YES' sysrc 'syncthing_user=syncthing' && sysrc 'syncthing_group=syncthing' sysrc 'syncthing_dir=/var/db/syncthing'

Start the syncthing service.

service syncthing start


Start syncthing as an initial test:

service syncthing restart

Edit /var/db/syncthing/config.xml and change the IP address which the GUI will be accessible from. This will enable accessing the GUI from a remote computer:


<gui enabled="true" tls="false"> <address></address>; <apikey>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</apikey>; </gui>


<gui enabled="true" tls="false"> <address></address>; <apikey>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</apikey>; </gui>

Restart the service for changes to apply:

service syncthing restart

Finally, access the GUI by pointing a browser to the server's address and port, ie http://SERVER_URL:8384.

results matching ""

    No results matching ""