Run Dropbox inside a Docker container. Fully working with local host folder mount or inter-container linking
(via --volumes-from
). This repository provides the otherguy/dropbox
image.
This starts the Dropbox container with default settings:
$ docker run --detach --restart=always --name=dropbox otherguy/dropbox
It is recommended that you run dropbox with a custom user/group id when mounting the Dropbox file folder to the local filesystem. This fixes file permission errrors that might occur when mounting from the host or another Docker container volume.
You need to set the DROPBOX_UID
and DROPBOX_GID
environment variables to the user id and group id of w
hoever owns these files on the host or in the other container. The example below uses id -u
and id -g
to retrieve the current user's user id and group id, respectively.
$ docker run --detach --name=dropbox --restart=always \
-e DROPBOX_UID=$(id -u) -e DROPBOX_GID=$(id -g) \
-v "/path/to/local/settings:/opt/dropbox/.dropbox" \
-v "/path/to/local/dropbox:/opt/dropbox/Dropbox" \
otherguy/dropbox:latest
Using --net="host"
allows Dropbox to utilize
local LAN sync.
$ docker run --detach --name=dropbox --restart=always \
--net="host" \
otherguy/dropbox
To link Dropbox to your account, check the logs of the Docker container to retrieve the Dropbox authentication URL:
$ docker logs --follow dropbox
Copy and paste the URL in a browser and login to your Dropbox account to associate the Docker container. You should see something like this:
This computer is now linked to Dropbox. Welcome [your name]"
To manage dropbox exclusions or get a sharing link, you need to execute the dropbox
command inside the
Docker dropbox container:
$ docker exec -it dropbox gosu dropbox dropbox [dropbox command]
For example, to get an overview of the commands possible, use help
:
$ docker exec -it dropbox gosu dropbox dropbox help
-
DROPBOX_UID
If set, runs Dropbox with a custom user id. This must matching the user id of the owner of the mounted files. Defaults to1000
. -
DROPBOX_GID
If set, runs Dropbox with a custom user id. This must matching the group id of the owner of the mounted files. Defaults to1000
. -
DROPBOX_SKIP_UPDATE
If set totrue
, skips updating the Dropbox app on container startup. Note: This is not very reliable because the dropbox daemon will try to update itself even if this is set totrue
.
-
/opt/dropbox/Dropbox
The actual Dropbox folder, containing all your synced files. -
/opt/dropbox/.dropbox
Account and other settings for Dropbox. If you don't mount this folder, your account needs to be linked every time you restart the container.
It appears that as of December 2019
, Dropbox (version 87.4.138
) is now finally enforcing its
file system requirements.
Because this causes problems with Docker volume mounts, this container now includes the
dropbox-filesystem-fix
patch.
Originally forked from janeczku/dropbox
. Thank you
@janeczku for your work!
Bug reports and pull requests are welcome on GitHub at otherguy/docker-dropbox
.