With the advancement of cloud computing, Dropbox has become a cornerstone of mobile computing. The ability to manipulate files on one device, have them stored “in the cloud”, and then reflect these changes on all of one’s devices has provided a great deal of flexibility for consumers. I wanted to extend this functionality to a shared web hosting environment (in my case, BlueHost).
First, you’ll need SSH access to your box. For security reasons, all Dropbox files will be kept outside of the public_html folder.
1.) Login via SSH to your box.
wget -O dropbox.tar.gz "https://www.dropbox.com/download/?plat=lnx.x86"
We created a directory, navigated to it, and downloaded the latest 64-bit compliant Linux source for Dropbox.
tar -xvzf dropbox.tar.gz
Now we unzipped the tarball, removed the original compressed file, and executed the main Dropbox script.
8.) You’ll get a message like:
This client is not linked to any account… Please visit https://www.dropbox.com/cli_link?host_id=xxxxxxxxxx to link this machine.
9.) Copy and paste that link into a browser and navigate there. This essentially “links” your shared host to your Dropbox repository.
10.) BlueHost periodically terminates the Dropbox process, so I added a cronjob (under CPanel) to keep the process running every 5 minutes. The cron command will simply be the path to your dropboxd script. For example:
You’ll notice that under your root directory (/home/username) you now have a “Dropbox” folder with all the contents of your repository. Now you can throw things into the cloud whenever you want. For example, I have a simple PHP script which backs ups and optimizes my WordPress SQL databases every day, eliminating the need for a resource-hogging plugin and giving me the piece of mind that my database is stored in more than one place.
Let me know if this guide helps and/or if you have any questions! 🙂