Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.

Install Dropbox On Ubuntu Server (10 & 11)

Dropbox FUSION Icon By Parthiban Mohanraj
Dropbox FUSION Icon By Parthiban Mohanraj

This post will help you install the Linux Dropbox client on your headless Ubuntu Server and link it up to your Dropbox account. Unlike the process of mounting an S3 bucket we looked at before the Dropbox approach is a much better solution for sharing files. If you’re a daily Dropbox user you’ll quickly get hooked on the convenience of having your servers in the same file sharing loop as all your other Dropbox connected devices!

Installing Dropbox

Start off by downloading the Linux version of Dropbox onto your server. These steps have been tested on Ubuntu Server 10.10 and 11.04.

Download the 32Bit Version

wget -O dropbox.tar.gz ""

Download the 64Bit Version

wget -O dropbox.tar.gz ""

If you unsure which version you need you can quickly check by running uname -a.

sudo uname -a

If the uname output has an i686 at the end you need the 32Bit version and if it has x86_64 you want the 64Bit version.

When you extract the Dropbox archive it will automatically place its files in the home directory of the the user you’re logged in as under: ~/.dropbox. You can always move these files later but its something to keep in mind.

Extract the Dropbox archive

tar -xzvf dropbox.tar.gz

Linking Your Server to Your Dropbox Account

Before you take the next step you’ll want to make sure your LANG environment variable is set to a value other than NULL.

Check the value of your LANG environment variable

printenv LANG     // outputs en_US.UTF-8 on my machine

To connect the Dropbox client on your server to your Dropbox account you’ll need to copy the link it outputs into a browser window and then login to your Dropbox account.

Run dropboxd on your server


It will start outputting a link similar to this one every few seconds

This client is not linked to any account...
Please visit to link this machine.

The trick to a smooth link is to make sure you leave dropboxd running while you follow the link. You don’t need to access the link from the server you’re trying to install Dropbox on. You can copy and paste that link into a browser running on a separate machine and Dropbox will authorize the client running on your server.

Once it succeeds you’ll see the message Client successfully linked, Welcome! on your server and it will stop printing the authorization link.

Hit ctrl c to terminate the process

Client successfully linked, Welcome!

Once the Dropbox client on your server is successfully linked it will automatically create a Dropbox folder under ~/Dropbox for the user you’re logged in as. All your folders will be visible under the Dropbox folder but since the Dropbox service isn’t actually running on your server yet you you won’t be able to see the files inside these folders until the client is running and has a check to synchronize.

You can manually start the service by running


However, a better option for controlling the Dropbox client is to setup an Ubuntu service management script for it.

Start Dropbox Automatically On Boot

Dropbox provides a handy little service management script that makes it easy to start, stop and check the status of the Dropbox client.

Create a new file for the service management script

sudo vi /etc/init.d/dropbox

Paste the following script into the new file

# dropbox service
# Replace with linux users you want to run Dropbox clients for
DROPBOX_USERS="user1 user2"
start() {
    echo "Starting dropbox..."
    for dbuser in $DROPBOX_USERS; do
        HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
        if [ -x $HOMEDIR/$DAEMON ]; then
            HOME="$HOMEDIR" start-stop-daemon -b -o -c $dbuser -S -u $dbuser -x $HOMEDIR/$DAEMON
stop() {
    echo "Stopping dropbox..."
    for dbuser in $DROPBOX_USERS; do
        HOMEDIR=`getent passwd $dbuser | cut -d: -f6`
        if [ -x $HOMEDIR/$DAEMON ]; then
            start-stop-daemon -o -c $dbuser -K -u $dbuser -x $HOMEDIR/$DAEMON
status() {
    for dbuser in $DROPBOX_USERS; do
        dbpid=`pgrep -u $dbuser dropbox`
        if [ -z $dbpid ] ; then
            echo "dropboxd for USER $dbuser: not running."
            echo "dropboxd for USER $dbuser: running (pid $dbpid)"
case "$1" in
        echo "Usage: /etc/init.d/dropbox {start|stop|reload|force-reload|restart|status}"
        exit 1
exit 0

Make sure you replace the value of DROPBOX_USERS with a comma separated list of the linux users on your machine you want to run the Dropbox client to run for. Each user in the list should have a copy of the Dropbox files and folders that you extracted from the archive, available under their home directory.

Make sure the script is executable and add it to default system startup run levels

sudo chmod +x /etc/init.d/dropbox
sudo update-rc.d dropbox defaults

Control the Dropbox client like any other Ubuntu service

sudo service dropbox start|stop|reload|force-reload|restart|status

Dropbox Delorean By Dropbox Artwork Team
Dropbox Delorean By Dropbox Artwork Team

Depending upon the number of files you have on Dropbox and the speed of your internet connection it may take some time for the Dropbox client to synchronize everything.

Check Status with Dropbox CLI

Dropbox has a command line python script available separately to provide more functionality and details on the status of the Dropbox client.

Download the script and adjust the file permissions

wget -O ~/.dropbox/ ""
chmod 755 ~/.dropbox/

You can download the script anywhere you like, I’ve included it along with the rest of the Dropbox files.

Now you can easily check the status of the Dropbox client

~/.dropbox/ status
Downloading 125 files (303.9 KB/sec, 1 hr left)

Get a full list of CLI commands

~/.dropbox/ help
Note: use dropbox help <command> to view usage for a specific command.
 status       get current status of the dropboxd
 help         provide help
 puburl       get public url of a file in your dropbox
 stop         stop dropboxd
 running      return whether dropbox is running
 start        start dropboxd
 filestatus   get current sync status of one or more files
 ls           list directory contents with current sync status
 autostart    automatically start dropbox at login
 exclude      ignores/excludes a directory from syncing

Use the exclude command to keep specific files or folders from syncing to your server

~/.dropbox/ help exclude
dropbox exclude [list]
dropbox exclude add [DIRECTORY] [DIRECTORY] ...
dropbox exclude remove [DIRECTORY] [DIRECTORY] ...
"list" prints a list of directories currently excluded from syncing.  
"add" adds one or more directories to the exclusion list, then resynchronizes Dropbox. 
"remove" removes one or more directories from the exclusion list, then resynchronizes Dropbox.
With no arguments, executes "list". 
Any specified path must be within Dropbox.

Once the Dropbox service is running and fully syncrhonized you can access all your Dropbox files and easily share files on your server with all your other Dropbox connected gadgets!

For more resources and troubleshooting tips visit the Dropbox forums. Happy syncing!

  • Prashant Raju

    Great post! Finally a guide that just works!

    Keep up the good work.

  • David Feinberg

    Thanks for the kind words Prashant, glad to hear you got everything working!

  • Installing dropbox on Ubuntu server « Putokaz
  • Anonymous

    What a great guide — very clear and, as Prashant said, it just works! Thanks and I look forward to your service launching.

  • David Feinberg

    thanks for the positive feedback djmccormick!

  • Jonas Nyström

    Great! Thanks! Using the Dropbox GUI, it’s possible to controll specifically what folders to be synced. Can this somehow be done from the command-line too?

  • David Feinberg

    You got it, you just have to use the exclude command.

  • Kyle

    For some reason, the nice format of this guide makes this look much friendlier. lol!

  • Darksteel Shaman

    Incredible guide! Got dropbox up and running in no time! Thanks a bunch :)

  • David Feinberg

    Glad to hear it worked out for you Darksteel and thanks for the positive feedback!

  • Dropbox on linux server – how to include/exclude folders? – Admins Goodies

    [...] Background: I’m trying out the solutions for installing Dropbox on a linux server given here, and it seems to work fine: [...]

  • Daniel

    Thank you for this post, very helpful :)

  • Adamjseed

    David, Great tutorial.

    Do you know how to move the drobox folder to a different location on a headless install?

    Im thinking that I may need to install the full client and forward the x11 to move it.

  • David Feinberg

    Have you tried manually changing the PARENT_DIR setting in the file?

  • David Feinberg

    Glad to hear it helped you out!

  • Sebastian Sawicki

    Haven’t you hear about upstart? Using /etc/init.d is deprecated ;]
    What’s more if you have root access it would be nice to place dropbox-dist files (which are mainly binaries and some libs) in some system folder. I’ve putted it in /opt/dropbox-dist :
    # sudo mv ~/.dropbox-dist /opt/dropbox-dist
    # sudo chown -R root:root /opt/dropbox-dist
    # sudo chmod -R go-w /opt/dropbox-dist

    …there is no need in having same binaries for each user.

  • David Feinberg

    Good tips Sebastian, thanks for sharing!

  • Using Dropbox for Web Development Anywhere – roguishcode | roguishcode

    [...] are many guides out there, but here is one I recommend (and used myself). Install Dropbox On Ubuntu Server (10 & 11) I like to exclude the syncing of any folder(s) I don’t want to be available for Apache to [...]

  • Toeu

    awful ubuntu guide =) thanx a 1000 times for describing in detail ! TöU

  • Install Dropbox on Server(New) | 侯三儿

    [...] Install Dropbox on your Server 32Bit Version wget -O dropbox.tar.gz “; 64Bit Version wget -O dropbox.tar.gz “; 下载CLI.解压后在当前用户家目录下得到~/.dropbox-dist/目录. 执行~/.dropbox-dist/dropboxd 得到信息说还没有link to account,去给出的网址登录一下,link成功 [...]

  • Skidder

    If you copy-paste from some browsers you’ll get a lot of TAB characters. Fix this in vi/vim with


    It replaces all TAB characters (t) with nothing.

  • Web Development Anywhere Using Dropbox – roguishcode | roguishcode

    [...] are many guides out there, but here is one I recommend (and used myself). Install Dropbox On Ubuntu Server (10 & 11) I like to exclude the syncing of any folder(s) I don’t want to be available for Apache to [...]

  • Jorgen

    Great work! Thanks a lot!!!

  • eagle

    Thank you so much. This is the first linux tutorial I have not had to rewrite for my own understanding and as such deserves praise. Congratulations on making by far the best Dropbox CLI tutorial and the best Linux CLI tutorial I have read.

  • David Feinberg

    Thanks eagle, I’ve been meaning to blog more but I’ve been consumed with coding. Comments like these get me motivated again. Any suggestions on other topics?

  • Jason Vanderzalm

    Instructions worked perfectly – made me feel like a ubantu expert!

  • Ivan Karpan

    BTW you can connect to the server via
    ssh -X
    And this way you will be able to do the set up with a GUI. And set up selective syncing.

  • » Linuxaria – Everything about GNU/Linux and Open source Install Dropbox On Ubuntu Server (10 & 11)

    [...] After the last article of Dropbox I thought it was useful to show how you can use Dropbox also on a server without a GUI, this useful article by David Feinberg was published on [...]

  • Erik013

    to download it I need to add “–no-check-certificate” option as follow
    wget -O dropbox.tar.gz “″ –no-check-certificate

  • David Feinberg

    thanks for sharing that tip!

  • Sierraalphaindia

    Fantastic guide – thanks! This is now synchronizing my code on multiple servers…

  • the lonewolf

    works like a dream! just one query tho, will the fownload to the dropbox actually continue even tho the user has logged out of the server? (before anyone says it yes thats a DURRR! question but i just wondered! and im a near novice on ubuntu server!)

  • David Feinberg

    glad you got everything setup lonewolf! syncing will continue even when you logout of the server.

  • Selective Dropbox sync for Ubuntu » Refactored scope

    [...] a good tutorial to setup the CLI Dropbox agent – This one is the most concise [...]

  • install Dropbox on a headless Ubuntu 10.04 LTS server « my tiny TechBlog
  • Anonymous

    Awesome! Thanks!

  • maxxer

    the user list is space separated, not comma

  • Seth Davis

    Wow, phenomenal guide! Every how-to on the internet needs to follow this format! With a guide like this, I don’t want to constantly set my linux server on fire.

  • David Feinberg

    Glad it worked out for you Seth! Now put down the torch and step away from the linux server :)

  • darkpollo

    Great guide. Thanks! Do you know how to make the same with SpiderOak?

  • David Feinberg

    Thanks for the feedback! I haven’t played with SpiderOak but I’ll definitely check it out.

  • Stephen

    Many thanks for this, is there any reason why this wouldn’t work in Ubuntu 12?

  • potes

    thanks for the guide. Its work great in ubuntu server 12.04

  • Jason McKenzie

    So very helpful. Thank you!

  • Stanko Trček

    What else to say, thank you.

  • clumsybell

    Great walkthrough, really concise, clear, and informative. Thanks!

  • Adam Heim

    Seriously thank you for this guide, have made moving files between my ubuntu VM and my win7 computer much easier!

  • Dražen Lučanin

    A handy one-liner to exclude everything from syncing

    ~/.dropbox/ exclude add `for f in ~/Dropbox/*; do echo -n $f” “; done`

    After this you can enable some specific folder using

    ~/.dropbox/ exclude remove ~/Dropbox/wanted-folder

  • David Feinberg

    Awesome tips! Thanks for sharing.

  • Péter Nagy

    thanks for the great tutorial!

  • Paul Seyler

    Is it possible to configure Dropbox to start immediately upon boot, even if no user is logged in? Possibly as a root service, rather than linked to one or more individual user accounts?

    Thanks for the great tutorial so far!

  • Anonymous

    Quality guide – thanks!