How to install Dropbox on CentOS 8 server

How to install Dropbox on CentOS 8 server

Install Dropbox on CentOS 8

Dropbox is an online storage service that supports Linux distributions. Dropbox provides online storage and automatically backs up and stores your data. There are both free and paid plans. The free plan provides 2GB of storage if you need more storage than you can buy a paid plan. In this tutorial, you will learn how to install Dropbox on CentOS 8 server.

Prerequisites

Before installing Dropbox on CentOS. Requires a non-root user account on the server with sudo privileges.

Install Dropbox client

Here, first install Dropbox Client. Download the Dropbox Client using the following command:

                      curl -Lo dropbox-linux-x86_64.tar.gz https://www.dropbox.com/download?plat=lnx.x86_64
                    

Create a directory for the Dropbox installation using the following command:

                      sudo mkdir -p /opt/dropbox
                    

Next, extract the downloaded file inside /opt/dropbox directory.

                      sudo tar xzfv dropbox-linux-x86_64.tar.gz --strip 1 -C /opt/dropbox
                    

Dropbox setup account

In this section, you link your Dropbox account to a Dropbox client on the server and execute the following command:

                      /opt/dropbox/dropboxd
                    

You get the following output: Copy the specified link in the output and execute it in your favorite browser on your local machine.

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

If you have an existing Dropbox account, sign in or create a new account with Dropbox.

Install Dropbox on CentOS-Register with Dropbox Install Dropbox on CentOS-Register with Dropbox

After completing the above process, you will see the following output on your CentOS system:

                      Link success output:
This computer is now linked to Dropbox. Welcome Sammy
                    

You have successfully linked your Dropbox account to your Dropbox client. New Dropbox A directory is created in the HOME directory to store the synced Dropbox files. Enter now Ctrl+c Set up Dropbox as a service.

Set up Dropbox as a service

To set up Dropbox as a service, you need to create an init script and a Systemd unit file and enter the following command:

                      sudo curl -o /etc/init.d/dropbox https://gist.githubusercontent.com/thisismitch/6293d3f7f5fa37ca6eab/raw/2b326bf77368cbe5d01af21c623cd4dd75528c3d/dropbox
                    
                      sudo curl -o /etc/systemd/system/dropbox.service https://gist.githubusercontent.com/thisismitch/6293d3f7f5fa37ca6eab/raw/99947e2ef986492fecbe1b7bfbaa303fefc42a62/dropbox.service
                    

Run the following script to make the above file executable:

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

/etc/sysconfig/dropbox The file must contain the name of the system user running Dropbox. To edit this file, run the following command:

                      sudo nano /etc/sysconfig/dropbox
                    

Set the user name as in the following example, save the file and exit.

                      DROPBOX_USERS="john"
                    

Reload the Systemd daemon.

                      sudo systemctl daemon-reload
                    

Next, run the following command to start and enable the Dropbox service.

                      sudo systemctl start dropbox && sudo systemctl enable dropbox
                    

Install Dropbox CLI

Enter the following command to download the Dropbox CLI script:

                      cd ~ && curl -LO https://www.dropbox.com/download?dl=packages/dropbox.py
                    

Run the following command to make the file executable:

                      chmod +x ~/dropbox.py
                    

The Dropbox CLI assumes that ~ / .dropbox-dist contains the Dropbox installation file, so execute the following command:

                      ln -s /opt/dropbox ~/.dropbox-dist
                    

Now you can run the Dropbox client with the following command: Learn how to use the Dropbox CLI.

                      ~/dropbox.py
                    

You can check the status of Dropbox by entering the following command:

                      ~/dropbox.py status
                    

You should get the following output

                      Output:
Up to date

                    

Use the following command to turn off automatic LAN synchronization:

                      ~/dropbox.py lansync n
                    

If you need more information about a specific command, enter the following command

                      ~/dropbox.py help sharelink
                    

The above commands provide more information about the sharelink command.

                      dropbox running

Returns 1 if running 0 if not running.
                    

Check Dropbox status by typing

                      ~/dropbox.py status
                    

If Dropbox is not active, run the following command to start the service

                      ~/dropbox.py start
                    

To stop the Dropbox service, enter the following command

                      ~/dropbox.py stop
                    

Enter to get sync status of Dropbox files

                      ~/dropbox.py filestatus Dropbox/test.txt
                    

Enter to generate a shareable link for the file

                      ~/dropbox.py sharelink Dropbox/test.txt
                    

You can exclude directories from synchronization with the following command:

                      ~/dropbox.py exclude add Dropbox/dir1
                    

Enter the following command to list the excluded directories

                      ~/dropbox.py exclude list
                    

Remove directory from exclusion list entry

                      ~/dropbox.py exclude remove Dropbox/dir1
                    

Link additional Dropbox accounts

To link additional Dropbox accounts, execute the following command, then copy the specified URL to the output.

                      /opt/dropbox/dropboxd
                    

Next, go to the URL specified in the output to complete the authentication process. Next, add a user inside /etc/default/dropbox File.

                      sudo nano /etc/default/dropbox
                    

Unlink Dropbox account

First, stop the Dropbox service.

                      sudo service dropbox stop
                    

Remove user from /etc/default/dropbox File.

                      sudo nano /etc/default/dropbox
                    

Next, replace the USERNAME with your system’s real username and delete the Dropbox user directory using the following command:

                      sudo rm -r ~/USERNAME/Dropbox
                    

Next, start the Dropbox service.

Conclusion

You learned how to install Dropbox on CentOS 8. If you have any questions, don’t forget the comments below.

Related Posts