How to Install Dropbox on Ubuntu 18.04 (Terminal/GUI)

install dropbox ubuntu

Dropbox online storage provides us supporting for Linux or Ubuntu. Now, we will install Dropbox on Ubuntu 18.04 LTS server terminal and as well as from GUI.

Dropbox provides us online storage to store or backup our data automatically. We use Dropbox to backup our contents with some security and piece of mind. In the event our PCs crash, Our data will be saved and ready to be restored onto server.

Dropbox offers both free and paid services, each with varying options. The Free service provides us 2GB of free online storage whereas in Pro you can get as much as we want depending on our requirements.

Step 1) Installing Dropbox from Command Line

We will install the wget package using the apt command.

    $ sudo apt-get update
    $ sudo apt-get install wget

Dropbox cli version is available for both 32 and 64 bit editions, we will download Dropbox upon out version.

    32-bit

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

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

After executing this command, It will create a new hidden folder named .dropbox-dist in our $HOME directory.

Run the following command to start the Dropbox from .dropbox-dist folder.

$ ~/.dropbox-dist/dropboxd
    Output
    This computer isn't linked to any Dropbox account...
    Please visit https://www.dropbox.com/cli_link_nonce?nonce=35ff549233f01a5d4e699826b0ab6ffb to link this device.

Now open the browser and navigate to the above link to connect system with your dropbox account.

Enter Dropbox username, password and click Sign-in.

The server is connected to our dropbox account, we should see a message like below.

This computer is now linked to Dropbox. Welcome Smart

Folder named Dropbox will be created in our home directory. keep the data in this folder to access it from any devices.

$ ls Dropbox/
    Output
    'Get Started with Dropbox.pdf'
    python3_tutorial.pdf
    Screenshots
    'Simply Raspberry Pi.pdf'
    smart.zip

Congratulations! The Ubuntu server has been linked to our dropbox account. The dropbox will keep running until we stop it by pressing CTRL + C. We should start it manually every time
when we want to use dropbox.

Step 2) Installing Dropbox CLI

Frist thing we will install Python using command below.

sudo apt install python

Now, Download the dropbox python script and put it in our PATH, for example /usr/local/bin/.

$ sudo wget -O /usr/local/bin/dropbox "https://www.dropbox.com/download?dl=packages/dropbox.py"

Make it executable:

$ sudo chmod +x /usr/local/bin/dropbox

Now we can start using the dropbox cli. To display help, simply run:

$ dropbox
    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
      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
      lansync      enables or disables LAN sync
      sharelink    get a shared link for a file in your dropbox
      proxy        set proxy settings for Dropbox

To view the usage of a specific command, for example running, run:

$ dropbox help running
    output
    dropbox running

    Returns 1 if running 0 if not running.

To see if dropbox service is running or not. Type command below.

$ dropbox status
    Output
    Dropbox isn't running!

To start dropbox service. Type command below.

$ dropbox start

Let us again check if it is running using command.

$ dropbox status
    Output
    Up to date

It will keep running until we reboot the system.

To stop dropbox service. Type command below.

$ dropbox stop
    output
    Dropbox daemon stopped.

To get the current sync status of a file, Type command below.

$ dropbox filestatus Dropbox/smart.txt
    Output
    Dropbox/smart.txt: up to date

we can exclude a directory from syncing. For instance, We will exclude dir1 folder using command below.

$ dropbox exclude add dir1

We can add multiple directories with space separated values to exclude them from syncing like below.

$ dropbox exclude add dir1 dir2

To view the list of directories currently excluded from syncing, Type command below.

$ dropbox exclude list

To remove a directory from the exclusion list, Type command below.

$ dropbox exclude remove dir2

To get a shared link for a file, for example smart.txt, in our dropbox folder, Type command below.

$ dropbox sharelink Dropbox/smart.txt
    Output
    https://www.dropbox.com/s/rqteaol58c1zlkw/smart.txt?dl=0

We can now pass the above URL to anyone.

To enable lansync, Type command below.

$ dropbox lansync y

To disable lansync, Type command below.

$ dropbox lansync n

Step 3) Starting Dropbox Automatically Every Reboot

We can make Dropbox service to automatically start on every reboot. Create a systemd service unit for Dropbox.

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

Add the following lines:

[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

Replace User, Group and dropbox cli path /usr/local/bin/ with our own values. Save and quite the file.

Reload daemon using command below.

$ sudo systemctl daemon-reload

Enable dropbox service using command below.

$ sudo systemctl enable dropbox

Start dropbox service using command below.

$ sudo systemctl start dropbox

Now dropbox service will automatically start at every reboot.

Check running of the service using command below.

$ sudo systemctl status dropbox

Install Dropbox On Ubuntu Desktop GUI

First download the Ubuntu deb package. Select 64-bit or 32-bit according to our OS architecture.
Dropbox-Ubuntu-deb-package
Once downloaded, open file manager, navigate to the Download folder. Then right-click the Dropbox deb package, select Open With Software Install.
install-dropbox-on-Ubuntu-18.04
Ubuntu Software will be opened.
Ubuntu-Software-install-dropbox
Click the Install button to install Dropbox CLI and Nautilus extension. You need to enter your password in order to install software. Once this step is finished, a window will appear. Click Start Dropbox.

start-dropbox-daemon-on-Ubuntu
Then click OK button to download and install the proprietary Dropbox daemon.

Dropbox-daemon-Installation

Dropbox-Installation-Ubuntu-16.04
Once the installation is complete, you can login with your Dropbox account and start using Dropbox to back up or sync your files.
Ubuntu-dropbox-login
We can see that Dropbox will not be able to verify binary signatures if python-gpgme is not installed. We can install python-gpgme by executing command below.

$ sudo apt install python-gpgme

Dropbox Linux client supports HTTP, SOCKS4 and SOCKS5 proxy. We can configure proxy in Dropbox Preferences > Proxies. This is useful if our country or area is banned from accessing Dropbox.

Dropbox-proxy-settings

Read Also:

Ahmed Abdalhamid 3:43 am

About Ahmed Abdalhamid

Ahmed is communication engineer since 2001, he had a lot of skills. He has worked Linux system administrator, Python developer for 7 years and now he is Data scientist since 2015. He thinks Linux and Python are the greatest inventions of mankind.

Author's All Posts
Like to become part of Linoxide Team and contribute tips? Contact us here.

Comments

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.