Last updated 21 May 2018
On 24 July 2018, Heroku will remove support for Dropbox Sync as a deployment method. After this date, your app must use Heroku’s Git-based deployment or another supported deployment integration.
See Dropbox Sync Sunset Notice for details.
Dropbox Sync is a Heroku feature that lets you deploy the contents of Dropbox folders to Heroku apps after linking your Dropbox and Heroku accounts.
Setting up Dropbox Sync
The Dropbox setup and deploy UX is available from the “Deploy” tab of apps in Dashboard.
If you haven’t already, Dropbox will prompt for you to authorize access to the
Dropbox/Apps/Heroku folder in your Dropbox account.
Once you’ve authorized access, a folder will be created in
Dropbox/Apps/Heroku/app-name. If your app already has code in it’s Heroku repo (deployed with git-push or with Heroku Button), Heroku will place that code into the Dropbox folder.
If linking does not cause a Dropbox folder to be created on your machine, you should check that Selective Sync is disabled for the relevant folder.
You can now add or edit files in your app’s Dropbox folder.
Whenever you’re ready to deploy changes, type in a short description of what changed and click the “Deploy” button in Dashboard. The message you enter for the deploy is the “commit message” and it’s a great way summarize for collaborators (and your future self) know what code-changes were made.
You have to click the “Deploy” button in Heroku dashboard when you want to deploy changes, changes are not automatically synced.
Dashboard shows the progress of a release after you kick it off. You can track the progress of all releases in the app’s “Activity” tab.
You cannot deploy from any folder in your Dropbox, only the folders that Heroku create in
Dropbox/Apps/Heroku will work. If you have existing code, link your app, wait for Heroku to create the folder in your Dropbox and move or copy your code into that folder.
Dropbox Sync is integrated with the Heroku Collaboration model. Changes deployed from Dropbox are committed to the app’s git repo. Heroku will also sync Git pushes to linked Dropbox folders.
Collaborators on an app can each link their Dropbox accounts with the app. Collaborators using Dropbox will each get their own app folder in their Dropbox accounts. Changes are automatically synced to all linked Dropbox folders and collaborators using Git can pull changes deployed using Dropbox.
You cannot use the Dropbox collaboration model with app-folders linked to Heroku apps. Dropbox App folders cannot be shared.
If a collaborator force-pushes to the Heroku Git repo (using
git push heroku master -f), Heroku will unlink any associated Dropbox folders for collaborators on the app (and potentially also for the user that force pushed, if that user uses Dropbox Sync). Heroku does this because there’s no general way to generate a reasonable diff to send to Dropbox for forced Git pushes.
You can unlink an app from Dropbox in the app’s “Deploy” tab. When unlinking and app, the app’s folder will still be available in your Dropbox account, but it will no longer be updated with app changes from Heroku. It’s safe to delete the app folder from Dropbox if you no longer need it.
You can also unlink your Heroku and Dropbox accounts in their entirety in the Heroku account applications tab.
.gitignore and ignored files
When committing changes deployed from Dropbox to the Heroku app’s Git repo, Heroku Dropbox Sync will respect any
.gitignore files found in the Dropbox folder. Any files or directories in the Dropbox folder that are matched by patterns in the .gitignore file will not be committed to the apps Heroku repo.
Also note that the Dropbox client and service will ignore certain files such as
.ds_store. See the Dropbox documentation for details.
When you rename a Heroku app that is synced with any user’s Dropbox, Heroku will update the name of any synced Dropbox folders to match the new name of the app.
Renaming a Dropbox folder that’s associated with a Heroku app will cause Heroku to unlink that app from the Dropbox account of the user that renamed the folder.
Conflicted files in Dropbox folder
If you try to deploy from Dropbox and the Dropbox folder has files created as the result of conflicts (i.e. “conflicted copy”), you will get an error. Resolve the conflicts in your Dropbox folder, then delete the conflicted copies and try deploying again.