How to install and configure dropbox as a service on centos 7

In this article, we will learn how to configure and install the Dropbox client and run as a service on CentOS7 server. This makes the server to connect with Dropbox and keep a copy of files synchronized. To complete the setup we needed a non-root user with Sudo permissions or a root user.

Installing the Dropbox Client

We can download the latest Linux Dropbox client from the below link.

# cd ~
# curl -Lo dropbox-linux-x86_64.tar.gz

After downloading, we need to create a folder for client software and extract the compressed file which we downloaded.

# mkdir -p /opt/dropbox-client
# tar xzfv dropbox-linux-x86_64.tar.gz --strip 1 -C /opt/dropbox-client

As the client is downloaded and extracted we needed to link the dropbox client account with the server.

Linking Dropbox Client

We needed to run the below command on the server in the folder where we want to store the Dropbox files.

# cd /usr/share/dropbox
# /opt/dropbox-client/dropboxd
# /opt/dropbox-client/dropboxd
This computer isn't linked to any Dropbox account...
Please visit to link this device.

We needed to copy red colored link code and paste it on any browser.

Enter the credentials of your Dropbox account and save when we click on continue.

This computer is now linked to Dropbox. Welcome Chandra

As we can see that our Dropbox account is linked with the server, we can press Ctrl+C to quit the Dropbox command line box which we run to sync the account

Setting UP Service Script

We need to copy the below script and create these two files under /etc/init.d folder and /etc/systemd/system/dropbox.service for Centos 7

Below is the Code for Dropbox.service

# /etc/systemd/system/dropbox.service
Description=Dropbox is a filesyncing sevice provided by This service starts up the dropbox daemon.
ExecStart=/etc/init.d/dropbox start
ExecReload=et/cini/t.ddropbo/x restart
ExecStop=et/cini/t.ddropbo/x stop

Below is the Code for Dropbox Service

# /etc/init.d/dropbox
# To configure, add line with DROPBOX_USERS="user1 user2" to /etc/sysconfig/dropbox
# Probably should use a dropbox group in /etc/groups instead.
# Source function library.
. /etc/rc.d/init.d/functions
start() {
   echo -n $"Starting $prog"
   if [ -z $DROPBOX_USERS ] ; then
   echo -n ": unconfigured: $config"
   rm -f ${lockfile} ${pidfile}
   return $RETVAL
   fifor dbuser in $DROPBOX_USERS; do
   dbuser_home=`cat /etc/passwd | grep "^$dbuser:" | cut -d":" -f6`
   daemon --user $dbuser /bin/sh -c "/opt/dropbox/dropboxd&"
   [ $RETVAL = 0 ] && touch ${lockfile}
   return $RETVAL
status() {
   for dbuser in $DROPBOX_USERS; do
   dbpid=`pgrep -u $dbuser dropboxd | grep -v grep`
   if [ -z $dbpid ] ; then
   echo "dropboxd for USER $dbuser: not running."
   echo "dropboxd for USER $dbuser: running (pid $dbpid)"
stop() {
   echo -n $"Stopping $prog"
   for dbuser in $DROPBOX_USERS; do
   dbuser_home=`cat /etc/passwd | grep "^$dbuser:" | cut -d":" -f6`
   killproc /opt/dropbox/dropboxd
   [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
# See how we were called.
case "$1" in
echo $"Usage: $prog {start|status|stop|restart}"

Providing Execution Permission to Scripts

After that we needed to give execute permission to the script

# sudo chmod +x /etc/systemd/system/dropbox.service /etc/init.d/dropbox

We need to provide the script with the system users that will run the Dropbox.

# vi /etc/systemd/dropbox

Create the file with below lines


We needed to start and enable them to start at boot time with the below commands

# systemctl daemon-reload
# systemctl start dropbox
# systemctl enable dropbox

Unlinking the Dropbox Account

To unlink the Dropbox Account we needed to stop the services

# service dropbox stop

The edit /etc/defaults/dropbox and remove the users from the list

# vi /etc/defaults/dropbox

Then delete the user’s Dropbox directory

# rm -rf /chandra/Dropbox

After this setup and configuration we are able to link the data which is stored on Dropbox and we can now link or unlink the Dropbox account to the server so that data can be backedup or synchronized to the Dropbox accounts.

Updated on: 18-Oct-2019


Kickstart Your Career

Get certified by completing the course

Get Started