Dropbox works with DigitalOcean Droplets!

July 7, 2013 11k views
I thought I'd share something useful: Dropbox has a headless Linux client. It's entirely self-contained. You can use a standard Ubuntu image without any package dependencies. You can even make a temporary user to install and test it without using root. You can use such a Dropbox setup to sync all or part of a Dropbox account on a Droplet. I wouldn't use it for production, but this is promising as a quick and easy prototyping and development tool. It's also handy if you want to link up temporarily and get rid of some clutter if you have a big image sharing folder or the like. You can then view and organize using your standard Desktop tools, and unlink afterward. It also means you can use any of a myriad of iOS and Android programmers' text editors with Dropbox integration built in. These let you update the site in real time. If your connection drops, you don't get booted as with a shell. Instead, it will merely sync when you reenter a coverage area. What you need: 1. A Dropbox account. Use what you already have, or use my referral for a free account with an extra 500 megs: http://db.tt/TnWRgX1 (If you find it useful enough to stick around, I think I eventually get a little space too :) 2. The Linux client. Connect to a droplet and use one of these commands: 32-bit Linux: cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf - && ~/.dropbox-dist/dropboxd 64-bit Linux: cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf - && ~/.dropbox-dist/dropboxd Note that you can do this with a regular user account. Root is neither required nor encouraged. The above launches a temporary instance of the dropbox daemon. That's sufficient for full use, but requires you to keep a terminal open (or at least a screen session). Look at dropboxd for more options if you want to launch this from an init script. Otherwise, with this approach you can kill it with ^C at any time. You can also find .debs and .rpms for more permanent installations at: https://www.dropbox.com/install?os=lnx The client will now give you a link to visit in your browser. If you follow that link, you'll be prompted for a password on the Dropbox site. This issues a token for Dropbox use so you don't have to store your Dropbox password on the Linux instance. At this point, Dropbox is mirroring the contents of a new ~/Dropbox folder. Any files you drop into this folder from any other client will appear on your Linux machine instantly. They use filesystem change notifications to catch changes as they happen. This means there is no manual sync step, and no waiting for the client to notice changes. You probably don't want to host content out of your Dropbox folder, but there's a basic trick for mirroring Dropbox content outside of the Dropbox folder: create a symbolic link. Example: ln -s /var/www/foo.com ~/Dropbox/foo.com This will cause Dropbox to treat /var/www/foo.com as if it resided inside the Dropbox folder. All other clients will see foo.com as a folder within the Dropbox folder, and will transparently sync across that symlink. If you don't have the Dropbox client on your desktop, you can get that at: https://www.dropbox.com/downloading And mobile clients: https://www.dropbox.com/mobile For mobile text editors, etc with Dropbox built in, just search the Apple App Store, Google Play, etc. There are hundreds of Dropbox-enabled apps. Caveats: All files will be created as the user Dropbox is run as, and will use default file and directory permissions. Check your default masks if you have a special use case. Cleaning up: If you've had a test run with Dropbox on your Droplet but you want to eliminate it, do this: 1. ^C to stop the dropbox program 2. Kill all Dropbox files: rm -Rf ~/.dropbox* ~/Dropbox 3. Revoke the token that was issued for your test session by clicking "unlink" next to your Droplet's host name: https://www.dropbox.com/account#security At any point in the future, you can repeat the install step in order to sync up to the current state of your Dropbox account and do further development, experimentation or decluttering.
  • Thanks for the writeup Brian.

    I am trying to serve a jekyll blog (static HTML) using Dropbox and nginx - is it necessary to hold HTML files in the Public folder in order to properly view them? I've tried to symlink between my nginx public html and dropbox html content but get 404s back.

    Thanks for any help ~Jonathan

  • @hungai Symlinks should be fine. One thing to look out for are permissions errors. You'll need to make sure the files are accessible by the www-data user.

  • I have 1TB on my dropbox and only 30GB on my droplet. Is there a way to sync only certain dropbox folders?

9 Answers
Thanks, Pablo. I don't think it's polished enough for that. If anyone wants to try cleaning it up and submitting it for their own reward, I think that's 90% of the work and you have my permission. :)
Would you mind formatting this properly?
Thanks to @brian.mcgroarty, I was able to polish-up step-by-step instructions on deploying Dropbox on a DigitalOcean cloud server: How To Install & Configure Headless Dropbox as a Service on Ubuntu 12.04 | vDevices.
Pablo: Do you know if there's a way to do Selective Sync? I've got > 6 TB in my Dropbox account, and I only want to sync certain directories.

Why can't we install the GUI Dropbox client on DigitalOcean Droplets?
Arthur, the link Pablo sent shows you how to do it from the command-line: ~/.dropbox/dropbox.py help exclude

I have been trying to get this to work on my DO Debian Jessie box for a couple weeks. When I run the command: ~/.dropbox-dist/dropboxd it doesn't ask me to connect to a dropbox account. It just sits there (I even let it sit for a day once).

If I connect to it via strace, it stops at: futex(0xb7737058, FUTEXWAKEPRIVATE, 2147483647) = 0
which makes me think it's waiting for something. I have the full strace if that would be useful.

I've installed this client on Ubuntu and Mint in the past or on Debian with X, but never headless. What am I doing wrong?

Thank you.


  • I had the same issue when I login to my droplet using SSH. Then I figured out that it the link will be shown if you access your droplet using console access on your digital ocean account. I guess the link cannot be transmitted over SSH connection. However, you cannot select and copy text from digital-ocean console access. My workaround is to install web based terminal emulator that allow for select and copy the key link and paste it on my web browser to get dropbox authentication.

i`m always get this error:
Couldn't start Dropbox.
This is usually because of a permissions error. Storing your home folder on a network share can also cause an error.

Get more help at https://www.dropbox.com/c/help/permissions_error

I just dont know where to put this permissions

Have another answer? Share your knowledge.