I wanted to install Dropbox on my Ubuntu server so I’ve done some research and ended up with the following steps.
The official guide can be found on the Dropbox website but to me is not good enough. I found a Digital Ocean guide which is far more detailed but is a bit messy.
In conclusion, I decided to write a much more comprehensive and simple guide for my head.
Download Dropbox Headless
Please note that it is recommended to do that in your home directory, the reason why you have the cd ~
command.
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
Run the Dropbox daemon
The previous command would create the .dropbox-dist
hidden directory in your home.
~/.dropbox-dist/dropboxd
The official guide states:
If you’re running Dropbox on your server for the first time, you’ll be asked to copy and paste a link in a working browser to create a new account or add your server to an existing account. Once you do, your Dropbox folder will be created in your home directory.
After doing that Dropbox would start to sync into the server all the cloud files. Just stop with CTRL+C
.
Download the Dropbox Python script
This allows controlling Dropbox from the CLI:
cd ~ && wget -O dropbox.py https://www.dropbox.com/download?dl=packages/dropbox.py
Next, we need to give executable permissions to the dropbox.py
file and eventually symlink to /usr/local/bin
so we can run the command by simply typing dropbox
:
chmod +x dropbox.py && ln -sf /root/dropbox.py /usr/local/bin/dropbox
Running Dropbox
dropbox start
and we’re good to go. Dropbox may get quite busy depending on how much stuff you have in the cloud.
dropbox help
gives you a nice list of available options.
You may want to exclude some folders from being synced to your server and to do that simply run
dropbox exclude add ~/Dropbox/folder-to-exclude/
Now I can play with rsync! 🙂
Someone may want to set Dropbox to start after a reboot. I’ve tried a few ways but I failed. Is not that important to me but I’ll try later with a fresh mind. In case, I’ll update this post.