Using homebrew
brew install syncthing
- Follow the info to autostart syncthing using launchctl. At the moment this is done using this command:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.syncthing.plist
.
Download syncthing for Mac: https://github.com/syncthing/syncthing/releases/latest.
- Copy the syncthing binary (the file you would open to launch syncthing) in a directory called
bin
in your home directory. If "bin" does not exist, create it. - Edit the
syncthing.plist
(located in /etc/macosx-launchd) in the two places that refer to your home directory; that is, replace /Users/jb with your actual home directory location. - Copy the
syncthing.plist
file to~/Library/LaunchAgents
. If you have trouble finding this location select the "Go" menu in Finder and choose "Go to folder..." and then type~/Library/LaunchAgents
. Copying to ~/Library/LaunchAgents will require admin password in most cases. - Log out and back in again. Or, if you do not want to log out, you can run this command in terminal:
launchctl load ~/Library/LaunchAgents/syncthing.plist
Note: You probably want to turn off "Start Browser" in the web GUI settings to avoid it opening a browser window on each login. Then, to access the GUI type 127.0.0.1:8384 (by default) into Safari.
- Click the dashboard (hit 'Win' button).
- Open 'Startup Applications'.
- Click 'Add'.
- Fill out the form:
- Name: Syncthing
- Command: /path/to/syncthing/binary -no-browser -home="/home/your_user/.config/syncthing"
Add following to your /etc/supervisord.conf.
[program:syncthing]
command = /path/to/syncthing/binary -no-browser -home="/home/some_user/.config/syncthing"
directory = /home/some_user/
autorestart = True
user = some_user
systemd is a suite of system management daemons, libraries, and utilities designed as a central management and configuration platform for the Linux computer operating system. It also offers users the ability to manage services under the user's control with a per-user systemd instance, enabling users to start, stop, enable, and disable their own units. Service files for system are provided by syncthing and can be found in etc/linux-systemd
. Several distros (including arch linux) ship these service files with the syncthing package. If your distro provides a systemd service file for syncthing you can skip step 2.
Running synchting as a system service ensures that syncthing is run at startup even if the syncthing user has no active session.
- Create the user who should run the service, or choose an existing one.
- Copy the
system/[email protected]
file into the load path of the system instance. - Enable and start the service. Append the syncthing user after the
@
:
systemctl enable [email protected]
systemctl start [email protected]
Running synchting as a user service ensures that syncthing is run after the syncthing user has created a session (e.g. via the graphical login screen or ssh). This could be used e.g. on a multiuser desktop computer when you want to avoid unnecessarly running syncthing instances.
- Create the user who should run the service, or choose an existing one.
- Copy the
user/syncthing.service
file into the load path of the user instance. To do this without root privileges you can use~/.config/systemd/user/
. - Enable and start the service:
systemctl --user enable syncthing.service
systemctl --user start syncthing.service
To check if syncthing runs properly you can use the status
subcommand:
systemctl status [email protected]
systemctl --user status syncthing.service
Systemd logs everything into the journal. You can easily acces syncthing log messages (-e
lets the pager jump to the very end):
journalctl -e -u [email protected]
journalctl -e --user-unit=syncthing.service
If you are asked on the bugtracker to start syncthing with specific environment variables it will not work the easy way. Systemd isolates each service and it cannot access global environment variables. The solution is to add this variables to the service file instead. Just use:
systemctl edit [email protected]
systemctl --user edit syncthing.service
This will create an additional configuration file automatically and you can define (or overwrite) further service parameters like e.g. Environment=STTRACE=model
.