How to Install and Configure Dropbox on Ubuntu Server 12.04

Dropbox is the best free cloud service and extremely easy-to-use tool for sharing files and syncing them between computers, and you can also use Dropbox to back up files and access them from other computers and devices (including from your Android Smartphone, android tablets and iPad or iPhone, with dedicated Client apps for each of those devices). How to make dropbox features and services available on ubuntu server?

in this post I would like to show you step by step How to Install Dropbox on Ubuntu Server 12.04 and Sync up to your Dropbox Account. Lets start it.

Installing Dropbox on Ubuntu Server

Step 1. Download dropbox via Offically dropbox site:

Dropbox for 32-bit Architecture:

wget -O dropbox.tar.gz

Dropbox for 64-bit Architecture:

wget -O dropbox.tar.gz

Step 2. Extract Dropbox archieve with command below

tar -zxvf dropbox.tar.gz

Step 3. Run the dropbox client deamon on ubuntu server with command below:


Sync Ubuntu Server with Your Dropbox Account

If your ubuntu server is not link to any dropbox account yet, so you will see the following message keep showing every few second:

xoprst00@copr-ubuntu:~$ ./.dropbox-dist/dropboxd
This client is not linked to any account...
Please visit to link this machine.

Now copy and  paste the link to any web browser,you can using any computer. so that it will start to link this machine to your dropbox account. You will be asking to provide your username and password in order to link this to your dropbox account.

If dropbox client on your server is successfully sync with ubuntu server you’ll see the message

Client successfully linked, Welcome!

and it will stop printing the authorization link, it also will automatically create a Dropbox folder under ~/Dropbox for the user you’re logged in as. Press CTRL + C to terminate the dropbox deamon process

How to Make Dropbox Start up Automatically on Boot

Create a new file in directory /etc/init.d/ give file name dropbox, it for the service management script

sudo touch /etc/init.d/dropbox
sudo nano /et/init.d/dropbox

Then Grab the following script into file /etc/init.d/dropbox. 

# 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
   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

If you edited the script in non-UNIX environment, make sure you set the line ending chars correctly. If you are getting such message

-bash: /etc/init.d/dropbox: /bin/sh^M: bad interpreter: No such file or directory

you can i.e. open the script in vi end execute the following steps:

  1. sudo vi /etc/init.d/dropbox
  2. :set fileformat=unix (the colon will execute a command and not edit the js file, do not worry)
  3. click enter
  4. now type :wq!
  5. click enter

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

How to Check Status Dropbox with Dropbox Python Script

Download the script and  make the file excuteable

wget -O ~/.dropbox/
chmod +x ~/.dropbox/

Now you can easily check the status of the Dropbox client with following command

~/.dropbox/ status

Get more help with following command

~/.dropbox/ help

You can also use the exclude command to keep specific files or folders from syncing to ubuntu server

~/.dropbox/ help exclude

One thought on “How to Install and Configure Dropbox on Ubuntu Server 12.04

  1. Hey, I don’t know if you read your comments but I’m writing an article on using headless linux in conjunction with wordgrindr and dropbox for a distraction free creative writing rig.

    I actually took benhedrington’s script and changed it so it’d work out of box(giving full credit where it’s due).

    I’ll source this page when I’m done, but if you want to update so your post will work out of the box as is that’s cool too.

Leave a Reply