Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed Dropbox 2.0.0 via command line on my home server (Ubuntu Server 12.04) to use for off-site automated backups, but I can't change the directory that the Dropbox daemon keeps synced.

I've tried the following:

The official docs say to use the desktop application, which is not applicable in my situation. However I installed the desktop app on my desktop machine and changed the default folder location, but I can't find where this change is stored in the ~/.dropbox/ directory so I can make the same change on the server.

This page (and several others) recommends a Python script to do the job. Looking at the script, it opens a SQLite database called ~/.dropbox/dropbox.db, which does not exist on my Dropbox install, leading me to believe the script is out-of-date.

This forum thread suggests manually inserting the required row in the config.db database, which I did, but it made no difference. I checked the same database file on my desktop machine, and it does not have the dropbox_path key, so I'm presuming the information in that thread is also out of date for version 2.0.

I have tried to launch the Dropbox GUI configuration wizard over SSH with X11 forwarding, as suggested in one of the answers, but the binary must detect the absence of a local X11 install and it starts a command line daemon instead, which provides no means to change the option I need.

I am currently using a symlink, as suggested as an answer, but this is a kludge. I would like to know the correct way to make the change.

How do I change the Dropbox directory on a headless GNU/Linux server?

Update: I've ditched Dropbox and started using Copy. Their Linux tools and support is far superior to Dropbox. I leave this question here in case someone, someday, can answer it.

share|improve this question
My answer notwithstanding, if this is your home server why don't you just connect a screen to it, make the changes and take the screen away again? – terdon Mar 30 '13 at 2:40
@terdon, There is no X11 to run the Dropbox desktop app. – x-x Mar 30 '13 at 2:51
Ah, OK, fair enough, try my answer then, it should work. My home headless server actually has X, it is just not started by default and there is no screen attached, that's why I asked. I tested my answer on a real headless, X11-less server though and it worked. X11 forwarding uses the local X server and does not need one to be running on the remote machine. – terdon Mar 30 '13 at 3:02

You could just create a symlink to ~/Dropbox

ln -s <dir-that-you-want-to-sync> ~/Dropbox
share|improve this answer
The question asks, "How can I change the Dropbox directory...", symlinking is not the answer. – x-x Mar 30 '13 at 4:12
But it takes care of the reason for which you want to change the Dropbox directory, cf. XY problem – Aditya Mar 30 '13 at 4:19
Actually. I think this won't work, I remember having trouble with symlinks not working with Dropbox. – terdon Mar 30 '13 at 4:26
Symlinking does work, and it's what I was using before asking this question, but it is a Kludge. I came here to find out the correct way to make the change. I will update the question to reflect this. – x-x Mar 30 '13 at 4:37

If you have ssh access to the machine in question, you might be able to launch the dropbox desktop application on the headless server and have it displayed on your local machine:

  1. Connect to the server using X11 port forwarding

    ssh -Y user@server
  2. Now launch the dropbox app, it should appear on your local screen


    It may take a while depending on your network connection. Don't give up if you don't get an error message. I can confirm that this worked when I connected from my Debian box to a remote, Ubuntu server that was running no X server. After a few seconds, a second Dropbox icon appeared on my local taskbar and I could access/modify the options of the remote Dropbox install from there.

Now, some details may change since I am using Dropbox 1.6.18 but the basics should be the same. In case the name or location of the app have changed, this is how I found out what command I need to execute to launch the Dropbox desktop app:

  1. Get the list of currently running processes

    top -cbd .10 -n 1 | sort > no_drop.txt
  2. Launch the Dropbox app (right click on the Dropbox icon in your taskbar and chose "Preferences...") and repeat

    top -cbd .10 -n 1 | sort > drop.txt
  3. Compare the files to find the relevant command

    diff drop.txt no_drop.txt
share|improve this answer
There is no GUI app to forward, only dropboxd, the Dropbox daemon. – x-x Mar 30 '13 at 3:08
Did you try the top and diff trick I suggested? Launch the app on your local machine, something must be launched, therefore there is a command. If, in the new version, the only command is the daemon, then launch the daemon, it will still appear on your taskbar. – terdon Mar 30 '13 at 3:11
On my desktop machine, running ~/dropbox-dist/dropbox launches a GUI configuration wizard. On the server, through the ssh connection with X11 forwarding on, ~/dropbox-dist/dropbox launches a daemon which instructs me to go to a specific URL to 'link this machine'. Both the server and the desktop are using the exact same archive to install the dropbox files. In the archive the only two executable files are dropbox, and dropboxd, the later is just a shell script to set LD_LIBRARY_PATH and launch the former. – x-x Mar 30 '13 at 3:22
Hmm, my remote server has been linked. If I remember correctly, I had to launch a graphical browser (lynx couldn't do it) on the remote machine (always using X11 forwarding) and link the machine using that browser. Try doing that and then launching ~/dropbox-dist/dropbox again. At least we have confirmed it works, the daemon you mention is graphical and is displayed on your local screen right? Therefore, once you have linked your server to your account, you should be able to configure it as described in my answer. – terdon Mar 30 '13 at 3:26
It was linked, I just deleted the configuration from ~/.dropbox to start from scratch. "the daemon you mention is graphical and is displayed on your local screen right?" No, it is not graphical when run on the server. It must be detecting the absence of X11 and going into command line only mode, despite X11 forwarding being on. – x-x Mar 30 '13 at 3:37

This might be what you're looking for:

Set up Dropbox on a GUI-less Linux server

I apologize for simply tossing an URL instead of describing the procedures here. I'm at work and can't elaborate more right now. Later I can expand on the answer, I just don't want to lose this valuable URL with your solution.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .