# I had attempted to write my own user `.service` before this and probably broke something from there, this is how I (probably) got rid of the mess I made (hard to tell which causes led to which effects, other than 'it worked')
# https://superuser.com/questions/513159/how-to-remove-systemd-services
systemctl stop nextcloud
systemctl disable nextcloud
systemctl daemon-reload
systemctl reset-failed
# all instructions from here relied on AI-generated answers (which worked)
# https://wiki.archlinux.org/title/Systemd/User
cat << EOF > ~/.config/systemd/user/nextcloud.service
[Unit]
Description=Nextcloud Client
After=graphical-session-pre.target
Wants=graphical-session-pre.target
[Service]
ExecStart=/usr/bin/nextcloud --background
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=default.target
EOF
systemctl --user enable nextcloud.service
systemctl --user start nextcloud.service
I don’t see the advantage of having nextcloud client as a systemd service being started automatically during boot - what is your use case?
Nextcloud’s autostart wasn’t working! I use my computer to work on important data but because I do development/testing occasionally things can go wrong and I have to reset OS / restore files: this way I don’t have to remember to activate Nextcloud ![]()