Skip to content

Instantly share code, notes, and snippets.

@elduglas
Created April 16, 2017 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elduglas/d3e4f3ce69c93778240b6fcb8281f040 to your computer and use it in GitHub Desktop.
Save elduglas/d3e4f3ce69c93778240b6fcb8281f040 to your computer and use it in GitHub Desktop.
Installing Dropbox 6+ on Ubuntu Xenial 16.04 and getting it to start on reboot.

Installing Dropbox 6+ on Ubuntu Xenial 16.04 and getting it to start on reboot.

Hat-tip to pointer2null in the Dropbox wiki for the [systemctl info] (http://www.dropboxwiki.com/tips-and-tricks/install-dropbox-in-an-entirely-text-based-linux-environment#comment-2426857341)

As root

sudo add-apt-repository "deb http://linux.dropbox.com/ubuntu xenial main"
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5044912E
sudo apt-get update
sudo apt-get install python-gpgme dropbox 

Then switch to the user dropbox is intended to run as. So...

su (whoever)
cd ~
dropbox start -i

Let the client install - however, it will fail to start. So run

~/.dropbox-dist/dropboxd

Paste the token into a browser, logged into the account of the dropbox you wish to connect.

##The essential part to get it autostarting on reboot

Edit nano /etc/systemd/system/dropbox.service and paste this - don't forget to modify User and Group in the script

[Unit]
Description=Dropbox Service
After=network.target

[Service]
ExecStart=/bin/sh -c '/usr/bin/dropbox start'
ExecStop=/bin/sh -c '/usr/bin/dropbox stop'
PIDFile=${HOME}/.dropbox/dropbox.pid
User=user
Group=group
Type=forking
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target

Use systemctl start dropbox.service to start the service now.

Use systemctl enable dropbox.service to make it start automatically at boot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment