# MacOS / OSX service installation

**URL:** <https://forum.duplicati.com/t/macos-osx-service-installation/968>\
**Category:** Support\
**Created:** [October 10, 2017, 5:16pm UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968 "2017-10-10T17:16:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [October 10, 2017, 5:16pm UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/1 "2017-10-10T17:16:01Z")

</div>

I’m looking to put together a how-to for shifting a Mac installation of Duplicati to a service, but the only stuff I’m finding (such as [Running as a Service on Mac](https://groups.google.com/forum/#!topic/duplicati/1umuO_vP86E) is so old it doesn’t work with current versions of MacOS…

Unfortunately, I’m not super familiar with Macs either so I’m not sure how to build a current OS version supported .plist file to send to launchctrl (or even if such as thing is needed) - but I am willing to play around with stuff!

So if anybody has any suggestions on how to get Duplicati going as a service on more recent MacOS versions, please share - I’ll test and post it here (unless you want to do it yourself).

---

<div class="post-metadata">

**Author:** ![mohak](https://forum.duplicati.com/user_avatar/forum.duplicati.com/mohak/32/3113_2.png) [@mohak](https://forum.duplicati.com/u/mohak)\
**Post date:** [October 11, 2017, 10:39am UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/2 "2017-10-11T10:39:53Z")

</div>

Warning: I have not tested either of these plists yet and won’t be able to for few more hours 🙂 .

Try placing [this plist](https://gist.github.com/mohakshah/6ec2351bcf8e6898b4a3f79bfc2f12cf#file-net-duplicati-server-plist) in `/Library/LauncDaemons/`. Then either reboot or run `sudo launchctl load -w /Library/LaunchAgents/net.duplicati.server.plist`. This should start the server as root and make it accessible from the usual URL.

For the Tray Icon, you’ll need [this plist](https://gist.github.com/mohakshah/6ec2351bcf8e6898b4a3f79bfc2f12cf#file-net-duplicati-tray-icon-plist) in either `/Library/LaunchAgents` to run when any user logs in or `~/Library/LaunchAgents/` to run when only a specific user logs in. You may need to change this line:

```
<string>/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono</string>

```

if your mono installation differs (check by running `which mono` in Terminal)

---

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [October 11, 2017, 1:43pm UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/3 "2017-10-11T13:43:55Z")

</div>

Awesome, thanks!

No hurry the testing, I won’t be back on my Mac until Monday. 🙂

---

<div class="post-metadata">

**Author:** ![kenkendk](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kenkendk/32/5305_2.png) [@kenkendk](https://forum.duplicati.com/u/kenkendk)\
**Post date:** [October 12, 2017, 12:52pm UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/4 "2017-10-12T12:52:06Z")

</div>

For the tray-icon, I think you need to use `open`, otherwise it will not have the right MacOS context. The “autostart” file from the installer is here:

> <https://github.com/duplicati/duplicati/blob/master/Installer/OSX/daemon/com.duplicati.app.launchagent.plist>

This should avoid the call to Mono. Also, Mono can be found at “various” places, so Duplicati ships with a launcher that can start the executables with Mono:

> <https://github.com/duplicati/duplicati/blob/master/Installer/OSX/run-with-mono.sh>

You can use it like this:

> <https://github.com/duplicati/duplicati/blob/master/Installer/OSX/Duplicati-trayicon-launcher>

---

<div class="post-metadata">

**Author:** ![mohak](https://forum.duplicati.com/user_avatar/forum.duplicati.com/mohak/32/3113_2.png) [@mohak](https://forum.duplicati.com/u/mohak)\
**Post date:** [October 12, 2017, 9:56pm UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/5 "2017-10-12T21:56:48Z")

</div>

> [@kenkendk](#):
>
> For the tray-icon, I think you need to use open, otherwise it will not have the right MacOS context

I guess using `open` should take care of mono’s path. Although it seems I still need to pass ` --hosturl="http://localhost:8200" --no-hosted-server` for it to work. I have updated [net.duplicati.tray-icon.plist](https://gist.github.com/mohakshah/6ec2351bcf8e6898b4a3f79bfc2f12cf#file-net-duplicati-tray-icon-plist) accordingly.

---

<div class="post-metadata">

**Author:** ![mohak](https://forum.duplicati.com/user_avatar/forum.duplicati.com/mohak/32/3113_2.png) [@mohak](https://forum.duplicati.com/u/mohak)\
**Post date:** [October 17, 2017, 12:59am UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/6 "2017-10-17T00:59:08Z")

</div>

I did finally test the plists which seem to work, albeit with a couple of glitches:

- The tray icon is always in the “error” mode, except when a backup is running. Yet the Web-GUI shows no errors or warnings whatsoever
- The “Show Log” section of the Web-GUI doesn’t show any logs, even after running a couple of backups.

I think the two could be related, but I am not certain exactly what is causing this problem.

---

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [October 17, 2017, 5:43am UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/7 "2017-10-17T05:43:39Z")

</div>

Heh. I too got around to testing today.

I found the service plist to work quite well, though in an unrelated issue I’m having permission issues between user accounts.

I didn’t have time to test the tray icon. Note that your “always error” icon might be related to a known install issue that is resolved by forcing an error (and subsequent icon reset) such as by starting then canceling a backup.

---

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [October 31, 2017, 12:28am UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/8 "2017-10-31T00:28:29Z")

</div>

I tried the `net.duplicati.tray-icon.plist` file in `/Library/LaunchAgents` but for some reason the auto-start (and manual start) tray icon is still opening to port 8300 .

---

<div class="post-metadata">

**Author:** ![mohak](https://forum.duplicati.com/user_avatar/forum.duplicati.com/mohak/32/3113_2.png) [@mohak](https://forum.duplicati.com/u/mohak)\
**Post date:** [October 31, 2017, 7:25am UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/9 "2017-10-31T07:25:50Z")

</div>

I thought 8200 was the default port. Why would the tray icons open to 8300? 🤔

Did you remove the regular Duplicati autostart from `System Prefs->User->Login Items`?

---

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [October 31, 2017, 11:53am UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/10 "2017-10-31T11:53:13Z")

</div>

> [@mohak](#):
>
> I thought 8200 was the default port. Why would the tray icons open to 8300?

Yes, 8200 is the DEFAULT port - but when dealing with multiple “users” (including the service, if running) startup order can cause things to get messy.

> [@Service (8300) tray (8200) toggle](https://forum.duplicati.com/t/service-8300-tray-8200-toggle/1143/8):
>
> Duplicati tries different ports, starting with 8200. The first user to log in will get that port, the next will get port 8300, next on 8400. The port number is recorded in the settings database, such that the next launch will attempt to keep this number. This can go wrong, say that Kees is 8200, Ken is 8300, but then the machine reboots and Jon logs in for the first time. He will then get 8200, and when Kees logs in, Duplicati will see that 8200 is taken and scan for a new one, finding 8300, e…

---

<div class="post-metadata">

**Author:** ![mohak](https://forum.duplicati.com/user_avatar/forum.duplicati.com/mohak/32/3113_2.png) [@mohak](https://forum.duplicati.com/u/mohak)\
**Post date:** [November 3, 2017, 4:32pm UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/11 "2017-11-03T16:32:07Z")

</div>

I understand this behaviour when multiple users are each running their own Duplicati service + tray icon; but I wonder why this would happen when there is only a single instance of the service running as the root?

---

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [November 3, 2017, 5:37pm UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/12 "2017-11-03T17:37:51Z")

</div>

> [@mohak](#):
>
> I wonder why this would happen when there is only a single instance of the service running as the root

You are correct - if the service is the only Duplicati server running, then this wouldn’t happen as even individual users would be connecting to the same service server.

---

<div class="post-metadata">

**Author:** ![kenkendk](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kenkendk/32/5305_2.png) [@kenkendk](https://forum.duplicati.com/u/kenkendk)\
**Post date:** [November 9, 2017, 4:43pm UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/13 "2017-11-09T16:43:34Z")

</div>

> [@mohak](#):
>
> but I wonder why this would happen when there is only a single instance of the service running as the root?

If there _was_ something using port 8200 when the instance running as root started, it will try another port, and from then on it remembers which port worked and starts with that as the first attempt.

So maybe something else was using port 8200 ?

---

<div class="post-metadata">

**Author:** ![david](https://forum.duplicati.com/user_avatar/forum.duplicati.com/david/32/1081_2.png) [@david](https://forum.duplicati.com/u/david)\
**Post date:** [January 10, 2018, 10:44pm UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/14 "2018-01-10T22:44:26Z")

</div>

I’m having similar issues. I have the two .plist files in /Library/LaunchAgents and /Library/LaunchDaemons; both specify port 8200 and the tray-icon one specifies no-hosted-server.

However somehow I’ve ended up with my config using 8300, so when I start my system from scratch, neither localhost:8200 nor opening from the menu shows my config. I have to quit the menu and reopen Duplicati from /Applications (to launch on 8300) to see my config.

How do I get my config back on port 8200?

---

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [January 12, 2018, 1:44am UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/15 "2018-01-12T01:44:05Z")

</div>

> [@david](#):
>
> I have the two .plist files in /Library/LaunchAgents and /Library/LaunchDaemons; both specify port 8200 and the tray-icon one specifies no-hosted-server.

I’d have to test but I think the issue might be that you are telling the tray-icon one (is that LaunchAgents?) both a port number (which says “use this port for your server”) AND `--no-hosted-server` (which says “don’t host your own server”) so it’s getting conflicting parameters.

I suspect if you quit the tray-icon (right click on it and select Quit) port 8300 will stop working but port 8200 will continue to load. This means that the daemon/service is loading first (and taking port 8200) then the tray-icon is loading TRIES for port 8200 but sees it’s in use so moves on to port 8300.

* * *

Unless you’ve already got a big backup created or a lot of jobs configured, the easiest way to shift from port 8300 (tray-icon) to port 8200 (daemon/service) is probably to export the job from one then import into the other.

I’d then suggest renaming the port 8300 job to something like “DO NOT USE” or “WRONG PORT!” - that way if this happened again you’d have a visual notice of what was going on rather than “crap, all my configs disappeared!”. If you do decide to delete the 8300 job (after confirming it works at port 8200) make sure to only delete the config. You can delete the database only if you didn’t point the port 8200 job to the old port 8300 .sqlite file. (If you do delete the database, that’s OK - it can be recreated, but it takes a while for Duplciati to chunk through every thing.

Unless you’re planning to start your backups from scratch, whatever you do, _ **DO NOT** _ delete the destination files as this is your already backed up content. If you delete that there’s no recovering it - you’ll just have to start your backups from the beginning again.

---

<div class="post-metadata">

**Author:** ![david](https://forum.duplicati.com/user_avatar/forum.duplicati.com/david/32/1081_2.png) [@david](https://forum.duplicati.com/u/david)\
**Post date:** [January 12, 2018, 8:25am UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/16 "2018-01-12T08:25:12Z")

</div>

Thank you for the response 👍

You’re exactly right in your analysis; I tried to export my config from 8300 to 8200 but this caused problems with some of my source file paths.

However, I realise I was over-complicating things for myself. I have removed both plist files and have simply added Duplicati.app to my login items. I only have one user on this machine so this works well enough for me.

Slight disadvantage though is that this causes the browser to open at [http://localhost:8200/](http://localhost:8200/) on login but I can live with that (perhaps an option to control this could be included in a future release).

---

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [January 13, 2018, 6:01am UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/17 "2018-01-13T06:01:52Z")

</div>

> [@david](#):
>
> Slight disadvantage though is that this causes the browser to open at [http://localhost:8200/](http://localhost:8200/) on login

You mean when you log in your browser opens to Duplicati? If so,that’s odd as I have a similar set-up (i think) but that doesn’t happen to me…

---

<div class="post-metadata">

**Author:** ![david](https://forum.duplicati.com/user_avatar/forum.duplicati.com/david/32/1081_2.png) [@david](https://forum.duplicati.com/u/david)\
**Post date:** [January 14, 2018, 10:22am UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/18 "2018-01-14T10:22:08Z")

</div>

My mistake; I must have had “reopen windows on login” selected when I logged off… Didn’t happen to me just now after a restart 😳

As you were!

---

<div class="post-metadata">

**Author:** ![chrismush](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@chrismush](https://forum.duplicati.com/u/chrismush)\
**Post date:** [February 22, 2018, 5:00am UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/19 "2018-02-22T05:00:43Z")

</div>

Hope I can jump in this thread as I’m having a similar issue. If you want, I can create a new thread if that is better…

Summary of my issue:

- I created the 2 plists per above and put them in the appropriate directories
- When I start up, the icon has a X in it
- If I select open on the open, it opens a web page (8200) but it doesn’t have any backup sets in it
- If I try launching the app, nothing happens
- If I try going to 8300 it can’t find anything

I originally just added the app to my start up items, but like the others, it launches the web browser upon log in. I made sure ‘reopen windows at login’ in not selected, and I even quit safari prior to logging out.

Any ideas? I assume this is working successfully for someone.

Thanks!

---

<div class="post-metadata">

**Author:** ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)\
**Post date:** [February 22, 2018, 5:03pm UTC](https://forum.duplicati.com/t/macos-osx-service-installation/968/20 "2018-02-22T17:03:53Z")

</div>

> [@chrismush](#):
>
> When I start up, the icon has a X in it

This may not apply to you, but it is a known scenario for the icon to show the “X” if no jobs have been run yet.

> [@chrismush](#):
>
> it opens a web page (8200) but it doesn’t have any backup sets in it

What backups are you expecting to see? Did you already create some that “disappeared” when you shifted to service installation?

> [@chrismush](#):
>
> If I try launching the app, nothing happens

What “app” are you trying to open? Other than the GUI (which is the tray icon / web interface) things are pretty much all command line, so it’s possible the shell is opening, showing an error message or help screen then closing again before you can see it.

> [@chrismush](#):
>
> If I try going to 8300 it can’t find anything

Port 8300 should only come into play if you’re running more than one instance of Duplicati, such as the service and self-serving try icon or perhaps a self-serving tray icon in two different user logins.

[Next page](https://forum.duplicati.com/t/macos-osx-service-installation/968.md?page=2)
