Install Dropbox on Debian 9 Server and Desktop

Dropbox is the online storage service provides online storage to backup and store data automatically with security. It has both free and paid plan. In the free plan, Dropbox provides 2GB storage and if you want more storage then you can buy paid plans. In this tutorial, you are going to learn how to install Dropbox on Debian 9.

Prerequisites

Before you start to install Dropbox on Debian 9. You must have the non-root user account on your Server/Desktop with sudo privileges.

1. Install Dropbox With GUI

Now, Update package manager index by typing following.

sudo apt update

Install Dropbox by running following command

sudo apt install nautilus-dropbox

After installing Dropbox, launch Dropbox from Activities.

install dropbox on ubuntu activities launch
Install Dropbox on Ubuntu – Activities Launch

It will start automatically downloading main Dropbox binaries. After downloading completes. It will prompt you to enter credentials and login or register with Dropbox. After Successful Sign in you are ready to use Dropbox.

"<yoastmark

Now start using Dropbox by visiting the Dropbox menu on your system.

2.Install Dropbox from Terminal

Enter following command to dowload Dropbox on system. It will create .dropbox-dist in HOME directory.

For 32 bit:

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf -

For 64 bit:

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64 | tar xzf -"

Start Dropbox daemon by typing following

~/.dropbox-dist/dropboxd

Output should be:

This computer isn't linked to any Dropbox account...
Please visit https://www.dropbox.com/cli_link_nonce?nonce=dhjsjchy89ksf5372828c03709 to link this device.

Now open above link in your favorite browser. Note you can also open above link on any other system.

Enter username and password and Sign In to the account. Once the server connects to Dropbox account you can see following output

This computer is now linked to Dropbox. Welcome Smart

Now folder named Dropbox will be created in HOME directory. List files inside folder typing

ls Dropbox

It’s time to install Dropbox CLI (Dropbox Command Line Interface). Dropbox CLI requires Python should be installed. Enter following commands to install Python and Dropbox CLI.

sudo apt install python
sudo wget -O /usr/local/bin/dropbox "https://www.dropbox.com/download?dl=packages/dropbox.py"
sudo chmod +x /usr/local/bin/dropbox

3. Manage Operations with Dropbox CLI

To Manage Dropbox operations on the server side you should use Dropbox CLI (Command Line Interface).

List all commands available with Dropbox CLI by typing:

dropbox

Output should be,

Output:
Dropbox command-line interface
commands:

Note: use dropbox help <command> to view usage for a specific command.

 status       get current status of the dropboxd
 throttle     set bandwidth limits for Dropbox
 help         provide help
 puburl       get public url of a file in your dropbox's public folder
 stop         stop dropboxd
 update       download latest version of dropbox
 running      return whether dropbox is running
 start        start dropboxd
 filestatus   get current sync status of one or more files
 proxy        set proxy settings for Dropbox
 autostart    automatically start dropbox at login
 exclude      ignores/excludes a directory from syncing
 lansync      enables or disables LAN sync
 sharelink    get a shared link for a file in your dropbox
 ls           list directory contents with current sync status

If you want more information about a specific command enter following command

dropbox help sharelink

Above command will provide you more information about sharelink command.

dropbox running

Returns 1 if running 0 if not running.

Check status of dropbox by typing

dropbox status

If Dropbox is not active then start service by running following command

dropbox start

To stop dropbox service enter following command

dropbox stop

Get sync status of Dropbox file by typing

dropbox filestatus Dropbox/test.txt

Generate shareable link for a file by typing

dropbox sharelink Dropbox/test.txt

You can exclude the directory from syncing by using the following command

dropbox exclude add Dropbox/dir1

To list excluded directories type following command

dropbox exclude list

Remove directory from excluded list typing

dropbox exclude remove Dropbox/dir1

4. Start Dropbox After Reboot

To start Dropbox after every reboot you should create systemd service inside your Ubuntu. Create a service by running the following command

sudo nano /etc/systemd/system/dropbox.service

Copy following code inside that file by typing. You should replace User, Group and Dropbox CLI path /usr/local/bin/ with your own paths.

[Unit]
Description=Dropbox Service
After=network.target

[Service]
ExecStart=/bin/sh -c '/usr/local/bin/dropbox start'
ExecStop=/bin/sh -c '/usr/local/bin/dropbox stop'
PIDFile=${HOME}/.dropbox/dropbox.pid
User=smart
Group=smart
Type=forking
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target

Reload Systemctl daemon typing

sudo systemctl daemon-reload

Now enable Dropbox service by typing following command

sudo systemctl enable dropbox service

Start Dropbox service using

sudo systemctl start dropbox service

Get status of the Dropbox service by

sudo systemctl status dropbox service

Conclusion

You have successfully learned how to install Dropbox on Debian 9. If you have any queries don’t forget to comment below.