How to make Duplicati start automatically with Ubuntu?

According to how I understand the material I have read so far on Duplicati, it can be set to start up automatically when I (re)boot Ubuntu, but I can’t see that setting anywhere, and it does NOT start automatically with Ubuntu (18.04).
Thank you.

1 Like

I’m not sure if the ubuntu DEB installs a systemd file (it should). If it did, just run:

sudo systemctl enable duplicati

If this fails, you don’t have a systemd file. You can grab the file here:
https://raw.githubusercontent.com/duplicati/duplicati/master/Installer/debian/debian/duplicati.service

Put that file in /etc/systemd/system

Then run the command above. And it will auto-start duplicati.
You can then use sudo systemctl start duplicati and sudo systemctl stop duplicati to start or stop the service.

2 Likes

Thank you! It seems to work. Copy from Terminal:

henrik@Henrik-L570:~$ sudo systemctl enable duplicati
[sudo] password for henrik:
Created symlink /etc/systemd/system/multi-user.target.wants/duplicati.service → /lib/systemd/system/duplicati.service.
henrik@Henrik-L570:~$

NO! I didn’t work! I have restarted Ubuntu, and Duplicati isn’t running.
(At least the icon is not shown!)

1 Like

The icon comes from the tray-icon (Duplicati.GUI.TrayIcon.exe), what you enabled (with @prez’s help) was the SERVICE.

The service is actually the important part where Duplicati does it’s thing - it will even run scheduled backups even if the tray icon isn’t showing or a user isn’t logged into the computer.

If you want the tray icon to start when you log into the the computer, you’ll need to add the tray-icon to your session / startup info.

Note that different distributions may work differently, but this should give you a starting point…

Hi!

Thank you for your response.
But My Duplicati does NOT look like yours.
My Duplicati has a web interface - http://localhost:8300/ngax/index.html - with the following menu:

Home
Add backup
Restore
Settings
About
Log out

So I don’t know what you are talking about?

Best regards,
Henr

Henr,

If you followed my instructions, the service should be running.

You can confirm this by running: ps -ef | grep -i Duplicati

You should see output similar to:
root 8144 1 0 Jun14 ? 00:00:00 DuplicatiServer /usr/lib/duplicati/Duplicati.Server.exe
root 8834 8144 51 Jun14 ? 1-04:13:35 /usr/bin/mono-sgen /usr/lib/duplicati/Duplicati.Server.exe

It might not be exactly the same, but that does show it is running. You should also be able to open your web browser to http://localhost:8200 and see your duplicati config screen.

The tray icon is not how you know if duplicati is running - the tray icon is more a way to start it manually (kind of). If you want to run something automatically, and in the background, even if you have not yet logged in, you have to do it as a service, which is what the instructions I gave you achieve. But you won’t have a tray icon if you do it that way (but it WILL be running).

Hi prez

Yes, thank you! That ‘ps’ command gives me a similar result (+3 lines more about GUI.TrayIcon).

It’s just a bit frustrating and confusing that the other guy - JonMikelV - refers to a screen/menu that I haven’t seen/found…

  • Henr
1 Like

Sorry if I made things more confusing. The screens I showed were not Duplicati specific, they are generic “here’s how you can get ANY app to start when you log into Ubunutu based LinuxLite” steps that just happen to be using Duplicati as the app to be started.

@prez is spot on in his explanation so feel free to ignore what I’ve said and. :slight_smile:

I ran this, nothing was returned, and Duplicati does not start at startup.

Ubuntu 18.04.2 LTS

http://localhost:8300/ngax/index.html says “Unable to connect”.

If I start Duplicati from Applications → System Tools, then that URL works, but it doesn’t start at startup.

Does anyone know how to do this?

If you want to run the graphical version of Duplicati (with the tray icon), you can create a shortcut like the following (I’m on Ubuntu 20.04)

  1. Start up Startup Application Preferences
  2. Click Add
  3. In the new dialogue box:
Name: "Duplicati GUI"
Command: "duplicati"
Comment: "Run Duplicati backup tool"

command: "duplicati" should work because if you look at duplicati.desktop:

[Desktop Entry]
Categories=System;Archiving;FileTools;Filesystem;
Type=Application
Name=Duplicati
GenericName= Backup tool
GenericName[es]= Copias de respaldo
Comment= Create and maintain local and remote backup copies of your data
Comment[es]= Cree y mantenga copias de seguridad locales y remotas
Exec=duplicati
Icon=duplicati
Terminal=false
StartupNotify=true

Exec=duplicati is what happens when you click the icon.

1 Like

Yes, by me on ubuntu 18.04 not started too. It was necessary to fix it with a workaround. I am not started directly the service /etc/systemd/system/duplicati.service. I create an own service file called duplicati-bash.service

[Unit]
Description=Duplicati web-server
After=network.target

[Service]
User=artur
ExecStart=/home/artur/duplicati-bash.sh

[Install]
WantedBy=multi-user.target

which started how you see my /home/artur/duplicati-bash.sh

#!/bin/bash
/usr/bin/duplicati-server

Important is to use #!/bin/bash and not #!/bin/sh and give the duplicati-bash.sh execute rights

With #!/bin/sh it by me not worked

Enable now the service so it automatically execute onBoot
sudo systemctl enable duplicati-bash.service

and disable the default duplicati service

sudo systemctl disable duplicati.service

now reboot your machine and it automatically start duplicati onBoot

you can access in browser under follow address
http://localhost:8200/ngax/index.html

greetings

Artur

1 Like

Thanks for the workaround, which seems to have removed quite a few lines and added an indirection through your own script on the way to /usr/bin/duplicati-server (original did ExecStart directly to there).

Were you able to figure out which change was the essential one, maybe by bringing some lines back? Unfortunately I’m not a systemd expert, and definitely can’t just glance at diffs, so testing is necessary.

Sorry I can’t tell you why it not worked with ubuntu 18.04 LTS. I use duplicati a long time and with Ubuntu 16.04 LTS all worked fine. I have spend 8hours to figure it out how to start it automatically by system-boot (18.04LTS). More I can’t say I am not developer of duplicati.