Using Dropbox Docker Container

This page contains guides on using Dropbox within a Docker container on Ubuntu 14/16.04 (Not tested on other versions). It will use Docker and docker-compose so ensure these are installed first Script to Install Docker Ubuntu 14.04.

Installing a Dropbox Docker Container

This can be downloaded from: https://github.com/radio-astro/docker-dropbox/blob/master/docker-compose.yml but I have included one below using custom options that we typically use when setting this up.

docker-compose.yml
version: '2'
services:
dropbox:
image: janeczku/dropbox
environment:
DBOX_UID: 33
DBOX_GID: 33
volumes:
- /local/directory/:/dbox/Dropbox
restart: always
container_name: dropbox
network_mode: 'bridge'

Update the volume line to the local directory you would like Dropbox data to be stored in
Create the docker container using Docker compose (From the same directory as the file you have just created above)

docker-compose up -d
docker logs -f dropbox

When the container has started you will be presented with a URL from the logs like the below:
This computer isn’t linked to any Dropbox account…
Please visit https://www.dropbox.com/cli_link_nonce?nonce=123123123123123123123 to link this device.
Log into your Dropbox account in a web browser before pasting in the link. The container logs will then update that the account has been linked successfully

Checking the container logs

This will typically not show Dropbox syncing information but is useful in the event of Dropbox not starting / running correctly on the server – Eg will show issues with the container starting / not linked to any Dropbox account etc

docker logs -f dropbox

Using the Dropbox Container

Checking container status

docker exec -it dropbox dropbox status

Limiting the bandwidth for the container

The below command will limit Dropbox within the container to 4Mb/s upload and download speeds.

docker exec -it dropbox dropbox throttle 4000 4000

Other..

A full list of Dropbox commands can be found by running the below on the container:

docker exec -it dropbox dropbox help

Any comments or questions? Get in touch here or Email me at [email protected]