How to Install and Configure Dropbox on Ubuntu Server 12.04

In How To

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 Dorpbox on Ubuntu Server

Step 1. Download dropbox via Offically dropbox site:

Dropbox for 32-bit Architecture:

wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86"

Dropbox for 64-bit Architecture:

wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86_64"

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:

~/.dropbox-dist/dropboxd

Snyc 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:

message dropbox ubuntu server

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

#!/bin/sh
# dropbox service
# Replace with linux users you want to run Dropbox clients for
DROPBOX_USERS="user1 user2"

DAEMON=.dropbox-dist/dropbox
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
 fi
 done
}

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
 fi
 done
}

status() {
 for dbuser in $DROPBOX_USERS; do
 dbpid=`pgrep -u $dbuser dropbox`
 if [ -z $dbpid ] ; then
 echo "dropboxd for USER $dbuser: not running."
 else
 echo "dropboxd for USER $dbuser: running (pid $dbpid)"
 fi
 done
}

case "$1" in
 start)
 start
 ;;
 stop)
 stop
 ;;
 restart|reload|force-reload)
 stop
 start
 ;;
 status)
 status
 ;;
 *)
 echo "Usage: /etc/init.d/dropbox {start|stop|reload|force-reload|restart|status}"
 exit 1
 esac

exit 0

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 dropbox.py script and  make the file excuteable

wget -O ~/.dropbox/dropbox.py "http://www.dropbox.com/download?dl=packages/dropbox.py"
chmod +x ~/.dropbox/dropbox.py

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

~/.dropbox/dropbox.py status

Get more help dropbox.py with following command

~/.dropbox/dropbox.py help

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

~/.dropbox/dropbox.py help exclude

Link References

Tags: #Dropbox #Sync #Ubuntu Server 12.04

How to Upgrade Ubuntu Server 12.04 to Ubuntu Server 14.04 LTS
How to Upgrade Ubuntu Server 12.04 to Ubuntu Server 14.04 LTS
This tutorial will describes how to upgrade
How to Setup OwnCloud Server 5 with SSL Connection
How to Setup OwnCloud Server 5 with SSL Connection
Today ownCloud is the best cloud storage
  1. author

    Stefan Breiner3 years ago

    Thank you. It worked great.

    Reply
  2. author

    Jan Krojcer3 years ago

    Didn’t work by default. Minor mistake here: “sudo nano /et/init.d/dropbox”, forgot to add a c for the etc directory.

    Also, I had to change the DAEMON path in /etc/init.d/dropbox to “/home/(user)/.dropbox-dist/dropbox” because trying to run sudo service dropbox status returned in “/etc/init.d/dropbox: Unknown file or directory”.

    Other than that, excellent guide.

    Reply
  3. author

    DaveD3 years ago

    Thanks, it works. Contains another error though. Both sentences above the hyperlinks say ‘Dropbox for 32-bit Architecture’

    Reply
  4. author

    Christoph Fischer3 years ago

    Great guide, thank you very much!

    Reply
  5. author

    Jason Lyle3 years ago

    Greate post… i just made a small tweak to the begining of your init script so that you don’t have to specify the users… it will just look for all users that have dropbox installed and run it for them:

    #!/bin/sh# dropbox serviceDROPBOX_USERS=””DAEMON=.dropbox-dist/dropbox
    ALL_USERS=`awk -F”:” ‘{print $1}’ /etc/passwd`for USER in $ALL_USERS; do USER_DAEMON=`getent passwd $USER | cut -d: -f6`/$DAEMON if [ -x $USER_DAEMON ]; then DROPBOX_USERS=”$DROPBOX_USERS $USER” fidoneDROPBOX_USERS=$(echo $DROPBOX_USERS | awk ‘{print substr($0, 1)}’) 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 fi done} 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 fi done} status() { for dbuser in $DROPBOX_USERS; do dbpid=`pgrep -u $dbuser dropbox` if [ -z $dbpid ] ; then echo “dropboxd for USER $dbuser: not running.” else echo “dropboxd for USER $dbuser: running (pid $dbpid)” fi done} case “$1″ in start) start ;; stop) stop ;; restart|reload|force-reload) stop start ;; status) status ;; *) echo “Usage: /etc/init.d/dropbox {start|stop|reload|force-reload|restart|status}” exit 1 esac exit 0

    Reply
  6. author

    Janusz @ Nixilla3 years ago

    It works on 10.04 too :-)

    Reply
  7. author

    Max2 years ago

    Does anyone know a way to automatically start Dropbox without access to “/etc/init.d/”?

    I have Dropbox working on a shared server, but dont have admin access. Every couple days Dropbox seems to turn off and I have to run “dropbox.py start” to get it going again.

    Reply
  8. author

    user2 years ago

    /home/user/.dropbox-dist/dropbox: Syntax error: word unexpected (expecting “)”)

    what i am doing wrong?

    Reply
  9. author

    Max Winterstein2 years ago

    there is a small typ0, you wrote 32 bit architecture 2 times 😉

    Reply
  10. author

    Aaron1 year ago

    Installing Dorpbox on Ubuntu Server? DORPbox? 😛

    I’ve used this approach to setting up DB a few times. Kudos!

    Reply
  11. author

    Mehul Bhandari1 year ago

    where to give username & password and where the data show means folder ?

    Reply
  12. author

    Jim Ostrowski9 months ago

    I tried to use the status function, but it seemed to always return true, even if dropbox wasn’t running. It seems the pgrep finds the call to “/etc/init.d/dropbox status” as a process with “dropbox” in the name, and so returns that PID as if dropbox were actually running.

    Anyone else run into this?

    Reply

Leave a reply "How to Install and Configure Dropbox on Ubuntu Server 12.04"

Must read×

Top