Dropbox with a Custom Sync Directory
How to install Dropbox on an Ubuntu-based distro and configure it to sync to a non-default directory — including the nautilus-dropbox CLI workaround.
Overview
Dropbox on Linux has no full GUI installer — you install a package (or a headless daemon) from the terminal, and by default it syncs to ~/Dropbox. This guide covers installing Dropbox with file-manager integration on an Ubuntu-based distro, then relocating the sync folder to a partition of your choice using the move-and-symlink method, plus the CLI control script and a systemd service for the headless setup.
Filesystem note: Dropbox requires the sync folder to live on an ext4 partition. The partition setup used throughout this site is ext4, so this is only a concern if your target partition is NTFS or FAT32.
Prerequisites
- Any Ubuntu 24.04-based distro
- Internet connection
- A working web browser (Firefox, Chrome, or Edge)
- The target directory should be on a partition that is mounted whenever Dropbox starts. The tested setup used an internal partition; removable external drives are a riskier choice for always-on sync.
- Verify partition ownership: If your target directory is on a separate partition, check that your user owns it. A root-owned partition (common with fresh internal drives) will silently prevent Dropbox from syncing. Run
lsblk -fto list partitions, thensudo chown -R $USER:$USER /media/yourusername/partitionnameif needed. - Critical: Add the partition to
/etc/fstabfor auto-mount at boot. Without this, the partition stays unmounted after every restart — Dropbox shows “Can’t sync” or “Folder missing” because the symlink target doesn’t exist until you manually click the drive in Nemo. See Rename Drive Labels - Make Partitions Auto-Mount.
The Problem (Windows User Perspective)
On Windows, you download Dropbox, install it, and choose where to put your Dropbox folder during setup. On Linux, there’s no official GUI installer — Dropbox provides a “headless” daemon that you install from the terminal. By default, it creates a Dropbox folder in your home directory (~/Dropbox). If you want your files somewhere else (like a separate partition), you need to set that up before the first run.
Solution
Option A: GUI Method with File Manager Integration (Recommended)
This is the simplest approach — one command gives you Dropbox with full file manager integration. Choose the package that matches your desktop environment:
For GNOME/Nautilus (Ubuntu, Zorin OS):
sudo apt update
sudo apt install nautilus-dropbox -y
For Cinnamon/Nemo (Linux Mint):
sudo apt update
sudo apt install nemo-dropbox -y
This installs:
- The Dropbox daemon
- File manager integration (sync status icons on files)
- System tray icon
- Right-click Dropbox menu in Files
Relaunch the file manager:
# Nautilus (GNOME/Zorin)
nautilus -q
# Nemo (Cinnamon/Mint)
nemo -q
Dropbox will appear in your system tray. Sign in and it will sync to ~/Dropbox by default.
To use a custom directory with this method, use the symlink approach after initial sync:
Before moving the folder: If your target location is on a separate partition, verify your user owns it first:
sudo chown -R $USER:$USER /media/mohsin/bigd
# Stop Dropbox first
dropbox stop
# Move the folder to your desired location
mv ~/Dropbox /media/mohsin/bigd/Dropbox
# Create a symlink so Dropbox thinks the folder is still in ~/
ln -s /media/mohsin/bigd/Dropbox ~/Dropbox
# Restart
dropbox start
Enable autostart so Dropbox starts when you log in:
dropbox autostart y
Option B: Headless Install with Custom Path (Advanced)
This method installs the bare Dropbox daemon without any file-manager integration, then links your account from the terminal. The daemon always creates ~/Dropbox in your home directory on first run — there is no supported flag or environment variable to change that — so the relocation to a custom path uses the same move-and-symlink method as Option A.
Step 1 — Download and extract the Dropbox daemon
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
This creates a .dropbox-dist folder in your home directory containing the daemon.
Step 2 — Start the daemon and link your account
~/.dropbox-dist/dropboxd
The daemon needs to be linked to your Dropbox account. It prints a URL like:
To link this computer to a Dropbox account, visit the following url:
https://www.dropbox.com/cli_link_nonce?nonce=xxxxxxxx
Copy the URL and paste it in your browser. Log into your Dropbox account. The daemon will start syncing automatically — to ~/Dropbox, which it creates if it does not exist.
If the URL doesn’t appear in the terminal output, open a new terminal and run:
# Download the CLI control script first
wget -O ~/dropbox.py "https://www.dropbox.com/download?dl=packages/dropbox.py"
chmod +x ~/dropbox.py
# Get the linking URL
~/dropbox.py status
Note: The linking URL (nonce) expires quickly. Don’t run
statusagain before visiting the URL — each call generates a new nonce that invalidates the previous one.
Step 3 — Relocate the sync folder
Once your account is linked and the initial sync has started, stop the daemon and use the move-and-symlink method from Option A:
dropbox stop
mv ~/Dropbox /media/mohsin/bigd/Dropbox
ln -s /media/mohsin/bigd/Dropbox ~/Dropbox
dropbox start
Dropbox follows the symlink, so your files live on the target partition while the daemon still believes everything is in ~/Dropbox.
Step 4 — Verify sync is working
~/dropbox.py status
# Should show "Syncing..." or "Up to date"
ls /media/mohsin/bigd/Dropbox
# Your Dropbox files should appear here
Step 5 — Set up the CLI shortcut
sudo ln -s ~/dropbox.py /usr/local/bin/dropbox
Now you can control Dropbox from anywhere:
dropbox start # Start the daemon
dropbox stop # Stop the daemon
dropbox status # Check sync status
Step 6 — Auto-start on boot (Optional)
Create a systemd service:
sudo nano /etc/systemd/system/dropbox.service
Paste:
[Unit]
Description=Dropbox Daemon
After=network.target
[Service]
User=mohsin
ExecStart=/home/mohsin/.dropbox-dist/dropboxd
Restart=on-failure
[Install]
WantedBy=multi-user.target
Replace every occurrence of mohsin with your own username (check with whoami). This affects both the User= line and the path inside ExecStart=. No special path configuration is needed — the symlink from Step 3 takes care of the location.
Enable it:
sudo systemctl daemon-reload
sudo systemctl enable dropbox
sudo systemctl start dropbox
What Didn’t Work (and Why)
| Approach Tried | Why It Failed |
|---|---|
| Moving an existing large Dropbox folder to a new location | Takes extremely long for large folders — set the path before first sync instead |
| Clicking the terminal URL to open browser | Some terminal emulators don’t support click-to-open URLs by default — copy/paste the URL into your browser manually |
Running dropbox status before downloading dropbox.py | The dropbox command isn’t available until you install nautilus-dropbox or download dropbox.py |
Running ~/dropbox.py status multiple times to get the linking URL | Each call generates a new nonce that invalidates the previous one — visit the URL immediately |
| Trying to use a removable external USB drive for Dropbox sync | In this workflow the drive may not be mounted when Dropbox starts, so an always-available location is the safer default |
Having a residual Dropbox folder on a different partition from the symlink target | Dropbox may detect it first and use the wrong location — run sudo rm -rf Dropbox on any partition that should NOT host your Dropbox folder, then verify with dropbox status |
Setting Dropbox to sync on a root-owned partition without chown first | Dropbox runs as your user and cannot write files to a root-owned directory — the folder appears empty after linking. Run sudo chown -R $USER:$USER /media/yourusername/partitionname before starting Dropbox |
Verification
# Check Dropbox is running
dropbox status
# Expected: "Up to date" or "Syncing..."
# Check files are in the right location
ls /media/mohsin/bigd/Dropbox
# Check Dropbox config (if using headless install)
cat ~/.dropbox/info.json
# Should show your chosen path
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
Command 'dropbox' not found | CLI script not installed | Run sudo apt install nautilus-dropbox or download dropbox.py |
| Daemon starts but no linking URL appears | URL may have opened in browser automatically | Check your browser for an open Dropbox tab |
info.json: No such file or directory | Account not linked yet | Re-run daemon and visit the linking URL |
| Flatpak repo error in terminal output | Unrelated to Dropbox — a separate Flatpak issue | Ignore it, doesn’t affect Dropbox |
/media/mohsin/bigd/Dropbox folder is empty after linking | Sync hasn’t started or the symlink points to the wrong place | Check ~/dropbox.py status and verify the symlink with ls -la ~/Dropbox |
Complete Removal
# Stop Dropbox
dropbox stop
# Remove the daemon
rm -rf ~/.dropbox-dist
# Remove Dropbox config
rm -rf ~/.dropbox
# Remove Nautilus integration (if installed)
sudo apt remove nautilus-dropbox
# Remove the sync folder (CAUTION: deletes all local Dropbox files)
# rm -rf /media/mohsin/bigd/Dropbox
# Remove CLI shortcut
sudo rm /usr/local/bin/dropbox
rm ~/dropbox.py
# Remove systemd service (if created)
sudo systemctl stop dropbox
sudo systemctl disable dropbox
sudo rm /etc/systemd/system/dropbox.service
sudo systemctl daemon-reload
Related Guides
- Google Drive: Multiple Accounts — rclone setup for Google Drive
- Filesystem Hierarchy — Understanding where files go on Linux
- Package Management Basics — apt vs snap vs flatpak
Discussion